diff options
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Util.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util.hs b/packages/base/src/Numeric/LinearAlgebra/Util.hs index 779630f..60079e7 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Util.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Util.hs | |||
@@ -473,3 +473,17 @@ dispShort maxr maxc dec m = | |||
473 | where | 473 | where |
474 | fmt = printf ("%."++show dec ++"f") | 474 | fmt = printf ("%."++show dec ++"f") |
475 | 475 | ||
476 | -------------------------------------------------------------------------------- | ||
477 | |||
478 | instance Testable (Matrix I) where | ||
479 | checkT _ = test | ||
480 | |||
481 | test :: (Bool, IO()) | ||
482 | test = (and ok, print ok) | ||
483 | where | ||
484 | m = (3><4) [1..12] :: Matrix I | ||
485 | md = fromInt m :: Matrix Double | ||
486 | ok = [ tr m <> m == toInt (tr md <> md) | ||
487 | , m <> tr m == toInt (md <> tr md) | ||
488 | ] | ||
489 | |||