nkartashov / htestu Goto Github PK
View Code? Open in Web Editor NEWLibrary for testing Haskell PRNGs for correctness using TestU01 suite
License: MIT License
Library for testing Haskell PRNGs for correctness using TestU01 suite
License: MIT License
I am probably missing something but I had to make the changes below to get the example to compile.
2 files changed, 5 insertions(+), 4 deletions(-)
doc/examples/TestGen.hs | 3 ++-
htestu.cabal | 6 +++---
modified doc/examples/TestGen.hs
@@ -1,8 +1,9 @@
module TestGen where
import System.Random (RandomGen, next, split)
-import Test.HTestU (runBatteryToResults, c_smallCrush, c_crush)
+import Test.HTestU (TestResult, runBatteryToResults, c_smallCrush, c_crush)
import Test.HTestU.Streaming (nextStreamFromGen)
+import Test.HTestU.Wrapping (Battery)
-- | Pretend that this a data type of a PRNG
data TestGen
modified htestu.cabal
@@ -31,11 +31,11 @@ source-repository head
library
exposed-modules: Test.HTestU,
- Test.HTestU.Streaming
- other-modules: Test.HTestU.BatteryResult,
+ Test.HTestU.Streaming,
+ Test.HTestU.BatteryResult,
Test.HTestU.Wrapping
other-extensions: ForeignFunctionInterface, CPP
- build-depends: base >=4.7 && < 4.8,
+ build-depends: base >=4.7 && < 4.9,
random
hs-source-dirs: src
in the underlying c code, the logic for "bad" is if the P-value is too close to 0 OR 1,
for (j = 0; j < N; j++) {
if (pVal[j] < 0.0) /* That test was not done: pVal = -1 */
continue;
if ((pVal[j] < gofw_Suspectp) || (pVal[j] > 1.0 - gofw_Suspectp)) {
co++;
break;
}
}
i'm making a wee fork that addresses this over on my github, but this means we're underestimating the failures in a certain sense
For
runCrush crush = (\g -> runBatteryToResults nextStreamFromGen g crush ) `fmap` newStdGen
I get
./doc/examples/TestGen
[Fail,Fail,OK,OK,OK,Fail,Fail,OK,OK,OK,Fail,Fail,Fail,Fail,Fail]
Is this expected?
htestu $ stack exec ghci -- -Lcbits/testu/src/.libs -ltestu01
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
<command line>: user specified .o/.so/.DLL could not be loaded (dlopen(cbits/testu/src/.libs/libtestu01.dylib, 5): Library not loaded: /Users/nikita_kartashov/Documents/Work/haskell/htestu/dist/build/lib/libprobdist.0.dylib
Referenced from: /Users/dom/Dropbox/Private/Libraries/htestu/cbits/testu/src/.libs/libtestu01.dylib
Reason: image not found)
Whilst trying to load: (dynamic) cbits/testu/src/.libs/libtestu01.dylib
Additional directories searched: cbits/testu/src/.libs
Why is a file on your computer being referenced? How do I load and run e.g. src/Test/HTestU.hs
in ghci
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.