Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Weilei Zeng committed Apr 14, 2020
1 parent fb0e5e1 commit 948f015
Show file tree
Hide file tree
Showing 28 changed files with 332 additions and 39,774 deletions.
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.fontSize": 14
}
21 changes: 21 additions & 0 deletions gnuplot/build_index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
echo this script will build the index to show all files

echo "
<head>
<title>BP gnuplot</title>
</head>
" >index.html

echo "<h2>result in hpcc. Latest first</h2>" >> index.html


for f in $(ls -t hpcc_bp_plot/*.pdf)
do
echo $f

echo "<embed src=\"https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/$f\"
width=\"500\" height = \"320\" >" >> index.html

done

Binary file not shown.
Binary file added gnuplot/hpcc_bp_plot/bp4-test-run-nonconverge.pdf
Binary file not shown.
Empty file removed gnuplot/hpcc_bp_plot/hello.txt
Empty file.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions gnuplot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

<head>
<title>BP gnuplot</title>
</head>

<h2>result in hpcc. Latest first</h2>
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/hpcc_bp_plot/bp4-test-run-nonconverge.pdf"
width="500" height = "320" >
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/hpcc_bp_plot/bp4-iter-9-fb-5-data-1000-sch-3-min-sum-nonconverge.pdf"
width="500" height = "320" >
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/hpcc_bp_plot/my-bp4-iter-9-fb-25-data-100-schedule-3-hpcc-nonconverge.pdf"
width="500" height = "320" >
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/hpcc_bp_plot/my-bp4-iter-9-fb-5-data-100-schedule-3-hpcc-nonconverge.pdf"
width="500" height = "320" >
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=https://cluster.hpcc.ucr.edu/~wzeng002/gnuplot_bp/hpcc_bp_plot/my-bp4-iter-9-fb-5-data-500-schedule-3-nonconverge.pdf"
width="500" height = "320" >
14 changes: 14 additions & 0 deletions gnuplot/result/bp4-iter-9-fb-5-data-1000-sch-3-min-sum.gnudat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# header
# sizes: 13, 9, 5,
# p, P_c converge rate, counts_total, counts_nonconverge, timer.toc()
0.199526 0.000000 50.000000 50.000000 42.349861 0.199526 0.002200 50.000000 49.890000 7.171697 0.199526 0.204000 50.000000 39.800000 0.481682
0.158489 0.000000 50.000000 50.000000 42.920918 0.158489 0.008600 50.000000 49.570000 6.075705 0.158489 0.264400 50.000000 36.780000 0.444526
0.125893 0.000400 50.000000 49.980000 42.920078 0.125893 0.030400 50.000000 48.480000 5.758175 0.125893 0.386000 50.000000 30.700000 0.406186
0.100000 0.010400 50.000000 49.480000 41.827445 0.100000 0.087200 50.000000 45.640000 4.735014 0.100000 0.489800 50.000000 25.510000 0.353063
0.079433 0.049000 50.000000 47.550000 41.603979 0.079433 0.227400 50.000000 38.630000 3.048288 0.079433 0.628623 50.040000 18.580000 0.281547
0.063096 0.163200 50.000000 41.840000 35.717119 0.063096 0.395200 50.000000 30.240000 2.703923 0.063096 0.750037 53.140000 13.070000 0.222910
0.050119 0.332600 50.000000 33.370000 28.677991 0.050119 0.583800 50.000000 20.810000 1.837314 0.050119 0.813417 59.000000 10.750000 0.192187
0.039811 0.507200 50.000000 24.640000 21.283710 0.039811 0.710101 50.580000 14.630000 1.429604 0.039811 0.877190 88.560000 10.010000 0.197353
0.031623 0.667084 50.080000 16.660000 14.844819 0.031623 0.811506 63.320000 11.410000 1.208076 0.031623 0.921253 136.320000 9.950000 0.217659
0.025119 0.793175 55.220000 11.220000 10.225060 0.025119 0.887930 97.500000 10.260000 1.225184 0.025119 0.945875 207.900000 10.190000 0.229289
0.019953 0.859095 75.140000 10.010000 9.940657 0.019953 0.927257 149.360000 9.860000 1.342928 0.019953 0.967397 345.180000 10.100000 0.262931
14 changes: 14 additions & 0 deletions gnuplot/result/bp4-iter-9-fb-5-data-1000-sch-5-min-sum.gnudat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# header
# sizes: 13, 9, 5,
# p, P_c converge rate, counts_total, counts_nonconverge, timer.toc()
0.199526 0.000000 50.000000 50.000000 39.521921 0.199526 0.002800 50.000000 49.860000 7.370960 0.199526 0.189000 50.000000 40.550000 0.799141
0.158489 0.000000 50.000000 50.000000 35.676885 0.158489 0.007000 50.000000 49.650000 7.163924 0.158489 0.270400 50.000000 36.480000 0.631908
0.125893 0.000000 50.000000 50.000000 35.660188 0.125893 0.030200 50.000000 48.490000 6.951911 0.125893 0.379200 50.000000 31.040000 0.544681
0.100000 0.005000 50.000000 49.750000 35.472279 0.100000 0.097200 50.000000 45.140000 6.403329 0.100000 0.481400 50.000000 25.930000 0.549479
0.079433 0.039600 50.000000 48.020000 34.594444 0.079433 0.213600 50.000000 39.320000 5.244719 0.079433 0.611906 50.480000 19.550000 0.457827
0.063096 0.160200 50.000000 41.990000 30.265236 0.063096 0.400800 50.000000 29.960000 4.153237 0.063096 0.734082 51.500000 13.590000 0.292067
0.050119 0.330600 50.000000 33.470000 24.944159 0.050119 0.586800 50.000000 20.660000 2.675163 0.050119 0.810506 61.380000 11.200000 0.258730
0.039811 0.540200 50.000000 22.990000 17.347440 0.039811 0.725380 51.740000 14.110000 2.265066 0.039811 0.874142 85.800000 9.980000 0.264443
0.031623 0.705699 50.780000 14.860000 11.332062 0.031623 0.819010 61.560000 10.700000 1.854263 0.031623 0.916301 136.700000 10.160000 0.280192
0.025119 0.814809 60.820000 10.830000 9.222927 0.025119 0.885483 98.020000 10.270000 1.984724 0.025119 0.946636 217.280000 10.220000 0.270651
0.019953 0.882302 91.980000 9.950000 8.856739 0.019953 0.929656 154.960000 9.880000 2.010169 0.019953 0.968491 336.020000 9.720000 0.291593
14 changes: 14 additions & 0 deletions gnuplot/result/bp4-test-run.gnudat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# header
# sizes: 13, 9, 5,
# p, P_c converge rate, counts_total, counts_nonconverge, timer.toc()
0.199526 0.000000 50.000000 50.000000 19.375611 0.199526 0.002000 50.000000 49.900000 4.610868 0.199526 0.180000 50.000000 41.000000 0.452473
0.158489 0.000000 50.000000 50.000000 19.118438 0.158489 0.004000 50.000000 49.800000 4.554099 0.158489 0.218000 50.000000 39.100000 0.431312
0.125893 0.002000 50.000000 49.900000 19.149294 0.125893 0.030000 50.000000 48.500000 4.480468 0.125893 0.366000 50.000000 31.700000 0.362333
0.100000 0.008000 50.000000 49.600000 19.018219 0.100000 0.076000 50.000000 46.200000 4.269471 0.100000 0.488000 50.000000 25.600000 0.300627
0.079433 0.046000 50.000000 47.700000 19.441428 0.079433 0.200000 50.000000 40.000000 3.804752 0.079433 0.614000 50.000000 19.300000 0.233830
0.063096 0.150000 50.000000 42.500000 16.632492 0.063096 0.372000 50.000000 31.400000 3.108739 0.063096 0.764512 60.400000 13.900000 0.173220
0.050119 0.348000 50.000000 32.600000 13.330025 0.050119 0.562000 50.000000 21.900000 2.299653 0.050119 0.812539 55.600000 10.100000 0.134198
0.039811 0.542000 50.000000 22.900000 9.944878 0.039811 0.690000 50.000000 15.500000 1.772086 0.039811 0.876434 84.400000 10.200000 0.161413
0.031623 0.721414 52.600000 14.600000 6.846655 0.031623 0.819388 53.600000 9.600000 1.134529 0.031623 0.918760 156.800000 10.700000 0.169825
0.025119 0.803461 64.600000 11.900000 5.974508 0.025119 0.889398 90.400000 9.000000 1.203359 0.025119 0.936954 182.600000 9.700000 0.163149
0.019953 0.896798 125.400000 11.600000 7.128953 0.019953 0.937744 165.800000 10.000000 1.478231 0.019953 0.969358 378.400000 10.600000 0.201181
14 changes: 14 additions & 0 deletions gnuplot/result/my-bp4-iter-9-fb-25-data-100-schedule-3-hpcc.gnudat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#header
sizes: 13, 9, 5,
p, P_c converge rate, zero error vectors, weight one error, weight 2 error
0.199526 0.021429 18.600000 0.000000 0.000000 0.199526 0.050431 48.200000 0.000000 0.000000 0.199526 0.282000 50.000000 0.000000 0.000000
0.158489 0.000000 18.700000 0.000000 0.000000 0.158489 0.077567 48.900000 0.000000 0.000000 0.158489 0.338000 50.000000 0.000000 0.000000
0.125893 0.011012 18.700000 0.000000 0.000000 0.125893 0.124768 47.400000 0.000000 0.000000 0.125893 0.448000 50.000000 0.000000 0.000000
0.100000 0.016374 19.200000 0.000000 0.000000 0.100000 0.142000 50.000000 0.000000 0.000000 0.100000 0.538000 50.000000 0.000000 0.000000
0.079433 0.071272 18.600000 0.000000 0.000000 0.079433 0.246000 50.000000 0.000000 0.000000 0.079433 0.640000 50.000000 0.000000 0.000000
0.063096 0.134129 20.800000 0.000000 0.000000 0.063096 0.342000 50.000000 0.000000 0.000000 0.063096 0.714000 50.000000 0.000000 0.000000
0.050119 0.269623 22.300000 0.000000 0.000000 0.050119 0.536000 50.000000 0.000000 0.000000 0.050119 0.778889 53.600000 0.000000 0.000000
0.039811 0.386245 27.900000 0.000000 0.000000 0.039811 0.616000 50.000000 0.000000 0.000000 0.039811 0.850523 72.400000 0.000000 0.000000
0.031623 0.455084 33.900000 0.000000 0.000000 0.031623 0.709778 50.400000 0.000000 0.000000 0.031623 0.893439 103.200000 0.000000 0.000000
0.025119 0.598603 41.700000 0.000000 0.000000 0.025119 0.792973 55.400000 0.000000 0.000000 0.025119 0.930352 193.000000 0.000000 0.000000
0.019953 0.720942 47.400000 0.000000 0.000000 0.019953 0.847863 70.400000 0.000000 0.000000 0.019953 0.955299 218.200000 0.000000 0.000000
14 changes: 14 additions & 0 deletions gnuplot/result/my-bp4-iter-9-fb-5-data-100-schedule-3-hpcc.gnudat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#header
sizes: 13, 9, 5,
p, P_c converge rate, zero error vectors, weight one error, weight 2 error
0.199526 0.000000 50.000000 0.000000 0.000000 0.199526 0.000000 50.000000 0.000000 0.000000 0.199526 0.202000 50.000000 0.000000 0.000000
0.158489 0.000000 50.000000 0.000000 0.000000 0.158489 0.006000 50.000000 0.000000 0.000000 0.158489 0.254000 50.000000 0.000000 0.000000
0.125893 0.000000 50.000000 0.000000 0.000000 0.125893 0.042000 50.000000 0.000000 0.000000 0.125893 0.370000 50.000000 0.000000 0.000000
0.100000 0.008000 50.000000 0.000000 0.000000 0.100000 0.110000 50.000000 0.000000 0.000000 0.100000 0.486000 50.000000 0.000000 0.000000
0.079433 0.048000 50.000000 0.000000 0.000000 0.079433 0.198000 50.000000 0.000000 0.000000 0.079433 0.638000 50.000000 0.000000 0.000000
0.063096 0.174000 50.000000 0.000000 0.000000 0.063096 0.452000 50.000000 0.000000 0.000000 0.063096 0.698000 50.000000 0.000000 0.000000
0.050119 0.364000 50.000000 0.000000 0.000000 0.050119 0.600000 50.000000 0.000000 0.000000 0.050119 0.815951 56.600000 0.000000 0.000000
0.039811 0.574000 50.000000 0.000000 0.000000 0.039811 0.744407 53.600000 0.000000 0.000000 0.039811 0.868985 90.600000 0.000000 0.000000
0.031623 0.700000 50.000000 0.000000 0.000000 0.031623 0.835550 63.600000 0.000000 0.000000 0.031623 0.915198 150.000000 0.000000 0.000000
0.025119 0.828895 54.800000 0.000000 0.000000 0.025119 0.883078 94.000000 0.000000 0.000000 0.025119 0.950731 240.400000 0.000000 0.000000
0.019953 0.870165 74.000000 0.000000 0.000000 0.019953 0.933443 123.800000 0.000000 0.000000 0.019953 0.954225 264.200000 0.000000 0.000000
14 changes: 10 additions & 4 deletions gnuplot/toric_rate.gnu
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/gnuplot
# ! /usr/bin/gnuplot

# parameter
data_folder='result'

#data_title='data-cycle100'
#data_title='iteration10-cycle1000'
data_title='iteration0-cycle1000-Dint2-300'
data_title='iteration0-cycle1000-Dint2-50'
#data_title='iteration0-cycle1000-Dint2-300'
#data_title='iteration0-cycle1000-Dint2-50'

#data_title='my-bp2-iteration0-cycle200'
#data_title='my-bp2-iteration0-cycle1000-prod-check'
Expand All @@ -25,6 +25,9 @@ data_title='my-bp3-feedback5-num-data-1000-schedule-p'
data_title='my-bp4-iter-9-fb-0-data-50-schedule-3'
data_title='my-bp4-iter-9-fb-5-data-50-schedule-3'
data_title='my-bp4-iter-9-fb-5-data-500-schedule-3'
data_title='my-bp4-iter-9-fb-5-data-100-schedule-3-hpcc'
data_title='bp4-iter-9-fb-5-data-1000-sch-3-min-sum'
data_title='bp4-test-run'


plot_title='-weight'
Expand Down Expand Up @@ -86,4 +89,7 @@ plot for [i=1:3] data_file using (column((i-1)*5+1)):(1-column((i-1)*5+2)) title



#pause -1 "hit any key to exit"
#pause -1 "hit any key to exit"


# system "./build_index.sh"
81 changes: 38 additions & 43 deletions my_bp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@ int main(int argc, char **argv){
Parser parser;
parser.init(argc,argv);
//p.set_silentmode(true);
string filename_G, filename_H, filename_result;
string filename_G, filename_H;
//parser.get(filename_G,"filename_G");

Real_Timer timer; double remained_time; //remained time for each size
vector<future<int>> pool;
int cores=32;
int cores=32; parser.get(cores, "cores");
vector<future<int>>::size_type pool_size = cores+2; //max number of threads, 15 with decreasing size for best performace
std::chrono::milliseconds span (100);
std::chrono::milliseconds final_thread_time (10000);//10 secs before prelimilary result print
string filename_data;
filename_data="gnuplot/result/my-bp4-iter-9-fb-5-data-500-schedule-3-hpcc.gnudat";
int feedback=5;
filename_data="gnuplot/result/my-bp4-iter-9-fb-25-data-100-schedule-3-hpcc.gnudat";
parser.get(filename_data,"filename_data");

int feedback=25; parser.get(feedback,"feedback");
// int cycles = 1000000;//70 sec for 2,000,000
double time_out=200;//time out in seconds for each data points (p and size)
int num_data_points = 500;//data entry for each data points
// double time_out=200;//time out in seconds for each data points (p and size)
int num_data_points = 100;//data entry for each data points
parser.get(num_data_points, "num_data_points");
//change parameter p, code size
double p;
//parser.get(p,"p");
Expand All @@ -52,16 +54,23 @@ int main(int argc, char **argv){
mat data(data_rows,5 * size_of_sizes ); //return result in a mat, 5 columns for each size. format defines in header
data.zeros();

int exit_iteration=9; parser.get(exit_iteration,"exit_iteration");
int schedule_mode=4; parser.get(schedule_mode, "schedule_mode");

//split tasks into smaller chunks
int chunk_num_data_points=10;//number of data points in each chunk
int chunk_size=num_data_points/chunk_num_data_points;
int chunk_size=num_data_points/chunk_num_data_points; //number of chunks for each p and size
int chunk_num_for_each_size = chunk_size*((ip_begin-ip_end)/0.1);

//timeout should be 5 times longer in hpcc
double chunk_time_out = 100.0;//time_out/chunk_size;
parser.get(chunk_time_out,"chunk_time_out");
int chunk_cycles=chunk_num_data_points*1000;//1000 for prob 1/1000

mat chunk_data(data_rows*chunk_size,5*5);
chunk_data.zeros();



int col_index=-5;
for ( int size : sizes){
// cout<<"size = "<<size<<endl;
Expand All @@ -74,13 +83,14 @@ int main(int argc, char **argv){
//set up for BP_Decoder
BP_Decoder bp_decoder;
bp_decoder.init(H);
//bp_decoder.set_decode_mode_str("min sum");
bp_decoder.set_exit_iteration(9);
bp_decoder.set_decode_mode_str("min sum");
bp_decoder.set_exit_iteration(exit_iteration);
bp_decoder.set_debug_mode(false);
bp_decoder.set_schedule_mode(4);
bp_decoder.set_schedule_mode(schedule_mode);
bp_decoder.print_info();

int row_index=-1;
timer.tic();
for ( double ip=ip_begin;ip > ip_end;ip-=0.1){
//cout<<"ip = "<<ip<<endl;
// row_index ++;
Expand Down Expand Up @@ -109,14 +119,17 @@ int main(int argc, char **argv){
//pool.push_back(move(fut));
//pool.push_back(async(launch::async, decode, bp_decoder, G, H, p, & data,col_index, row_index, cycles, feedback, time_out, num_data_points) );
pool.push_back(async(launch::async, decode, bp_decoder, G, H, p, & chunk_data,col_index, row_index, chunk_cycles, feedback, chunk_time_out, chunk_num_data_points) );


remained_time = timer.toc()/(row_index+1)*chunk_num_for_each_size;
cout<<"my_bp: add new thread. pool_size="<<pool.size()
<<", size = "<<size
<<", p = "<<p
<<", row_index = "<<row_index
<<", row_index = "<<row_index<<"/"<<chunk_num_for_each_size
<<", remained time for this p is "<< remained_time <<" sec"
<<", col_index = "<<col_index
<<", chunk_cycles = "<<chunk_cycles
<<endl;

}
}
}
Expand All @@ -128,11 +141,11 @@ int main(int argc, char **argv){
}

//print prelimilary result
string header="#header\nsizes: ";
string header="# header\n# sizes: ";
for (int size : sizes){
header += to_string(size) + ", ";
}
header += ("\n p, P_c converge rate, zero error vectors, weight one error, weight 2 error");
header += ("\n# p, P_c converge rate, counts_total, counts_nonconverge, timer.toc()");
// mat2gnudata(data,filename_data,header);
//cout<<"save prelimilary data to "<<filename_data.c_str()<<endl;

Expand Down Expand Up @@ -174,17 +187,17 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in
int max_repetition = feedback;//10 for best result. supposed to be zero in our set up, just for a check

Real_Timer timer;
int N = H.cols();
int nvar = H.cols();
//int N = C.get_nvar(); // number of bits per codeword; N=2 x n x n is the size of the toric code.

bvec bitsin = zeros_b(N);//original zero vector
bvec bitsin = zeros_b(nvar);//original zero vector

RNG_randomize();
timer.tic();

BSC bsc(p); // initialize BSC, error channel with probability pp
int ans=0; //the value return by bp_decoding(), which is the number of iterations and with a minus sign if it doesn't converge
vec LLRin(H.cols());
vec LLRin(nvar);
double LLR=log( (1-p)/p);

int counts_converge=0;
Expand All @@ -193,38 +206,17 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in
//bvec rec_bits = bitsin; // input vector with manually-input errors, for test

bvec rec_bits0 = bsc(bitsin); // input vector with errors from bsc chanel
//bvec rec_bits = find_error(rec_bits0,H);//switch to en error with same syndrome
bvec rec_bits=rec_bits0;

// bvec rec_bits( error_transform(rec_bits0,MM_to_GF2mat(filename_G)) ); //for test

// vec s(N), s0(N); // input LLR version
QLLRvec llr_output;
// for(int i1=0;i1<N;i1++) s(i1)=s0(i1)=(rec_bits(i1)==1)?-log(1.0/p-1.0):log(1.0/p-1.0);


// QLLRvec llr_input=C.get_llrcalc().to_qllr(s);
//cout<<"llr_input="<<llr_input<<endl;

// int ans0;
//ans0=C.bp_decode(llr_input, llr_output);
//replace the above line using my bp decoder

bvec error=rec_bits;
bvec syndrome = (H*error);
//cout<<"syndrome = "<<syndrome<<endl;
LLRin.ones();
LLRin = LLRin*LLR;

vec LLRout(LLRin);//default, zero syndrome give zero error
//LLRout.zeros();
//cout<<"LLRin = "<< LLRin<<endl;
// cout<<"LLRout = "<< LLRout<<endl;
// int exit_iteration = exit_at_iteration*1;
// ans = bp_syndrome_llr(H,syndrome,LLRin, LLRout, exit_iteration, decode_mode);
ans = bp_decoder.decode(syndrome,LLRin, LLRout);


bvec bitsout = llr_output < bound; //30;//0;//output

//enhanced feedback
Expand All @@ -237,7 +229,8 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in

LLRin = LLRout;
LLRout.zeros();
ans = bp_decoder.bp_syndrome_llr(syndrome,LLRin, LLRout);
ans = bp_decoder.decode(syndrome,LLRin, LLRout);
// ans = bp_decoder.bp_syndrome_llr(syndrome,LLRin, LLRout);
// ans = bp_syndrome_llr(H,syndrome,LLRin, LLRout, exit_iteration, decode_mode);
bitsout = LLRout < bound;

Expand Down Expand Up @@ -274,7 +267,7 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in
//this statistical method create an overall bias
int counts_total = counts_converge+counts_nonconverge;
double rate_converge=counts_converge*1.0/counts_total;
cout<<"N = "<<N<<" = 2 x "<< N/2;
cout<<"Run summary: nvar = "<<nvar<<" = 2 x "<< nvar/2;
cout<<", p = "<<p;
cout<<", Converge rate ="<<rate_converge
<<", cycles = "<<cycles
Expand All @@ -287,6 +280,8 @@ int decode( BP_Decoder bp_decoder, GF2mat G, GF2mat H, double p, mat * data, in
data->set(row_index,col_index,p);
data->set(row_index,col_index+1,rate_converge);
data->set(row_index,col_index+2,counts_total);
data->set(row_index,col_index+3,counts_nonconverge);
data->set(row_index,col_index+4,timer.toc());

timer.toc_print();
return 0;
Expand Down
Binary file modified my_bp4.out
Binary file not shown.
Loading

0 comments on commit 948f015

Please sign in to comment.