From bc3a6b443e23a7acff4e8e79daf34fadaf5dfe9c Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Mon, 19 Jan 2009 18:39:19 +0000 Subject: credits to Daniel Shüssler and fix scale for complex trig tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Numeric/LinearAlgebra/Tests.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Numeric') diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index 8b92287..7758268 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs @@ -182,9 +182,10 @@ runTests n = do test (\v -> ifft (fft v) |~| v) putStrLn "------ vector operations" test (\u -> sin u ^ 2 + cos u ^ 2 |~| (1::RM)) + test $ (\u -> sin u ^ 2 + cos u ^ 2 |~| (1::CM)) . liftMatrix makeUnitary test (\u -> sin u ** 2 + cos u ** 2 |~| (1::RM)) test (\u -> cos u * tan u |~| sin (u::RM)) - test (\u -> (cos u * tan u) |~| sin (u::CM)) + test $ (\u -> cos u * tan u |~| sin (u::CM)) . liftMatrix makeUnitary putStrLn "------ read . show" test (\m -> (m::RM) == read (show m)) test (\m -> (m::CM) == read (show m)) @@ -208,6 +209,10 @@ runTests n = do ] return () +makeUnitary v | realPart n > 1 = v */ n + | otherwise = v + where n = sqrt (conj v <.> v) + -- -- | Some additional tests on big matrices. They take a few minutes. -- runBigTests :: IO () -- runBigTests = undefined -- cgit v1.2.3