diff options
Diffstat (limited to 'examples/oldtests.hs')
-rw-r--r-- | examples/oldtests.hs | 5 |
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 @@ | |||
1 | import Test.HUnit | 1 | import Test.HUnit |
2 | import GSLHaskell | 2 | import LinearAlgebra |
3 | import GSL hiding (exp) | ||
3 | import System.Random(randomRs,mkStdGen) | 4 | import System.Random(randomRs,mkStdGen) |
4 | 5 | ||
5 | realMatrix = fromLists :: [[Double]] -> Matrix Double | 6 | realMatrix = fromLists :: [[Double]] -> Matrix Double |
@@ -8,7 +9,7 @@ realVector = fromList :: [Double] -> Vector Double | |||
8 | 9 | ||
9 | 10 | ||
10 | infixl 2 =~= | 11 | infixl 2 =~= |
11 | a =~= b = pnorm 1 (flatten (a - b)) < 1E-6 | 12 | a =~= b = pnorm PNorm1 (flatten (a - b)) < 1E-6 |
12 | 13 | ||
13 | randomMatrix seed (n,m) = reshape m $ realVector $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed | 14 | randomMatrix seed (n,m) = reshape m $ realVector $ take (n*m) $ randomRs (-100,100) $ mkStdGen seed |
14 | 15 | ||