Skip to content

Commit

Permalink
add check code, then recover
Browse files Browse the repository at this point in the history
  • Loading branch information
Weilei Zeng at qlab01 committed Sep 21, 2023
1 parent c20343e commit 717b343
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions verification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,21 @@ bool verify(std::string code_prefix, double & rho_x, double & rho_z, int & n_Gx,
n_Gx = code.Gx.rows()*code.Gx.cols();
n_Gz = code.Gz.rows()*code.Gz.cols();

if (data["verified"]==1 ){
if (data["verified"]==1 ){ //skip verified codes
// std::cout<<"the code has been verified. skip"<<std::endl;
return true;
}else{

}

code.dist();

if (code.d == data["d"]){
data["verified"]=1;
std::string filename_json = code_prefix +".json";
/* std::ofstream filejson(filename_json);
filejson << data;//j_object_t;
filejson.close();
*/
if (true){//write verified flag into json file.
data["verified"]=1;
std::string filename_json = code_prefix +".json";
std::ofstream filejson(filename_json);
filejson << data;//j_object_t;
filejson.close();
}
return true;
}else{
return false;
Expand Down

0 comments on commit 717b343

Please sign in to comment.