diff --git a/example/1d_cyclic/wham.out b/example/1d_cyclic/wham.out index 8c82afe..27a918f 100644 --- a/example/1d_cyclic/wham.out +++ b/example/1d_cyclic/wham.out @@ -1,101 +1,101 @@ #coord1 Free Energy +/- Probability +/- --3.110177 7.158102 0.071438 0.003494 0.000068 --3.047345 5.365727 0.069449 0.007168 0.000135 --2.984513 3.873190 0.067495 0.013039 0.000232 --2.921681 2.953162 0.067589 0.018855 0.000343 --2.858849 1.949554 0.064640 0.028195 0.000480 --2.796017 1.391747 0.063570 0.035261 0.000584 --2.733186 1.128270 0.061710 0.039189 0.000620 --2.670354 0.839970 0.060445 0.043991 0.000667 --2.607522 0.624769 0.060762 0.047955 0.000739 --2.544690 0.663757 0.060786 0.047211 0.000731 --2.481858 1.051932 0.059774 0.040407 0.000617 --2.419026 1.463048 0.060422 0.034267 0.000527 --2.356194 1.990616 0.055242 0.027734 0.000360 --2.293363 2.190692 0.044458 0.025597 0.000210 --2.230531 2.553036 0.042144 0.022136 0.000159 --2.167699 2.572522 0.043313 0.021964 0.000165 --2.104867 2.472360 0.039799 0.022863 0.000157 --2.042035 2.517562 0.036792 0.022453 0.000203 --1.979203 2.469778 0.036324 0.022887 0.000237 --1.916372 2.223125 0.049496 0.025266 0.000565 --1.853540 2.080157 0.039205 0.026756 0.000453 --1.790708 1.793841 0.041488 0.030011 0.000558 --1.727876 1.458784 0.042362 0.034326 0.000565 --1.665044 0.914441 0.037561 0.042697 0.000682 --1.602212 0.303813 0.028701 0.054540 0.000761 --1.539380 0.268335 0.025765 0.055321 0.000771 --1.476549 0.000000 0.023371 0.061604 0.000866 --1.413717 0.537061 0.026370 0.049671 0.000715 --1.350885 1.439940 0.025620 0.034586 0.000547 --1.288053 2.391838 0.027653 0.023614 0.000393 --1.225221 3.779470 0.027093 0.013538 0.000229 --1.162389 5.685555 0.027762 0.006305 0.000111 --1.099557 7.661896 0.028996 0.002855 0.000051 --1.036726 9.946594 0.032118 0.001142 0.000021 --0.973894 12.359408 0.042801 0.000434 0.000009 --0.911062 14.954655 0.052443 0.000153 0.000004 --0.848230 17.742242 0.063261 0.000050 0.000002 --0.785398 20.555785 0.068133 0.000016 0.000001 --0.722566 22.811160 0.075518 0.000007 0.000000 --0.659734 25.178094 0.086226 0.000003 0.000000 --0.596903 26.442288 0.091783 0.000002 0.000000 --0.534071 27.897565 0.093175 0.000001 0.000000 --0.471239 29.062473 0.096027 0.000001 0.000000 --0.408407 30.384521 0.096855 0.000000 0.000000 --0.345575 31.638454 0.099956 0.000000 0.000000 --0.282743 32.817727 0.107689 0.000000 0.000000 --0.219911 33.770369 0.108946 0.000000 0.000000 --0.157080 34.505503 0.112902 0.000000 0.000000 --0.094248 35.431659 0.120856 0.000000 0.000000 --0.031416 35.615810 0.122046 0.000000 0.000000 -0.031416 35.561946 0.118225 0.000000 0.000000 -0.094248 35.382089 0.108652 0.000000 0.000000 -0.157080 34.934827 0.118384 0.000000 0.000000 -0.219911 33.673460 0.119195 0.000000 0.000000 -0.282743 32.731563 0.121592 0.000000 0.000000 -0.345575 31.261855 0.129698 0.000000 0.000000 -0.408407 29.717377 0.139789 0.000000 0.000000 -0.471239 28.076620 0.137289 0.000001 0.000000 -0.534071 26.481097 0.135712 0.000002 0.000000 -0.596903 24.487358 0.135156 0.000003 0.000000 -0.659734 22.344251 0.131027 0.000008 0.000000 -0.722566 20.241543 0.133145 0.000018 0.000001 -0.785398 18.341869 0.131952 0.000039 0.000002 -0.848230 16.261582 0.134676 0.000091 0.000006 -0.911062 14.301801 0.134417 0.000199 0.000013 -0.973894 12.603788 0.131018 0.000394 0.000024 -1.036726 11.249601 0.131276 0.000678 0.000043 -1.099557 10.087886 0.132498 0.001079 0.000070 -1.162389 9.443303 0.132990 0.001398 0.000092 -1.225221 9.152799 0.132250 0.001570 0.000104 -1.288053 9.331937 0.133178 0.001462 0.000099 -1.350885 9.905546 0.133357 0.001161 0.000078 -1.413717 11.042050 0.133807 0.000736 0.000051 -1.476549 12.598167 0.132722 0.000395 0.000027 -1.539380 14.520167 0.131816 0.000183 0.000012 -1.602212 16.569783 0.131773 0.000080 0.000005 -1.665044 18.687390 0.132601 0.000034 0.000002 -1.727876 20.775408 0.133867 0.000015 0.000001 -1.790708 22.905200 0.129265 0.000006 0.000000 -1.853540 24.643852 0.128894 0.000003 0.000000 -1.916372 26.301740 0.130266 0.000002 0.000000 -1.979203 27.372071 0.128620 0.000001 0.000000 -2.042035 28.697726 0.133263 0.000001 0.000000 -2.104867 29.417901 0.133513 0.000000 0.000000 -2.167699 30.008351 0.130925 0.000000 0.000000 -2.230531 30.406016 0.124398 0.000000 0.000000 -2.293363 30.171275 0.122493 0.000000 0.000000 -2.356194 29.884646 0.130278 0.000000 0.000000 -2.419026 29.428153 0.130844 0.000000 0.000000 -2.481858 28.546982 0.148114 0.000001 0.000000 -2.544690 27.757520 0.133045 0.000001 0.000000 -2.607522 26.505787 0.134364 0.000001 0.000000 -2.670354 24.491866 0.115061 0.000003 0.000000 -2.733186 22.320664 0.110036 0.000008 0.000000 -2.796017 20.052723 0.107894 0.000020 0.000001 -2.858849 17.655650 0.105964 0.000052 0.000002 -2.921681 15.471590 0.107005 0.000125 0.000005 -2.984513 13.138167 0.099378 0.000318 0.000012 -3.047345 11.092386 0.087770 0.000722 0.000022 -3.110177 9.065722 0.077092 0.001626 0.000038 +-3.110177 7.158102 0.000000 0.003494 0.000000 +-3.047345 5.365727 0.000000 0.007168 0.000000 +-2.984513 3.873190 0.000000 0.013039 0.000000 +-2.921681 2.953162 0.000000 0.018855 0.000000 +-2.858849 1.949554 0.000000 0.028195 0.000000 +-2.796017 1.391747 0.000000 0.035261 0.000000 +-2.733186 1.128270 0.000000 0.039189 0.000000 +-2.670354 0.839970 0.000000 0.043991 0.000000 +-2.607522 0.624769 0.000000 0.047955 0.000000 +-2.544690 0.663757 0.000000 0.047211 0.000000 +-2.481858 1.051932 0.000000 0.040407 0.000000 +-2.419026 1.463048 0.000000 0.034267 0.000000 +-2.356194 1.990616 0.000000 0.027734 0.000000 +-2.293363 2.190692 0.000000 0.025597 0.000000 +-2.230531 2.553036 0.000000 0.022136 0.000000 +-2.167699 2.572522 0.000000 0.021964 0.000000 +-2.104867 2.472360 0.000000 0.022863 0.000000 +-2.042035 2.517562 0.000000 0.022453 0.000000 +-1.979203 2.469778 0.000000 0.022887 0.000000 +-1.916372 2.223125 0.000000 0.025266 0.000000 +-1.853540 2.080157 0.000000 0.026756 0.000000 +-1.790708 1.793841 0.000000 0.030011 0.000000 +-1.727876 1.458784 0.000000 0.034326 0.000000 +-1.665044 0.914441 0.000000 0.042697 0.000000 +-1.602212 0.303813 0.000000 0.054540 0.000000 +-1.539380 0.268335 0.000000 0.055321 0.000000 +-1.476549 0.000000 0.000000 0.061604 0.000000 +-1.413717 0.537061 0.000000 0.049671 0.000000 +-1.350885 1.439940 0.000000 0.034586 0.000000 +-1.288053 2.391838 0.000000 0.023614 0.000000 +-1.225221 3.779470 0.000000 0.013538 0.000000 +-1.162389 5.685555 0.000000 0.006305 0.000000 +-1.099557 7.661896 0.000000 0.002855 0.000000 +-1.036726 9.946594 0.000000 0.001142 0.000000 +-0.973894 12.359408 0.000000 0.000434 0.000000 +-0.911062 14.954655 0.000000 0.000153 0.000000 +-0.848230 17.742242 0.000000 0.000050 0.000000 +-0.785398 20.555785 0.000000 0.000016 0.000000 +-0.722566 22.811160 0.000000 0.000007 0.000000 +-0.659734 25.178094 0.000000 0.000003 0.000000 +-0.596903 26.442288 0.000000 0.000002 0.000000 +-0.534071 27.897565 0.000000 0.000001 0.000000 +-0.471239 29.062473 0.000000 0.000001 0.000000 +-0.408407 30.384521 0.000000 0.000000 0.000000 +-0.345575 31.638454 0.000000 0.000000 0.000000 +-0.282743 32.817727 0.000000 0.000000 0.000000 +-0.219911 33.770369 0.000000 0.000000 0.000000 +-0.157080 34.505503 0.000000 0.000000 0.000000 +-0.094248 35.431659 0.000000 0.000000 0.000000 +-0.031416 35.615810 0.000000 0.000000 0.000000 +0.031416 35.561946 0.000000 0.000000 0.000000 +0.094248 35.382089 0.000000 0.000000 0.000000 +0.157080 34.934827 0.000000 0.000000 0.000000 +0.219911 33.673460 0.000000 0.000000 0.000000 +0.282743 32.731563 0.000000 0.000000 0.000000 +0.345575 31.261855 0.000000 0.000000 0.000000 +0.408407 29.717377 0.000000 0.000000 0.000000 +0.471239 28.076620 0.000000 0.000001 0.000000 +0.534071 26.481097 0.000000 0.000002 0.000000 +0.596903 24.487358 0.000000 0.000003 0.000000 +0.659734 22.344251 0.000000 0.000008 0.000000 +0.722566 20.241543 0.000000 0.000018 0.000000 +0.785398 18.341869 0.000000 0.000039 0.000000 +0.848230 16.261582 0.000000 0.000091 0.000000 +0.911062 14.301801 0.000000 0.000199 0.000000 +0.973894 12.603788 0.000000 0.000394 0.000000 +1.036726 11.249601 0.000000 0.000678 0.000000 +1.099557 10.087886 0.000000 0.001079 0.000000 +1.162389 9.443303 0.000000 0.001398 0.000000 +1.225221 9.152799 0.000000 0.001570 0.000000 +1.288053 9.331937 0.000000 0.001462 0.000000 +1.350885 9.905546 0.000000 0.001161 0.000000 +1.413717 11.042050 0.000000 0.000736 0.000000 +1.476549 12.598167 0.000000 0.000395 0.000000 +1.539380 14.520167 0.000000 0.000183 0.000000 +1.602212 16.569783 0.000000 0.000080 0.000000 +1.665044 18.687390 0.000000 0.000034 0.000000 +1.727876 20.775408 0.000000 0.000015 0.000000 +1.790708 22.905200 0.000000 0.000006 0.000000 +1.853540 24.643852 0.000000 0.000003 0.000000 +1.916372 26.301740 0.000000 0.000002 0.000000 +1.979203 27.372071 0.000000 0.000001 0.000000 +2.042035 28.697726 0.000000 0.000001 0.000000 +2.104867 29.417901 0.000000 0.000000 0.000000 +2.167699 30.008351 0.000000 0.000000 0.000000 +2.230531 30.406016 0.000000 0.000000 0.000000 +2.293363 30.171275 0.000000 0.000000 0.000000 +2.356194 29.884646 0.000000 0.000000 0.000000 +2.419026 29.428153 0.000000 0.000000 0.000000 +2.481858 28.546982 0.000000 0.000001 0.000000 +2.544690 27.757520 0.000000 0.000001 0.000000 +2.607522 26.505787 0.000000 0.000001 0.000000 +2.670354 24.491866 0.000000 0.000003 0.000000 +2.733186 22.320664 0.000000 0.000008 0.000000 +2.796017 20.052723 0.000000 0.000020 0.000000 +2.858849 17.655650 0.000000 0.000052 0.000000 +2.921681 15.471590 0.000000 0.000125 0.000000 +2.984513 13.138167 0.000000 0.000318 0.000000 +3.047345 11.092386 0.000000 0.000722 0.000000 +3.110177 9.065722 0.000000 0.001626 0.000000 diff --git a/example/1d_cyclic/wham_bt.out b/example/1d_cyclic/wham_bt.out new file mode 100644 index 0000000..8c82afe --- /dev/null +++ b/example/1d_cyclic/wham_bt.out @@ -0,0 +1,101 @@ +#coord1 Free Energy +/- Probability +/- +-3.110177 7.158102 0.071438 0.003494 0.000068 +-3.047345 5.365727 0.069449 0.007168 0.000135 +-2.984513 3.873190 0.067495 0.013039 0.000232 +-2.921681 2.953162 0.067589 0.018855 0.000343 +-2.858849 1.949554 0.064640 0.028195 0.000480 +-2.796017 1.391747 0.063570 0.035261 0.000584 +-2.733186 1.128270 0.061710 0.039189 0.000620 +-2.670354 0.839970 0.060445 0.043991 0.000667 +-2.607522 0.624769 0.060762 0.047955 0.000739 +-2.544690 0.663757 0.060786 0.047211 0.000731 +-2.481858 1.051932 0.059774 0.040407 0.000617 +-2.419026 1.463048 0.060422 0.034267 0.000527 +-2.356194 1.990616 0.055242 0.027734 0.000360 +-2.293363 2.190692 0.044458 0.025597 0.000210 +-2.230531 2.553036 0.042144 0.022136 0.000159 +-2.167699 2.572522 0.043313 0.021964 0.000165 +-2.104867 2.472360 0.039799 0.022863 0.000157 +-2.042035 2.517562 0.036792 0.022453 0.000203 +-1.979203 2.469778 0.036324 0.022887 0.000237 +-1.916372 2.223125 0.049496 0.025266 0.000565 +-1.853540 2.080157 0.039205 0.026756 0.000453 +-1.790708 1.793841 0.041488 0.030011 0.000558 +-1.727876 1.458784 0.042362 0.034326 0.000565 +-1.665044 0.914441 0.037561 0.042697 0.000682 +-1.602212 0.303813 0.028701 0.054540 0.000761 +-1.539380 0.268335 0.025765 0.055321 0.000771 +-1.476549 0.000000 0.023371 0.061604 0.000866 +-1.413717 0.537061 0.026370 0.049671 0.000715 +-1.350885 1.439940 0.025620 0.034586 0.000547 +-1.288053 2.391838 0.027653 0.023614 0.000393 +-1.225221 3.779470 0.027093 0.013538 0.000229 +-1.162389 5.685555 0.027762 0.006305 0.000111 +-1.099557 7.661896 0.028996 0.002855 0.000051 +-1.036726 9.946594 0.032118 0.001142 0.000021 +-0.973894 12.359408 0.042801 0.000434 0.000009 +-0.911062 14.954655 0.052443 0.000153 0.000004 +-0.848230 17.742242 0.063261 0.000050 0.000002 +-0.785398 20.555785 0.068133 0.000016 0.000001 +-0.722566 22.811160 0.075518 0.000007 0.000000 +-0.659734 25.178094 0.086226 0.000003 0.000000 +-0.596903 26.442288 0.091783 0.000002 0.000000 +-0.534071 27.897565 0.093175 0.000001 0.000000 +-0.471239 29.062473 0.096027 0.000001 0.000000 +-0.408407 30.384521 0.096855 0.000000 0.000000 +-0.345575 31.638454 0.099956 0.000000 0.000000 +-0.282743 32.817727 0.107689 0.000000 0.000000 +-0.219911 33.770369 0.108946 0.000000 0.000000 +-0.157080 34.505503 0.112902 0.000000 0.000000 +-0.094248 35.431659 0.120856 0.000000 0.000000 +-0.031416 35.615810 0.122046 0.000000 0.000000 +0.031416 35.561946 0.118225 0.000000 0.000000 +0.094248 35.382089 0.108652 0.000000 0.000000 +0.157080 34.934827 0.118384 0.000000 0.000000 +0.219911 33.673460 0.119195 0.000000 0.000000 +0.282743 32.731563 0.121592 0.000000 0.000000 +0.345575 31.261855 0.129698 0.000000 0.000000 +0.408407 29.717377 0.139789 0.000000 0.000000 +0.471239 28.076620 0.137289 0.000001 0.000000 +0.534071 26.481097 0.135712 0.000002 0.000000 +0.596903 24.487358 0.135156 0.000003 0.000000 +0.659734 22.344251 0.131027 0.000008 0.000000 +0.722566 20.241543 0.133145 0.000018 0.000001 +0.785398 18.341869 0.131952 0.000039 0.000002 +0.848230 16.261582 0.134676 0.000091 0.000006 +0.911062 14.301801 0.134417 0.000199 0.000013 +0.973894 12.603788 0.131018 0.000394 0.000024 +1.036726 11.249601 0.131276 0.000678 0.000043 +1.099557 10.087886 0.132498 0.001079 0.000070 +1.162389 9.443303 0.132990 0.001398 0.000092 +1.225221 9.152799 0.132250 0.001570 0.000104 +1.288053 9.331937 0.133178 0.001462 0.000099 +1.350885 9.905546 0.133357 0.001161 0.000078 +1.413717 11.042050 0.133807 0.000736 0.000051 +1.476549 12.598167 0.132722 0.000395 0.000027 +1.539380 14.520167 0.131816 0.000183 0.000012 +1.602212 16.569783 0.131773 0.000080 0.000005 +1.665044 18.687390 0.132601 0.000034 0.000002 +1.727876 20.775408 0.133867 0.000015 0.000001 +1.790708 22.905200 0.129265 0.000006 0.000000 +1.853540 24.643852 0.128894 0.000003 0.000000 +1.916372 26.301740 0.130266 0.000002 0.000000 +1.979203 27.372071 0.128620 0.000001 0.000000 +2.042035 28.697726 0.133263 0.000001 0.000000 +2.104867 29.417901 0.133513 0.000000 0.000000 +2.167699 30.008351 0.130925 0.000000 0.000000 +2.230531 30.406016 0.124398 0.000000 0.000000 +2.293363 30.171275 0.122493 0.000000 0.000000 +2.356194 29.884646 0.130278 0.000000 0.000000 +2.419026 29.428153 0.130844 0.000000 0.000000 +2.481858 28.546982 0.148114 0.000001 0.000000 +2.544690 27.757520 0.133045 0.000001 0.000000 +2.607522 26.505787 0.134364 0.000001 0.000000 +2.670354 24.491866 0.115061 0.000003 0.000000 +2.733186 22.320664 0.110036 0.000008 0.000000 +2.796017 20.052723 0.107894 0.000020 0.000001 +2.858849 17.655650 0.105964 0.000052 0.000002 +2.921681 15.471590 0.107005 0.000125 0.000005 +2.984513 13.138167 0.099378 0.000318 0.000012 +3.047345 11.092386 0.087770 0.000722 0.000022 +3.110177 9.065722 0.077092 0.001626 0.000038 diff --git a/tests/examples.rs b/tests/examples.rs index 6987a9c..0a0c021 100644 --- a/tests/examples.rs +++ b/tests/examples.rs @@ -14,7 +14,7 @@ mod integration { let output_file = "/tmp/wham_test_1d_cyclic.out"; get_command() .args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"]) - .args(&["--bt", "100", "--seed", "1234"]) + .args(&["--seed", "1234"]) .args(&["-f", "example/1d_cyclic/metadata.dat"]) .args(&["-o", output_file]) .output() @@ -60,9 +60,9 @@ mod integration { let output_file = "/tmp/wham_test_convdt.out"; get_command() .args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"]) - .args(&["--seed", "1234"]) - .args(&["--start", "0", "--end", "100"]) - .args(&["--convdt", "10"]) + .args(&["--seed", "1234", "--tolerance", "0.001"]) + .args(&["--start", "0", "--end", "10"]) + .args(&["--convdt", "1"]) .args(&["-f", "example/1d_cyclic/metadata.dat"]) .args(&["-o", output_file]) .output() @@ -70,11 +70,11 @@ mod integration { assert!(fs::metadata(output_file).is_ok()); // run wham for individual sets - for i in (10..110).step_by(10) { + for i in 1..11 { let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i); get_command() .args(&["--bins", "10", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"]) - .args(&["--seed", "1234"]) + .args(&["--seed", "1234", "--tolerance", "0.001"]) .args(&["--start", "0", "--end", &i.to_string()]) .args(&["-f", "example/1d_cyclic/metadata.dat"]) .args(&["-o", &output_file_single]) @@ -91,7 +91,7 @@ mod integration { .open(output_combined) .unwrap(); for i in 1..11 { - let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i*10); + let output_file_single = format!("/tmp/wham_test_convdt_{}.out", i); println!("{}", output_file_single); file.write_all(format!("#Dataset {}\n", i-1).as_bytes()).unwrap(); file.write_all(fs::read_to_string(output_file_single.clone()).unwrap().as_bytes()).unwrap(); @@ -112,6 +112,29 @@ mod integration { } + #[test] + #[ignore] + fn wham_1d_cyclic_bootstrap() { + let output_file = "/tmp/wham_test_1d_cyclic_bt.out"; + get_command() + .args(&["--bins", "100", "--max", "pi", "--min", "-pi", "-T", "300", "--cyclic"]) + .args(&["--seed", "1234", "--bt", "100"]) + .args(&["-f", "example/1d_cyclic/metadata.dat"]) + .args(&["-o", output_file]) + .output() + .expect("failed to execute process"); + + assert!(fs::metadata(output_file).is_ok()); + let output = Command::new("diff") + .arg(output_file) + .arg("example/1d_cyclic/wham_bt.out") + .output() + .expect("failed to run diff"); + let output_len = String::from_utf8_lossy(&output.stdout).len(); + assert_eq!(output_len, 0); + std::fs::remove_file(output_file).unwrap(); + } + #[test] #[ignore] // expensive fn wham_2d_cyclic() {