summaryrefslogtreecommitdiff
path: root/packages/tests/src/Numeric
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests/src/Numeric')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index c0c151a..3c7863f 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -242,6 +242,29 @@ triDiagTest = utest "triDiagTest" (ok1 && ok2) where
242 242
243--------------------------------------------------------------------- 243---------------------------------------------------------------------
244 244
245triDiagRegression = utest "triDiagRegression" ok where
246 minusOnes, twos :: Vector R
247 minusOnes = fromList [-1, -1]
248 twos = fromList [2, 2, 2]
249 k :: Matrix R
250 k = (3><3)
251 [ 2, -1, 0
252 , -1, 2, -1
253 , 0, -1, 2
254 ]
255
256 b :: Matrix R
257 b = (3><1) [10, 10, 10]
258
259 tridiag = triDiagSolve minusOnes twos minusOnes b
260 simple = linearSolve k b
261
262 ok = case simple of
263 Just m -> tridiag |~| m
264 Nothing -> False
265
266---------------------------------------------------------------------
267
245randomTestGaussian = (unSym c) :~3~: unSym (snd (meanCov dat)) 268randomTestGaussian = (unSym c) :~3~: unSym (snd (meanCov dat))
246 where 269 where
247 a = (3><3) [1,2,3, 270 a = (3><3) [1,2,3,
@@ -830,6 +853,7 @@ runTests n = do
830 , mbCholTest 853 , mbCholTest
831 , triTest 854 , triTest
832 , triDiagTest 855 , triDiagTest
856 , triDiagRegression
833 , utest "offset" offsetTest 857 , utest "offset" offsetTest
834 , normsVTest 858 , normsVTest
835 , normsMTest 859 , normsMTest