Skip to content

Commit

Permalink
change char input to string input using parser
Browse files Browse the repository at this point in the history
  • Loading branch information
WeileiZeng committed Mar 31, 2020
1 parent 1071489 commit 98d69a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions my_bp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ using namespace itpp;
//input:source file for stabilzier matrix; error propability p ;

int main(int argc, char **argv){
char * filename_G=argv[1]; GF2mat G =MM_to_GF2mat(filename_G);
char * filename_H=argv[2]; GF2mat H =MM_to_GF2mat(filename_H);
char * filename_result=argv[3];//prefix for the file
double p=atof(argv[4]);
Parser parser;
parser.init(argc,argv);
//p.set_silentmode(true);
string filename_G, filename_H, filename_result;
parser.get(filename_G,"filename_G");
parser.get(filename_H,"filename_H");
parser.get(filename_result,"filename_result");
GF2mat G =MM_to_GF2mat(filename_G);
GF2mat H =MM_to_GF2mat(filename_H);

//char * filename_result=argv[3];//prefix for the file
double p;
parser.get(p,"p");
//atof(argv[4]);
p=p/100000.0;//previous use 1000 division. Now use 100,000 division cause the thershold for toric codes seems to be around 0.1%.

//parameter setup
Expand Down
Binary file modified my_bp1.out
Binary file not shown.
2 changes: 1 addition & 1 deletion run_my_bp1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ do
#for i in {2000..2000..100}
do
#add G matrix on Dec 14
./my_bp1.out ${stabilizer_folder}/toric_S_x_size_${size}.mm ${stabilizer_folder}/toric_S_z_size_${size}.mm ${error_folder}/toric_S_size_${size}.mm_rate $i &
./my_bp1.out filename_G=${stabilizer_folder}/toric_S_x_size_${size}.mm filename_H=${stabilizer_folder}/toric_S_z_size_${size}.mm filename_result=${error_folder}/toric_S_size_${size}.mm_rate p=$i &
echo $i
num_process=`pgrep -c decoding`
while (( num_process > 15 ))
Expand Down

0 comments on commit 98d69a7

Please sign in to comment.