diff --git a/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible-01.gnudat b/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible-01.gnudat new file mode 100644 index 0000000..4b7ad64 --- /dev/null +++ b/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible-01.gnudat @@ -0,0 +1,16 @@ +#header +sizes: 13, 11, 9, 7, 5, + p, P_c converge rate, zero error vectors, weight one error, weight 2 error +0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 +0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.019231 52.000000 0.000000 0.000000 0.158489 0.072727 55.000000 0.000000 0.000000 +0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.055556 54.000000 0.000000 0.000000 0.125893 0.203125 64.000000 0.000000 0.000000 +0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.019231 52.000000 0.000000 0.000000 0.100000 0.150000 60.000000 0.000000 0.000000 0.100000 0.439560 91.000000 0.000000 0.000000 +0.079433 0.037736 53.000000 0.000000 0.000000 0.079433 0.089286 56.000000 0.000000 0.000000 0.079433 0.150000 60.000000 0.000000 0.000000 0.079433 0.260870 69.000000 0.000000 0.000000 0.079433 0.523364 107.000000 0.000000 0.000000 +0.063096 0.135593 59.000000 0.000000 0.000000 0.063096 0.135593 59.000000 0.000000 0.000000 0.063096 0.260870 69.000000 0.000000 0.000000 0.063096 0.556522 115.000000 0.000000 0.000000 0.063096 0.710227 176.000000 0.000000 0.000000 +0.050119 0.301370 73.000000 0.000000 0.000000 0.050119 0.354430 79.000000 0.000000 0.000000 0.050119 0.370370 81.000000 0.000000 0.000000 0.050119 0.592000 125.000000 0.000000 0.000000 0.050119 0.808271 266.000000 0.000000 0.000000 +0.039811 0.439560 91.000000 0.000000 0.000000 0.039811 0.598425 127.000000 0.000000 0.000000 0.039811 0.673077 156.000000 0.000000 0.000000 0.039811 0.762791 215.000000 0.000000 0.000000 0.039811 0.854701 351.000000 0.000000 0.000000 +0.031623 0.532110 109.000000 0.000000 0.000000 0.031623 0.633094 139.000000 0.000000 0.000000 0.031623 0.808271 266.000000 0.000000 0.000000 0.031623 0.832237 304.000000 0.000000 0.000000 0.031623 0.922137 655.000000 0.000000 0.000000 +0.025119 0.650685 146.000000 0.000000 0.000000 0.025119 0.788382 241.000000 0.000000 0.000000 0.025119 0.846386 332.000000 0.000000 0.000000 0.025119 0.905028 537.000000 0.000000 0.000000 0.025119 0.948171 984.000000 0.000000 0.000000 +0.019953 0.787500 240.000000 0.000000 0.000000 0.019953 0.873134 402.000000 0.000000 0.000000 0.019953 0.899606 508.000000 0.000000 0.000000 0.019953 0.937653 818.000000 0.000000 0.000000 0.019953 0.968635 1626.000000 0.000000 0.000000 +0.015849 0.844512 328.000000 0.000000 0.000000 0.015849 0.895706 489.000000 0.000000 0.000000 0.015849 0.922727 660.000000 0.000000 0.000000 0.015849 0.956926 1184.000000 0.000000 0.000000 0.015849 0.976648 2184.000000 0.000000 0.000000 +0.012589 0.928371 712.000000 0.000000 0.000000 0.012589 0.933938 772.000000 0.000000 0.000000 0.012589 0.947799 977.000000 0.000000 0.000000 0.012589 0.974359 1989.000000 0.000000 0.000000 0.012589 0.987805 4182.000000 0.000000 0.000000 diff --git a/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible.gnudat b/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible.gnudat index 83e0f17..1368205 100644 --- a/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible.gnudat +++ b/gnuplot/result/my-bp4-feedback5-num-data-1000-flexible.gnudat @@ -1,16 +1,16 @@ #header sizes: 13, 11, 9, 7, 5, p, P_c converge rate, zero error vectors, weight one error, weight 2 error -0.199526 0.037736 53.000000 0.000000 0.000000 0.199526 0.163934 61.000000 0.000000 0.000000 0.199526 0.250000 68.000000 0.000000 0.000000 0.199526 0.439560 91.000000 0.000000 0.000000 0.199526 0.630435 138.000000 0.000000 0.000000 -0.158489 0.055556 54.000000 0.000000 0.000000 0.158489 0.105263 57.000000 0.000000 0.000000 0.158489 0.250000 68.000000 0.000000 0.000000 0.158489 0.439560 91.000000 0.000000 0.000000 0.158489 0.786611 239.000000 0.000000 0.000000 -0.125893 0.072727 55.000000 0.000000 0.000000 0.125893 0.238806 67.000000 0.000000 0.000000 0.125893 0.238806 67.000000 0.000000 0.000000 0.125893 0.625000 136.000000 0.000000 0.000000 0.125893 0.796000 250.000000 0.000000 0.000000 -0.100000 0.260870 69.000000 0.000000 0.000000 0.100000 0.215385 65.000000 0.000000 0.000000 0.100000 0.560345 116.000000 0.000000 0.000000 0.100000 0.737113 194.000000 0.000000 0.000000 0.100000 0.873762 404.000000 0.000000 0.000000 -0.079433 0.445652 92.000000 0.000000 0.000000 0.079433 0.575000 120.000000 0.000000 0.000000 0.079433 0.737113 194.000000 0.000000 0.000000 0.079433 0.827703 296.000000 0.000000 0.000000 0.079433 0.900391 512.000000 0.000000 0.000000 -0.063096 0.648276 145.000000 0.000000 0.000000 0.063096 0.799213 254.000000 0.000000 0.000000 0.063096 0.864721 377.000000 0.000000 0.000000 0.063096 0.905904 542.000000 0.000000 0.000000 0.063096 0.947314 968.000000 0.000000 0.000000 -0.050119 0.845921 331.000000 0.000000 0.000000 0.050119 0.914141 594.000000 0.000000 0.000000 0.050119 0.926724 696.000000 0.000000 0.000000 0.050119 0.945860 942.000000 0.000000 0.000000 0.050119 0.971445 1786.000000 0.000000 0.000000 -0.039811 0.955224 1139.000000 0.000000 0.000000 0.039811 0.958671 1234.000000 0.000000 0.000000 0.039811 0.960949 1306.000000 0.000000 0.000000 0.039811 0.966732 1533.000000 0.000000 0.000000 0.039811 0.987531 4090.000000 0.000000 0.000000 -0.031623 0.983628 3115.000000 0.000000 0.000000 0.031623 0.985722 3572.000000 0.000000 0.000000 0.031623 0.983789 3146.000000 0.000000 0.000000 0.031623 0.990916 5614.000000 0.000000 0.000000 0.031623 0.993903 8365.000000 0.000000 0.000000 -0.025119 0.992677 6964.000000 0.000000 0.000000 0.025119 0.993458 7796.000000 0.000000 0.000000 0.025119 0.994167 8744.000000 0.000000 0.000000 0.025119 0.994458 9202.000000 0.000000 0.000000 0.025119 0.996748 15685.000000 0.000000 0.000000 -0.019953 0.996103 13087.000000 0.000000 0.000000 0.019953 0.997688 22060.000000 0.000000 0.000000 0.019953 0.996726 15575.000000 0.000000 0.000000 0.019953 0.997832 23519.000000 0.000000 0.000000 0.019953 0.998046 26101.000000 0.000000 0.000000 -0.015849 0.998520 34448.000000 0.000000 0.000000 0.015849 0.998550 35178.000000 0.000000 0.000000 0.015849 0.998645 37644.000000 0.000000 0.000000 0.015849 0.999056 54025.000000 0.000000 0.000000 0.015849 0.999134 58923.000000 0.000000 0.000000 -0.012589 0.999372 81203.000000 0.000000 0.000000 0.012589 0.999414 86983.000000 0.000000 0.000000 0.012589 0.999415 87206.000000 0.000000 0.000000 0.012589 0.999494 100757.000000 0.000000 0.000000 0.012589 0.999616 132694.000000 0.000000 0.000000 +0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 +0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.019231 52.000000 0.000000 0.000000 0.158489 0.019231 52.000000 0.000000 0.000000 +0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.019231 52.000000 0.000000 0.000000 0.125893 0.019231 52.000000 0.000000 0.000000 0.125893 0.150000 60.000000 0.000000 0.000000 +0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.037736 53.000000 0.000000 0.000000 0.100000 0.135593 59.000000 0.000000 0.000000 0.100000 0.346154 78.000000 0.000000 0.000000 +0.079433 0.019231 52.000000 0.000000 0.000000 0.079433 0.089286 56.000000 0.000000 0.000000 0.079433 0.190476 63.000000 0.000000 0.000000 0.079433 0.370370 81.000000 0.000000 0.000000 0.079433 0.575000 120.000000 0.000000 0.000000 +0.063096 0.150000 60.000000 0.000000 0.000000 0.063096 0.203125 64.000000 0.000000 0.000000 0.063096 0.406977 86.000000 0.000000 0.000000 0.063096 0.479592 98.000000 0.000000 0.000000 0.063096 0.760563 213.000000 0.000000 0.000000 +0.050119 0.163934 61.000000 0.000000 0.000000 0.050119 0.362500 80.000000 0.000000 0.000000 0.050119 0.439560 91.000000 0.000000 0.000000 0.050119 0.610687 131.000000 0.000000 0.000000 0.050119 0.800000 255.000000 0.000000 0.000000 +0.039811 0.451613 93.000000 0.000000 0.000000 0.039811 0.479592 98.000000 0.000000 0.000000 0.039811 0.657718 149.000000 0.000000 0.000000 0.039811 0.826531 294.000000 0.000000 0.000000 0.039811 0.898406 502.000000 0.000000 0.000000 +0.031623 0.479592 98.000000 0.000000 0.000000 0.031623 0.601562 128.000000 0.000000 0.000000 0.031623 0.783898 236.000000 0.000000 0.000000 0.031623 0.858333 360.000000 0.000000 0.000000 0.031623 0.920312 640.000000 0.000000 0.000000 +0.025119 0.755981 209.000000 0.000000 0.000000 0.025119 0.791837 245.000000 0.000000 0.000000 0.025119 0.803846 260.000000 0.000000 0.000000 0.025119 0.910053 567.000000 0.000000 0.000000 0.025119 0.941176 867.000000 0.000000 0.000000 +0.019953 0.771300 223.000000 0.000000 0.000000 0.019953 0.855114 352.000000 0.000000 0.000000 0.019953 0.897796 499.000000 0.000000 0.000000 0.019953 0.935361 789.000000 0.000000 0.000000 0.019953 0.966948 1543.000000 0.000000 0.000000 +0.015849 0.835484 310.000000 0.000000 0.000000 0.015849 0.881119 429.000000 0.000000 0.000000 0.015849 0.938331 827.000000 0.000000 0.000000 0.015849 0.962828 1372.000000 0.000000 0.000000 0.015849 0.973340 1913.000000 0.000000 0.000000 +0.012589 0.908602 558.000000 0.000000 0.000000 0.012589 0.941040 865.000000 0.000000 0.000000 0.012589 0.956485 1172.000000 0.000000 0.000000 0.012589 0.975909 2117.000000 0.000000 0.000000 0.012589 0.989901 5050.000000 0.000000 0.000000 diff --git a/gnuplot/result/my-bp4-iter-9-fb-0-data-50-schedule-3.gnudat b/gnuplot/result/my-bp4-iter-9-fb-0-data-50-schedule-3.gnudat new file mode 100644 index 0000000..1cab143 --- /dev/null +++ b/gnuplot/result/my-bp4-iter-9-fb-0-data-50-schedule-3.gnudat @@ -0,0 +1,16 @@ +#header +sizes: 13, 11, 9, 7, 5, + p, P_c converge rate, zero error vectors, weight one error, weight 2 error +0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 0.199526 0.000000 51.000000 0.000000 0.000000 +0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.000000 51.000000 0.000000 0.000000 0.158489 0.055556 54.000000 0.000000 0.000000 +0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.000000 51.000000 0.000000 0.000000 0.125893 0.019231 52.000000 0.000000 0.000000 0.125893 0.055556 54.000000 0.000000 0.000000 0.125893 0.089286 56.000000 0.000000 0.000000 +0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.000000 51.000000 0.000000 0.000000 0.100000 0.037736 53.000000 0.000000 0.000000 0.100000 0.120690 58.000000 0.000000 0.000000 0.100000 0.378049 82.000000 0.000000 0.000000 +0.079433 0.019231 52.000000 0.000000 0.000000 0.079433 0.019231 52.000000 0.000000 0.000000 0.079433 0.150000 60.000000 0.000000 0.000000 0.079433 0.281690 71.000000 0.000000 0.000000 0.079433 0.556522 115.000000 0.000000 0.000000 +0.063096 0.163934 61.000000 0.000000 0.000000 0.063096 0.291667 72.000000 0.000000 0.000000 0.063096 0.271429 70.000000 0.000000 0.000000 0.063096 0.445652 92.000000 0.000000 0.000000 0.063096 0.692771 166.000000 0.000000 0.000000 +0.050119 0.301370 73.000000 0.000000 0.000000 0.050119 0.413793 87.000000 0.000000 0.000000 0.050119 0.490000 100.000000 0.000000 0.000000 0.050119 0.670968 155.000000 0.000000 0.000000 0.050119 0.800781 256.000000 0.000000 0.000000 +0.039811 0.392857 84.000000 0.000000 0.000000 0.039811 0.518868 106.000000 0.000000 0.000000 0.039811 0.645833 144.000000 0.000000 0.000000 0.039811 0.735751 193.000000 0.000000 0.000000 0.039811 0.853026 347.000000 0.000000 0.000000 +0.031623 0.540541 111.000000 0.000000 0.000000 0.031623 0.722826 184.000000 0.000000 0.000000 0.031623 0.776316 228.000000 0.000000 0.000000 0.031623 0.867188 384.000000 0.000000 0.000000 0.031623 0.914716 598.000000 0.000000 0.000000 +0.025119 0.737113 194.000000 0.000000 0.000000 0.025119 0.771300 223.000000 0.000000 0.000000 0.025119 0.840625 320.000000 0.000000 0.000000 0.025119 0.908602 558.000000 0.000000 0.000000 0.025119 0.936170 799.000000 0.000000 0.000000 +0.019953 0.819149 282.000000 0.000000 0.000000 0.019953 0.874384 406.000000 0.000000 0.000000 0.019953 0.882488 434.000000 0.000000 0.000000 0.019953 0.936010 797.000000 0.000000 0.000000 0.019953 0.969351 1664.000000 0.000000 0.000000 +0.015849 0.893971 481.000000 0.000000 0.000000 0.015849 0.936959 809.000000 0.000000 0.000000 0.015849 0.940904 863.000000 0.000000 0.000000 0.015849 0.973657 1936.000000 0.000000 0.000000 0.015849 0.980892 2669.000000 0.000000 0.000000 +0.012589 0.887665 454.000000 0.000000 0.000000 0.012589 0.943584 904.000000 0.000000 0.000000 0.012589 0.963623 1402.000000 0.000000 0.000000 0.012589 0.980271 2585.000000 0.000000 0.000000 0.012589 0.985466 3509.000000 0.000000 0.000000 diff --git a/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3-test.gnudat b/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3-test.gnudat new file mode 100644 index 0000000..cdeba00 --- /dev/null +++ b/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3-test.gnudat @@ -0,0 +1,16 @@ +#header +sizes: 13, 9, 5, + p, P_c converge rate, zero error vectors, weight one error, weight 2 error +0.199526 0.020000 6.000000 0.000000 0.000000 0.199526 0.260000 9.000000 0.000000 0.000000 0.199526 0.725143 40.000000 0.000000 0.000000 +0.158489 0.040000 7.000000 0.000000 0.000000 0.158489 0.260000 10.000000 0.000000 0.000000 0.158489 0.753333 38.000000 0.000000 0.000000 +0.125893 0.040000 6.000000 0.000000 0.000000 0.125893 0.300000 9.000000 0.000000 0.000000 0.125893 0.831667 52.000000 0.000000 0.000000 +0.100000 0.260000 10.000000 0.000000 0.000000 0.100000 0.540000 14.000000 0.000000 0.000000 0.100000 0.862881 76.000000 0.000000 0.000000 +0.079433 0.503333 16.000000 0.000000 0.000000 0.079433 0.620000 20.000000 0.000000 0.000000 0.079433 0.919778 128.000000 0.000000 0.000000 +0.063096 0.742333 34.000000 0.000000 0.000000 0.063096 0.860167 64.000000 0.000000 0.000000 0.063096 0.959495 198.000000 0.000000 0.000000 +0.050119 0.846929 68.000000 0.000000 0.000000 0.050119 0.933495 162.000000 0.000000 0.000000 0.050119 0.970153 292.000000 0.000000 0.000000 +0.039811 0.934796 192.000000 0.000000 0.000000 0.039811 0.976379 320.000000 0.000000 0.000000 0.039811 0.983999 578.000000 0.000000 0.000000 +0.031623 0.984937 648.000000 0.000000 0.000000 0.031623 0.985647 902.000000 0.000000 0.000000 0.031623 0.993545 1640.000000 0.000000 0.000000 +0.025119 0.990480 1040.000000 0.000000 0.000000 0.025119 0.994433 2600.000000 0.000000 0.000000 0.025119 0.995367 2992.000000 0.000000 0.000000 +0.019953 0.996278 2394.800000 0.000000 0.000000 0.019953 0.996719 2668.000000 0.000000 0.000000 0.019953 0.998040 5584.000000 0.000000 0.000000 +0.015849 0.998532 3915.200000 0.000000 0.000000 0.015849 0.998847 7910.000000 0.000000 0.000000 0.015849 0.998884 7848.000000 0.000000 0.000000 +0.012589 0.999391 6616.800000 0.000000 0.000000 0.012589 0.999340 10000.000000 0.000000 0.000000 0.012589 0.999480 10000.000000 0.000000 0.000000 diff --git a/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3.gnudat b/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3.gnudat new file mode 100644 index 0000000..94abbb9 --- /dev/null +++ b/gnuplot/result/my-bp4-iter-9-fb-5-data-50-schedule-3.gnudat @@ -0,0 +1,16 @@ +#header +sizes: 13, 11, 9, 7, 5, + p, P_c converge rate, zero error vectors, weight one error, weight 2 error +0.199526 0.047170 106.000000 0.000000 0.000000 0.199526 0.121739 115.000000 0.000000 0.000000 0.199526 0.223077 130.000000 0.000000 0.000000 0.199526 0.426136 176.000000 0.000000 0.000000 0.199526 0.718663 359.000000 0.000000 0.000000 +0.158489 0.064815 108.000000 0.000000 0.000000 0.158489 0.129310 116.000000 0.000000 0.000000 0.158489 0.234848 132.000000 0.000000 0.000000 0.158489 0.512077 207.000000 0.000000 0.000000 0.158489 0.766744 433.000000 0.000000 0.000000 +0.125893 0.098214 112.000000 0.000000 0.000000 0.125893 0.251852 135.000000 0.000000 0.000000 0.125893 0.384146 164.000000 0.000000 0.000000 0.125893 0.603922 255.000000 0.000000 0.000000 0.125893 0.790456 482.000000 0.000000 0.000000 +0.100000 0.234848 132.000000 0.000000 0.000000 0.100000 0.348387 155.000000 0.000000 0.000000 0.100000 0.568376 234.000000 0.000000 0.000000 0.100000 0.703812 341.000000 0.000000 0.000000 0.100000 0.862398 734.000000 0.000000 0.000000 +0.079433 0.507317 205.000000 0.000000 0.000000 0.079433 0.651724 290.000000 0.000000 0.000000 0.079433 0.719444 360.000000 0.000000 0.000000 0.079433 0.790456 482.000000 0.000000 0.000000 0.079433 0.928723 1417.000000 0.000000 0.000000 +0.063096 0.765116 430.000000 0.000000 0.000000 0.063096 0.822807 570.000000 0.000000 0.000000 0.063096 0.851471 680.000000 0.000000 0.000000 0.063096 0.922783 1308.000000 0.000000 0.000000 0.063096 0.948311 1954.000000 0.000000 0.000000 +0.050119 0.896622 977.000000 0.000000 0.000000 0.050119 0.912630 1156.000000 0.000000 0.000000 0.050119 0.940413 1695.000000 0.000000 0.000000 0.050119 0.958976 2462.000000 0.000000 0.000000 0.050119 0.972995 3740.000000 0.000000 0.000000 +0.039811 0.952715 2136.000000 0.000000 0.000000 0.039811 0.964070 2811.000000 0.000000 0.000000 0.039811 0.971469 3540.000000 0.000000 0.000000 0.039811 0.973560 3820.000000 0.000000 0.000000 0.039811 0.981938 5592.000000 0.000000 0.000000 +0.031623 0.982997 5940.000000 0.000000 0.000000 0.031623 0.988740 8970.000000 0.000000 0.000000 0.031623 0.982762 5859.000000 0.000000 0.000000 0.031623 0.989907 10007.000000 0.000000 0.000000 0.031623 0.993223 14904.000000 0.000000 0.000000 +0.025119 0.992850 9650.000000 0.000000 0.000000 0.025119 0.993723 16090.000000 0.000000 0.000000 0.025119 0.995094 20586.000000 0.000000 0.000000 0.025119 0.994566 18587.000000 0.000000 0.000000 0.025119 0.995858 24385.000000 0.000000 0.000000 +0.019953 0.996064 14737.000000 0.000000 0.000000 0.019953 0.997146 32940.000000 0.000000 0.000000 0.019953 0.997664 43230.000000 0.000000 0.000000 0.019953 0.997754 44970.000000 0.000000 0.000000 0.019953 0.997961 49531.000000 0.000000 0.000000 +0.015849 0.998689 20596.000000 0.000000 0.000000 0.015849 0.998578 44997.000000 0.000000 0.000000 0.015849 0.998998 100757.000000 0.000000 0.000000 0.015849 0.998976 98599.000000 0.000000 0.000000 0.015849 0.998904 92123.000000 0.000000 0.000000 +0.012589 0.999132 27647.000000 0.000000 0.000000 0.012589 0.999518 62231.000000 0.000000 0.000000 0.012589 0.999479 193832.000000 0.000000 0.000000 0.012589 0.999544 221734.000000 0.000000 0.000000 0.012589 0.999513 207528.000000 0.000000 0.000000 diff --git a/gnuplot/result/my-bp4-iter-9-fb-5-data-500-schedule-3.gnudat b/gnuplot/result/my-bp4-iter-9-fb-5-data-500-schedule-3.gnudat new file mode 100644 index 0000000..898c590 --- /dev/null +++ b/gnuplot/result/my-bp4-iter-9-fb-5-data-500-schedule-3.gnudat @@ -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.041693 11.140000 0.000000 0.000000 0.199526 0.246713 35.060000 0.000000 0.000000 0.199526 0.732711 51.600000 0.000000 0.000000 +0.158489 0.047399 12.200000 0.000000 0.000000 0.158489 0.269438 36.540000 0.000000 0.000000 0.158489 0.762697 52.320000 0.000000 0.000000 +0.125893 0.103328 12.560000 0.000000 0.000000 0.125893 0.373491 40.920000 0.000000 0.000000 0.125893 0.808368 58.520000 0.000000 0.000000 +0.100000 0.251895 14.420000 0.000000 0.000000 0.100000 0.546519 48.420000 0.000000 0.000000 0.100000 0.861487 76.880000 0.000000 0.000000 +0.079433 0.491467 19.280000 0.000000 0.000000 0.079433 0.732144 51.320000 0.000000 0.000000 0.079433 0.901175 118.880000 0.000000 0.000000 +0.063096 0.749182 32.460000 0.000000 0.000000 0.063096 0.849089 71.160000 0.000000 0.000000 0.063096 0.946878 199.120000 0.000000 0.000000 +0.050119 0.879545 56.220000 0.000000 0.000000 0.050119 0.927272 149.600000 0.000000 0.000000 0.050119 0.969246 368.360000 0.000000 0.000000 +0.039811 0.948294 101.340000 0.000000 0.000000 0.039811 0.967134 317.860000 0.000000 0.000000 0.039811 0.985767 734.880000 0.000000 0.000000 +0.031623 0.980256 194.560000 0.000000 0.000000 0.031623 0.984552 624.540000 0.000000 0.000000 0.031623 0.991880 1460.560000 0.000000 0.000000 +0.025119 0.991381 310.440000 0.000000 0.000000 0.025119 0.994316 1087.900000 0.000000 0.000000 0.025119 0.996148 2628.720000 0.000000 0.000000 +0.019953 0.996397 651.580000 0.000000 0.000000 0.019953 0.997525 1935.680000 0.000000 0.000000 0.019953 0.998208 6289.040000 0.000000 0.000000 diff --git a/gnuplot/toric_rate.gnu b/gnuplot/toric_rate.gnu index 83a0f52..8fc5010 100755 --- a/gnuplot/toric_rate.gnu +++ b/gnuplot/toric_rate.gnu @@ -22,8 +22,9 @@ data_title='iteration0-cycle1000-Dint2-50' #data_title='my-bp3-feedback5-num-data-1000-schedule' data_title='my-bp3-feedback5-num-data-1000-schedule-p' -data_title='my-bp4-feedback5-num-data-1000-flexible' - +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' plot_title='-weight' @@ -61,7 +62,8 @@ set linetype cycle 5 #f(x)=x*x*x*100 size_set="13 11 9 7 5" -color_set="violet blue red yellow black green" +size_set="13 9 5" + # plot rate plot for [i=1:5] data_file using (column((i-1)*5+1)):(1-column((i-1)*5+2)) title 'size '.word(size_set,i) with linespoints ps 0.5 lc i,\ diff --git a/makefile b/makefile index 73dafa0..1b8be93 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ #CXX=g++ -g -Wall #for debug mode -CXX=g++ -O3 -Wall +CXX=g++ -O3 -Wall -std=c++11 -pthread ### -O2 -O5 -Os #g++ `pkg-config --cflags itpp` -o hello.out hello.cpp `pkg-config --libs itpp` @@ -16,7 +16,7 @@ INC_DIR=~/working/weilei_lib files=$(INC_DIR)/mm_read.c $(INC_DIR)/mm_read.h $(INC_DIR)/mmio.c $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.c $(INC_DIR)/mm_write.h $(INC_DIR)/lib.cpp $(INC_DIR)/lib.h $(INC_DIR)/dist.c $(INC_DIR)/dist.h $(INC_DIR)/concatenation_lib.c $(INC_DIR)/concatenation_lib.h $(INC_DIR)/bp.c $(INC_DIR)/bp.h $(INC_DIR)/bp_decoder.h $(INC_DIR)/my_lib.h makefile #command=$(CXX) -I../../weilei_lib $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(END) -command=$(CXX) -std=c++11 -pthread -I $(INC_DIR) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(END) ; echo finish making +command=$(CXX) -I $(INC_DIR) $(START) -o $@ $< $(word 2,$^) $(word 4, $^) $(word 6, $^) $(word 8, $^) $(word 10, $^) $(word 12, $^) $(word 14, $^) $(word 15, $^) $(END) ; echo finish making #the last one is my_lib.h diff --git a/my_bp3.out b/my_bp3.out index da75297..18dc3c8 100755 Binary files a/my_bp3.out and b/my_bp3.out differ diff --git a/my_bp4.c b/my_bp4.c index 2391dc8..1b50584 100644 --- a/my_bp4.c +++ b/my_bp4.c @@ -28,27 +28,39 @@ int main(int argc, char **argv){ //parser.get(filename_G,"filename_G"); vector> pool; - vector>::size_type pool_size=15; //max number of threads, 15 with decreasing size for best performace + int cores=16; + vector>::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-feedback5-num-data-1000-flexible.gnudat"; + filename_data="gnuplot/result/my-bp4-iter-9-fb-5-data-500-schedule-3.gnudat"; int feedback=5; - int cycles = 1000000;//70 sec for 2,000,000 - double time_out=50;//time out in seconds for each data points (p and size) - int num_data_points = 50;//data entry for each data points + // 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 //change parameter p, code size double p; //parser.get(p,"p"); - int sizes[]= {13,11,9,7,5}; + // int sizes[]= {13,11,9,7,5}; + int sizes[]= {13,9,5}; + int size_of_sizes = sizeof(sizes)/sizeof(*sizes); string stabilizer_folder="data/toric/stabilizer"; double ip_begin=-0.7; - double ip_end=-2.0; + double ip_end=-1.8; int data_rows = (ip_begin-ip_end)/0.1; - mat data(data_rows,5*5); //return result in a mat, 5 columns for each size. format defines in header + mat data(data_rows,5 * size_of_sizes ); //return result in a mat, 5 columns for each size. format defines in header data.zeros(); + //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; + double chunk_time_out = 20.0;//time_out/chunk_size; + 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 = "< ip_end;ip-=0.1){ //cout<<"ip = "<= pool_size ){ - //wait until some of them finish - //break; - for(vector > :: iterator it = pool.begin(); it != pool.end(); ++it){ - //printf("%d", *it); - if ( it->wait_for(span) == future_status::ready){ - // cout<<"."<wait_for(span) == future_status::ready){ + // cout<<"."<> :: iterator it = pool.begin(); it != pool.end(); ++it){ it->get(); } + //process chunk_data to data + int temp_index; + double value; + for ( int i =0; itime_out){ - break; - }else if (counts_nonconverge > num_data_points){ + std::cout<<"timeout: "< +#include +#include +#include +#include +#include +#include +#include +#include + + + +// thread pool to run user's functors with signature +// ret func(int id, other_params) +// where id is the index of the thread that runs the functor +// ret is some return type + + +namespace ctpl { + + namespace detail { + template + class Queue { + public: + bool push(T const & value) { + std::unique_lock lock(this->mutex); + this->q.push(value); + return true; + } + // deletes the retrieved element, do not use for non integral types + bool pop(T & v) { + std::unique_lock lock(this->mutex); + if (this->q.empty()) + return false; + v = this->q.front(); + this->q.pop(); + return true; + } + bool empty() { + std::unique_lock lock(this->mutex); + return this->q.empty(); + } + private: + std::queue q; + std::mutex mutex; + }; + } + + class thread_pool { + + public: + + thread_pool() { this->init(); } + thread_pool(int nThreads) { this->init(); this->resize(nThreads); } + + // the destructor waits for all the functions in the queue to be finished + ~thread_pool() { + this->stop(true); + } + + // get the number of running threads in the pool + int size() { return static_cast(this->threads.size()); } + + // number of idle threads + int n_idle() { return this->nWaiting; } + std::thread & get_thread(int i) { return *this->threads[i]; } + + // change the number of threads in the pool + // should be called from one thread, otherwise be careful to not interleave, also with this->stop() + // nThreads must be >= 0 + void resize(int nThreads) { + if (!this->isStop && !this->isDone) { + int oldNThreads = static_cast(this->threads.size()); + if (oldNThreads <= nThreads) { // if the number of threads is increased + this->threads.resize(nThreads); + this->flags.resize(nThreads); + + for (int i = oldNThreads; i < nThreads; ++i) { + this->flags[i] = std::make_shared>(false); + this->set_thread(i); + } + } + else { // the number of threads is decreased + for (int i = oldNThreads - 1; i >= nThreads; --i) { + *this->flags[i] = true; // this thread will finish + this->threads[i]->detach(); + } + { + // stop the detached threads that were waiting + std::unique_lock lock(this->mutex); + this->cv.notify_all(); + } + this->threads.resize(nThreads); // safe to delete because the threads are detached + this->flags.resize(nThreads); // safe to delete because the threads have copies of shared_ptr of the flags, not originals + } + } + } + + // empty the queue + void clear_queue() { + std::function * _f; + while (this->q.pop(_f)) + delete _f; // empty the queue + } + + // pops a functional wrapper to the original function + std::function pop() { + std::function * _f = nullptr; + this->q.pop(_f); + std::unique_ptr> func(_f); // at return, delete the function even if an exception occurred + std::function f; + if (_f) + f = *_f; + return f; + } + + // wait for all computing threads to finish and stop all threads + // may be called asynchronously to not pause the calling thread while waiting + // if isWait == true, all the functions in the queue are run, otherwise the queue is cleared without running the functions + void stop(bool isWait = false) { + if (!isWait) { + if (this->isStop) + return; + this->isStop = true; + for (int i = 0, n = this->size(); i < n; ++i) { + *this->flags[i] = true; // command the threads to stop + } + this->clear_queue(); // empty the queue + } + else { + if (this->isDone || this->isStop) + return; + this->isDone = true; // give the waiting threads a command to finish + } + { + std::unique_lock lock(this->mutex); + this->cv.notify_all(); // stop all waiting threads + } + for (int i = 0; i < static_cast(this->threads.size()); ++i) { // wait for the computing threads to finish + if (this->threads[i]->joinable()) + this->threads[i]->join(); + } + // if there were no threads in the pool but some functors in the queue, the functors are not deleted by the threads + // therefore delete them here + this->clear_queue(); + this->threads.clear(); + this->flags.clear(); + } + + template + auto push(F && f, Rest&&... rest) ->std::future { + auto pck = std::make_shared>( + std::bind(std::forward(f), std::placeholders::_1, std::forward(rest)...) + ); + auto _f = new std::function([pck](int id) { + (*pck)(id); + }); + this->q.push(_f); + std::unique_lock lock(this->mutex); + this->cv.notify_one(); + return pck->get_future(); + } + + // run the user's function that excepts argument int - id of the running thread. returned value is templatized + // operator returns std::future, where the user can get the result and rethrow the catched exceptins + template + auto push(F && f) ->std::future { + auto pck = std::make_shared>(std::forward(f)); + auto _f = new std::function([pck](int id) { + (*pck)(id); + }); + this->q.push(_f); + std::unique_lock lock(this->mutex); + this->cv.notify_one(); + return pck->get_future(); + } + + + private: + + // deleted + thread_pool(const thread_pool &);// = delete; + thread_pool(thread_pool &&);// = delete; + thread_pool & operator=(const thread_pool &);// = delete; + thread_pool & operator=(thread_pool &&);// = delete; + + void set_thread(int i) { + std::shared_ptr> flag(this->flags[i]); // a copy of the shared ptr to the flag + auto f = [this, i, flag/* a copy of the shared ptr to the flag */]() { + std::atomic & _flag = *flag; + std::function * _f; + bool isPop = this->q.pop(_f); + while (true) { + while (isPop) { // if there is anything in the queue + std::unique_ptr> func(_f); // at return, delete the function even if an exception occurred + (*_f)(i); + if (_flag) + return; // the thread is wanted to stop, return even if the queue is not empty yet + else + isPop = this->q.pop(_f); + } + // the queue is empty here, wait for the next command + std::unique_lock lock(this->mutex); + ++this->nWaiting; + this->cv.wait(lock, [this, &_f, &isPop, &_flag](){ isPop = this->q.pop(_f); return isPop || this->isDone || _flag; }); + --this->nWaiting; + if (!isPop) + return; // if the queue is empty and this->isDone == true or *flag then return + } + }; + this->threads[i].reset(new std::thread(f)); // compiler may not support std::make_unique() + } + + void init() { this->nWaiting = 0; this->isStop = false; this->isDone = false; } + + std::vector> threads; + std::vector>> flags; + detail::Queue *> q; + std::atomic isDone; + std::atomic isStop; + std::atomic nWaiting; // how many threads are waiting + + std::mutex mutex; + std::condition_variable cv; + }; + +} + +#endif // __ctpl_stl_thread_pool_H__ diff --git a/src/ctpl_test.c b/src/ctpl_test.c new file mode 100644 index 0000000..cc0cdf4 --- /dev/null +++ b/src/ctpl_test.c @@ -0,0 +1,16 @@ +#include // or if ou do not have Boost library + +int main (int argc, char *argv[]) { + ctpl::thread_pool p(2 /* two threads in the pool */); + int arr[4] = {0}; + std::vector> results(4); + for (int i = 0; i < 8; ++i) { // for 8 iterations, + for (int j = 0; j < 4; ++j) { + results[j] = p.push([&arr, j](int){ arr[j] +=2; }); + } + for (int j = 0; j < 4; ++j) { + results[j].get(); + } + arr[4] = std::min_element(arr, arr + 4); + } +} diff --git a/src/ctpl_test.c~ b/src/ctpl_test.c~ new file mode 100644 index 0000000..cc0cdf4 --- /dev/null +++ b/src/ctpl_test.c~ @@ -0,0 +1,16 @@ +#include // or if ou do not have Boost library + +int main (int argc, char *argv[]) { + ctpl::thread_pool p(2 /* two threads in the pool */); + int arr[4] = {0}; + std::vector> results(4); + for (int i = 0; i < 8; ++i) { // for 8 iterations, + for (int j = 0; j < 4; ++j) { + results[j] = p.push([&arr, j](int){ arr[j] +=2; }); + } + for (int j = 0; j < 4; ++j) { + results[j].get(); + } + arr[4] = std::min_element(arr, arr + 4); + } +} diff --git a/src/makefile b/src/makefile new file mode 100644 index 0000000..68c8989 --- /dev/null +++ b/src/makefile @@ -0,0 +1,7 @@ +async_test.out:async_test.c + g++ -o async_test.out async_test.c -std=c++11 -pthread + ./async_test.out +bp_decoder_test.out:bp_decoder_test.c bp_decoder.h + g++ -o bp_decoder_test.out bp_decoder_test.c bp_decoder.h +ctpl_test.out:ctpl_test.c + g++ -std=c++11 -pthread -o ctpl_test.out ctpl_test.c diff --git a/old/makefile b/src/makefile~ similarity index 77% rename from old/makefile rename to src/makefile~ index f3f6e99..35eba5f 100644 --- a/old/makefile +++ b/src/makefile~ @@ -3,3 +3,5 @@ async_test.out:async_test.c ./async_test.out bp_decoder_test.out:bp_decoder_test.c bp_decoder.h g++ -o bp_decoder_test.out bp_decoder_test.c bp_decoder.h +ctpl_test.out:ctpl_test.c + g++ -o ctpl_test.out ctpl_test.c diff --git a/old/prime_calculator.c b/src/prime_calculator.c similarity index 100% rename from old/prime_calculator.c rename to src/prime_calculator.c diff --git a/test.c b/test.c index 7099764..c37cea4 100644 --- a/test.c +++ b/test.c @@ -9,6 +9,7 @@ #include "my_lib.h" #include #include "bp_decoder.h" +#include // for std::for_each using namespace std; using namespace itpp; @@ -266,14 +267,47 @@ void bp_decoder_class_test(){ return; } +void switch_test(int a){ + switch (a) { + case 1: + case 2: + std::cout<<"1 2"< foo; + std::for_each( + std::execution::par_unseq, + foo.begin(), + foo.end(), + [](auto&& item) + { + //do stuff with item + std::cout<<"hello"<