diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-08-01 22:53:27 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-08-01 22:53:27 +0200 |
commit | a2fd89f963a7374b29f7831e67b443c3d42c6e3c (patch) | |
tree | 46028797665093856745df1b94875b0dfa071ef3 /SFMT/check.sh | |
parent | 8e6850107adb5ca37ed0e9a4500282b2e8743294 (diff) | |
download | nebula2-a2fd89f963a7374b29f7831e67b443c3d42c6e3c.tar.gz nebula2-a2fd89f963a7374b29f7831e67b443c3d42c6e3c.tar.bz2 nebula2-a2fd89f963a7374b29f7831e67b443c3d42c6e3c.zip |
Added SFMT prng.
Diffstat (limited to 'SFMT/check.sh')
-rwxr-xr-x | SFMT/check.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/SFMT/check.sh b/SFMT/check.sh new file mode 100755 index 0000000..d259e70 --- /dev/null +++ b/SFMT/check.sh @@ -0,0 +1,40 @@ +#!/bin/sh +bit_len=$1 +prefix=$2 +tmp=tmp.$$ +tmp64=tmp64.$$ +exps="607 1279 2281 4253 11213 19937 44497 86243 132049 216091" +for mexp in $exps; do + if [ $bit_len = "64" ]; then + ./test-std-M${mexp} -b64 > $tmp64 + compare=$tmp64 + else + compare=SFMT.${mexp}.out.txt + fi + command=${prefix}-M${mexp} + if ./$command -b${bit_len}> $tmp; then + :; + else + echo $command exexute error! + rm -f $tmp + if [ -n "$tmp64" ] && [ -e $tmp64 ]; then + rm -f $tmp64 + fi + exit 1 + fi + if diff -q -w $tmp $compare; then + echo $command output check OK + rm -f $tmp + else + echo $command output check NG! + rm -f $tmp + if [ -n "$tmp64" ] && [ -e $tmp64 ]; then + rm -f $tmp64 + fi + exit 1 + fi +done +if [ -n "$tmp64" ] && [ -e $tmp64 ]; then + rm -f $tmp64 +fi +exit 0 |