5 #include "weilei_lib/my_lib.h"
6 #include <itpp/itbase.h>
19 int main(
int args,
char ** argv){
21 parser.init(args,argv);
22 parser.set_silentmode(
true);
23 int mode = 1; parser.get(mode,
"mode");
24 int sub_mode = 1; parser.get(sub_mode,
"sub_mode");
25 std::string title_str; parser.get(title_str,
"title");
26 const char * title = title_str.c_str();
27 std::string note=
""; parser.get(note,
"note");
29 parser.get(debug,
"debug");
30 int seed=1; parser.get(seed,
"seed");
32 if (debug) std::cout<<
"input seed: "<<seed<<
" --> ";
37 if (debug) std::cout<<
"converted seed:"<<seed;
41 int n_low; parser.get(n_low,
"n_low");
42 int n_high; parser.get(n_high,
"n_high");
43 int k_low; parser.get(k_low,
"k_low");
44 int k_high; parser.get(k_high,
"k_high");
49 Real_Timer timer; timer.tic();
51 GF2mat Gax,Gaz,Cax,Caz;
52 GF2mat Gbx,Gbz,Cbx,Cbz;
53 int na,ka, Gax_row,Gaz_row;
54 int nb,kb, Gbx_row,Gbz_row;
58 char filename_Gax[256];
char filename_Gaz[256];
char filename_Gbx[256];
char filename_Gbz[256];
59 sprintf(filename_Gax,
"%sGax.mm",title); sprintf(filename_Gaz,
"%sGaz.mm",title); sprintf(filename_Gbx,
"%sGbx.mm",title); sprintf(filename_Gbz,
"%sGbz.mm",title);
61 if (debug) cout<<mode<<endl<<title<<endl;
64 na=randi(n_low,n_high); ka = randi(k_low,k_high);Gax_row=randi(1,na-ka-1); Gaz_row=na-ka-Gax_row;
72 nb=randi(n_low,n_high); kb = randi(k_low,k_high);Gbx_row=randi(1,nb-kb-1); Gbz_row=nb-kb-Gbx_row;
102 if (debug) cout<<
"check "<<title<<endl;
114 if (debug) {cout<<
"Gax "<<Gax<<endl; cout<<
"Gaz "<<Gaz<<endl; cout<<
"Cax "<<Cax<<endl; cout<<
"Caz "<<Caz<<endl;}
115 if (debug) { cout<<
"Gbx "<<Gbx<<endl; cout<<
"Gbz "<<Gbz<<endl; cout<<
"Cbx "<<Cbx<<endl; cout<<
"Cbz "<<Cbz<<endl;}
145 int flag_chain_complex=0;
147 if (
product(Gax,Gaz,Gbx,Gbz,dax,daz,dbx,dbz,debug,0) == 2) {
148 std::cout<<title<<
","<<note<<
", time:"<<timer.toc()<<std::endl;
149 flag_chain_complex=1;
152 if (
product(Gax,Gaz,Gbx,Gbz,dax,daz,dbx,dbz,debug,1) == 2){
153 std::cout<<title<<
","<<note<<
", time:"<<timer.toc()<<std::endl;
157 flag_chain_complex=1;
162 if ( flag_chain_complex ){
166 if (
product(Gax,Gaz,Gbx,Gbz,dax,daz,dbx,dbz,debug,3) == 2)
167 std::cout<<title<<
","<<note<<
", time:"<<timer.toc()<<std::endl;
171 if (
product(Gax,Gaz,Gbx,Gbz,dax,daz,dbx,dbz,debug,4) == 2)
172 std::cout<<title<<
","<<note<<
", time:"<<timer.toc()<<std::endl;
178 if ( debug ) timer.toc_print();