diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-05-28 10:32:21 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-05-28 12:25:48 +0200 |
commit | c0409bdce707fed49bedb213c21e6cc3e23b9aec (patch) | |
tree | e079624a9fe207b5f4187801e9e05fc13757e8c9 /packages/base/src/Data | |
parent | 3f68d78613ed61540c38548fb3b7e8fca77a85d2 (diff) |
remap autoconformable
Diffstat (limited to 'packages/base/src/Data')
-rw-r--r-- | packages/base/src/Data/Packed/Numeric.hs | 6 |
1 files changed, 5 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 | ||
70 | import Data.Packed | 70 | import Data.Packed |
71 | import Data.Packed.Internal(conformMs) | ||
71 | import Data.Packed.Internal.Numeric | 72 | import Data.Packed.Internal.Numeric |
72 | import Data.Complex | 73 | import Data.Complex |
73 | import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD) | 74 | import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD) |
@@ -318,6 +319,9 @@ cselect = cselect' | |||
318 | remap :: Element t => Matrix I -> Matrix I -> Matrix t -> Matrix t | 319 | remap :: Element t => Matrix I -> Matrix I -> Matrix t -> Matrix t |
319 | remap i j m | 320 | remap 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 | ||