summaryrefslogtreecommitdiff
path: root/examples/oldtests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/oldtests.hs')
-rw-r--r--examples/oldtests.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/oldtests.hs b/examples/oldtests.hs
index f60f4e2..7d4701c 100644
--- a/examples/oldtests.hs
+++ b/examples/oldtests.hs
@@ -1,5 +1,6 @@
1import Test.HUnit 1import Test.HUnit
2import GSLHaskell 2import LinearAlgebra
3import GSL hiding (exp)
3import System.Random(randomRs,mkStdGen) 4import System.Random(randomRs,mkStdGen)
4 5
5realMatrix = fromLists :: [[Double]] -> Matrix Double 6realMatrix = fromLists :: [[Double]] -> Matrix Double
@@ -8,7 +9,7 @@ realVector = fromList :: [Double] -> Vector Double
8 9
9 10
10infixl 2 =~= 11infixl 2 =~=
11a =~= b = pnorm 1 (flatten (a - b)) < 1E-6 12a =~= b = pnorm PNorm1 (flatten (a - b)) < 1E-6
12 13
13randomMatrix seed (n,m) = reshape m $ realVector $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed 14randomMatrix seed (n,m) = reshape m $ realVector $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed
14 15