summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/base/src/Data/Packed/Numeric.hs6
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/Util.hs1
2 files changed, 6 insertions, 1 deletions
diff --git a/packages/base/src/Data/Packed/Numeric.hs b/packages/base/src/Data/Packed/Numeric.hs
index 80f1718..7d77b19 100644
--- a/packages/base/src/Data/Packed/Numeric.hs
+++ b/packages/base/src/Data/Packed/Numeric.hs
@@ -68,6 +68,7 @@ module Data.Packed.Numeric (
68) where 68) where
69 69
70import Data.Packed 70import Data.Packed
71import Data.Packed.Internal(conformMs)
71import Data.Packed.Internal.Numeric 72import Data.Packed.Internal.Numeric
72import Data.Complex 73import Data.Complex
73import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD) 74import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD)
@@ -318,6 +319,9 @@ cselect = cselect'
318remap :: Element t => Matrix I -> Matrix I -> Matrix t -> Matrix t 319remap :: Element t => Matrix I -> Matrix I -> Matrix t -> Matrix t
319remap i j m 320remap i j m
320 | minElement i >= 0 && maxElement i < fromIntegral (rows m) && 321 | minElement i >= 0 && maxElement i < fromIntegral (rows m) &&
321 minElement j >= 0 && maxElement j < fromIntegral (cols m) = remapM i j m 322 minElement j >= 0 && maxElement j < fromIntegral (cols m) = remapM i' j' m
322 | otherwise = error $ "out of range index in rmap" 323 | otherwise = error $ "out of range index in rmap"
324 where
325 [i',j'] = conformMs [i,j]
326
323 327
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util.hs b/packages/base/src/Numeric/LinearAlgebra/Util.hs
index 60079e7..f09bdb5 100644
--- a/packages/base/src/Numeric/LinearAlgebra/Util.hs
+++ b/packages/base/src/Numeric/LinearAlgebra/Util.hs
@@ -485,5 +485,6 @@ test = (and ok, print ok)
485 md = fromInt m :: Matrix Double 485 md = fromInt m :: Matrix Double
486 ok = [ tr m <> m == toInt (tr md <> md) 486 ok = [ tr m <> m == toInt (tr md <> md)
487 , m <> tr m == toInt (md <> tr md) 487 , m <> tr m == toInt (md <> tr md)
488 , m ?? (Take 2, Take 3) == remap (asColumn (range 2)) (asRow (range 3)) m
488 ] 489 ]
489 490