From 3916d70b9d170633c6122cb3c46000f0b3f32018 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 21 May 2014 13:10:15 +0200 Subject: Numeric.LinearAlgebra.Compat --- packages/tests/src/Numeric/LinearAlgebra/Tests.hs | 13 +++++-------- .../tests/src/Numeric/LinearAlgebra/Tests/Properties.hs | 10 ++++------ 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'packages/tests/src/Numeric') diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs index e4f0846..55a805a 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs @@ -25,8 +25,9 @@ module Numeric.LinearAlgebra.Tests( ) where --import Data.Packed.Random -import Numeric.LinearAlgebra -import Numeric.Container +import Numeric.LinearAlgebra.Compat +import Numeric.LinearAlgebra.Util(row,col) +import Data.Packed import Numeric.LinearAlgebra.LAPACK import Numeric.LinearAlgebra.Tests.Instances import Numeric.LinearAlgebra.Tests.Properties @@ -67,10 +68,6 @@ a ~~ b = fromList a |~| fromList b feye n = flipud (ident n) :: Matrix Double -eps = peps :: Double - -i = 0 :+ 1 :: Complex Double - ----------------------------------------------------------- @@ -466,10 +463,10 @@ 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 <> 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) diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs index 81cbf61..70d36e8 100644 --- a/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs +++ b/packages/tests/src/Numeric/LinearAlgebra/Tests/Properties.hs @@ -43,9 +43,7 @@ module Numeric.LinearAlgebra.Tests.Properties ( linearSolveProp, linearSolveProp2 ) where -import Numeric.LinearAlgebra --hiding (real,complex) -import Numeric.LinearAlgebra.Devel -import Numeric.Container +import Numeric.LinearAlgebra.Compat --hiding (real,complex) import Numeric.LinearAlgebra.LAPACK import Debug.Trace import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector @@ -95,13 +93,13 @@ positiveDefinite m = minimum (toList e) > 0 upperTriang m = rows m == 1 || down == z where down = fromList $ concat $ zipWith drop [1..] (toLists (ctrans m)) - z = constant 0 (dim down) + z = konst 0 (dim down) upperHessenberg m = rows m < 3 || down == z where down = fromList $ concat $ zipWith drop [2..] (toLists (ctrans m)) - z = constant 0 (dim down) + z = konst 0 (dim down) -zeros (r,c) = reshape c (constant 0 (r*c)) +zeros (r,c) = reshape c (konst 0 (r*c)) ones (r,c) = zeros (r,c) + 1 -- cgit v1.2.3