diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-11-15 17:42:50 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-11-15 17:42:50 +0000 |
commit | ca67378bef1b0e4e76b4421786a846956c47f380 (patch) | |
tree | 07e9079232f1c576e2d4a1cc24b73085b95e33a1 /lib/Numeric/LinearAlgebra | |
parent | dc39c11d2d2e75428e6394cf8542c8c3ff2cd887 (diff) |
uniformSample
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 097756e..4495396 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -131,7 +131,7 @@ rootFindingTest = TestList [ utest "root Hybrids" (fst sol1 ~~ [1,1]) | |||
131 | 131 | ||
132 | --------------------------------------------------------------------- | 132 | --------------------------------------------------------------------- |
133 | 133 | ||
134 | randomTest = c :~1~: snd (meanCov dat) where | 134 | randomTestGaussian = c :~1~: snd (meanCov dat) where |
135 | a = (3><3) [1,2,3, | 135 | a = (3><3) [1,2,3, |
136 | 2,4,0, | 136 | 2,4,0, |
137 | -2,2,1] | 137 | -2,2,1] |
@@ -139,6 +139,10 @@ randomTest = c :~1~: snd (meanCov dat) where | |||
139 | c = a <> trans a | 139 | c = a <> trans a |
140 | dat = gaussianSample 7 (10^6) m c | 140 | dat = gaussianSample 7 (10^6) m c |
141 | 141 | ||
142 | randomTestUniform = c :~1~: snd (meanCov dat) where | ||
143 | c = diag $ 3 |> map ((/12).(^2)) [1,2,3] | ||
144 | dat = uniformSample 7 (10^6) [(0,1),(1,3),(3,6)] | ||
145 | |||
142 | --------------------------------------------------------------------- | 146 | --------------------------------------------------------------------- |
143 | 147 | ||
144 | rot :: Double -> Matrix Double | 148 | rot :: Double -> Matrix Double |
@@ -237,7 +241,8 @@ runTests n = do | |||
237 | , utest "polySolve" (polySolveProp [1,2,3,4]) | 241 | , utest "polySolve" (polySolveProp [1,2,3,4]) |
238 | , minimizationTest | 242 | , minimizationTest |
239 | , rootFindingTest | 243 | , rootFindingTest |
240 | , utest "random" randomTest | 244 | , utest "randomGaussian" randomTestGaussian |
245 | , utest "randomUniform" randomTestUniform | ||
241 | ] | 246 | ] |
242 | return () | 247 | return () |
243 | 248 | ||