From cf3c788f0c44577ac1a5365e8154200b53a36409 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 27 May 2014 10:41:40 +0200 Subject: static dimensions, cont. --- packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'packages/tests') diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs index 3803f3b..02beb21 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs @@ -1,5 +1,7 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-incomplete-patterns #-} +{-# LANGUAGE DataKinds #-} + ----------------------------------------------------------------------------- {- | Module : Numeric.LinearAlgebra.Tests @@ -25,7 +27,8 @@ module Numeric.LinearAlgebra.Tests( ) where import Numeric.LinearAlgebra -import Numeric.HMatrix +import Numeric.HMatrix hiding ((<>)) +import Numeric.LinearAlgebra.Real(L) import Numeric.LinearAlgebra.Util(col,row) import Data.Packed import Numeric.LinearAlgebra.LAPACK @@ -466,18 +469,23 @@ kroneckerTest = utest "kronecker" ok x = (4><2) [3,5..] b = (2><5) [0,5..] v1 = vec (a <> x <> b) - v2 = (trans b `kronecker` a) <.> vec x + v2 = (trans b `kronecker` a) <> vec x s = trans b <> b v3 = vec s - v4 = (dup 5 :: Matrix Double) <.> vech s + v4 = (dup 5 :: Matrix Double) <> vech s ok = v1 == v2 && v3 == v4 && vtrans 1 a == trans a && vtrans (rows a) a == asColumn (vec a) -------------------------------------------------------------------------------- -sparseTest = utest "sparse mul" (fst $ checkT (undefined :: SMatrix)) +sparseTest = utest "sparse" (fst $ checkT (undefined :: GMatrix)) + +-------------------------------------------------------------------------------- +staticTest = utest "static" (fst $ checkT (undefined :: L 3 5)) + +-------------------------------------------------------------------------------- -- | All tests must pass with a maximum dimension of about 20 -- (some tests may fail with bigger sizes due to precision loss). @@ -655,6 +663,7 @@ runTests n = do , convolutionTest , kroneckerTest , sparseTest + , staticTest ] when (errors c + failures c > 0) exitFailure return () -- cgit v1.2.3