diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-11-14 12:57:52 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-11-14 12:57:52 +0000 |
commit | dc39c11d2d2e75428e6394cf8542c8c3ff2cd887 (patch) | |
tree | 24c5bac27258b5752691316e4d6736a5e0c1d2e5 /lib/Numeric/LinearAlgebra | |
parent | 6bdf5355a26da547b775f29926c131d539e86e7c (diff) |
added module Random.hs
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index d7c3f99..097756e 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -131,6 +131,16 @@ rootFindingTest = TestList [ utest "root Hybrids" (fst sol1 ~~ [1,1]) | |||
131 | 131 | ||
132 | --------------------------------------------------------------------- | 132 | --------------------------------------------------------------------- |
133 | 133 | ||
134 | randomTest = c :~1~: snd (meanCov dat) where | ||
135 | a = (3><3) [1,2,3, | ||
136 | 2,4,0, | ||
137 | -2,2,1] | ||
138 | m = 3 |> [1,2,3] | ||
139 | c = a <> trans a | ||
140 | dat = gaussianSample 7 (10^6) m c | ||
141 | |||
142 | --------------------------------------------------------------------- | ||
143 | |||
134 | rot :: Double -> Matrix Double | 144 | rot :: Double -> Matrix Double |
135 | rot a = (3><3) [ c,0,s | 145 | rot a = (3><3) [ c,0,s |
136 | , 0,1,0 | 146 | , 0,1,0 |
@@ -227,6 +237,7 @@ runTests n = do | |||
227 | , utest "polySolve" (polySolveProp [1,2,3,4]) | 237 | , utest "polySolve" (polySolveProp [1,2,3,4]) |
228 | , minimizationTest | 238 | , minimizationTest |
229 | , rootFindingTest | 239 | , rootFindingTest |
240 | , utest "random" randomTest | ||
230 | ] | 241 | ] |
231 | return () | 242 | return () |
232 | 243 | ||