diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-01-19 18:39:19 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-01-19 18:39:19 +0000 |
commit | bc3a6b443e23a7acff4e8e79daf34fadaf5dfe9c (patch) | |
tree | 383564e11044968ad59aea9c1c5f2f6b6cd83386 /lib/Numeric/LinearAlgebra/Tests.hs | |
parent | 2b8aea01b22db9aedb5bd6bdc327a02bfa92e1c2 (diff) |
credits to Daniel Shüssler and fix scale for complex trig tests
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Tests.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 | |||
182 | test (\v -> ifft (fft v) |~| v) | 182 | test (\v -> ifft (fft v) |~| v) |
183 | putStrLn "------ vector operations" | 183 | putStrLn "------ vector operations" |
184 | test (\u -> sin u ^ 2 + cos u ^ 2 |~| (1::RM)) | 184 | test (\u -> sin u ^ 2 + cos u ^ 2 |~| (1::RM)) |
185 | test $ (\u -> sin u ^ 2 + cos u ^ 2 |~| (1::CM)) . liftMatrix makeUnitary | ||
185 | test (\u -> sin u ** 2 + cos u ** 2 |~| (1::RM)) | 186 | test (\u -> sin u ** 2 + cos u ** 2 |~| (1::RM)) |
186 | test (\u -> cos u * tan u |~| sin (u::RM)) | 187 | test (\u -> cos u * tan u |~| sin (u::RM)) |
187 | test (\u -> (cos u * tan u) |~| sin (u::CM)) | 188 | test $ (\u -> cos u * tan u |~| sin (u::CM)) . liftMatrix makeUnitary |
188 | putStrLn "------ read . show" | 189 | putStrLn "------ read . show" |
189 | test (\m -> (m::RM) == read (show m)) | 190 | test (\m -> (m::RM) == read (show m)) |
190 | test (\m -> (m::CM) == read (show m)) | 191 | test (\m -> (m::CM) == read (show m)) |
@@ -208,6 +209,10 @@ runTests n = do | |||
208 | ] | 209 | ] |
209 | return () | 210 | return () |
210 | 211 | ||
212 | makeUnitary v | realPart n > 1 = v */ n | ||
213 | | otherwise = v | ||
214 | where n = sqrt (conj v <.> v) | ||
215 | |||
211 | -- -- | Some additional tests on big matrices. They take a few minutes. | 216 | -- -- | Some additional tests on big matrices. They take a few minutes. |
212 | -- runBigTests :: IO () | 217 | -- runBigTests :: IO () |
213 | -- runBigTests = undefined | 218 | -- runBigTests = undefined |