diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-09-15 09:59:20 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-09-15 09:59:20 +0000 |
commit | f901d49d1392327c79f1d4c63932fa350cfb506a (patch) | |
tree | 1955651cbd636686037ae279183c7f746ff5a1af /lib/Data/Packed/Internal | |
parent | d14515a4a50d5b5335f9c1525432b68ab67fa7c8 (diff) |
minor changes
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 58b325c..8bca510 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -152,11 +152,12 @@ reshape c v = matrixFromVector RowMajor c v | |||
152 | 152 | ||
153 | singleton x = reshape 1 (fromList [x]) | 153 | singleton x = reshape 1 (fromList [x]) |
154 | 154 | ||
155 | -- | application of a vector function on the flattened matrix elements | ||
155 | liftMatrix :: (Field a, Field b) => (Vector a -> Vector b) -> Matrix a -> Matrix b | 156 | liftMatrix :: (Field a, Field b) => (Vector a -> Vector b) -> Matrix a -> Matrix b |
156 | liftMatrix f MC { cols = c, cdat = d } = matrixFromVector RowMajor c (f d) | 157 | liftMatrix f MC { cols = c, cdat = d } = matrixFromVector RowMajor c (f d) |
157 | liftMatrix f MF { cols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) | 158 | liftMatrix f MF { cols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) |
158 | 159 | ||
159 | 160 | -- | application of a vector function on the flattened matrices elements | |
160 | liftMatrix2 :: (Field t, Field a, Field b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t | 161 | liftMatrix2 :: (Field t, Field a, Field b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t |
161 | liftMatrix2 f m1 m2 | 162 | liftMatrix2 f m1 m2 |
162 | | not (compat m1 m2) = error "nonconformant matrices in liftMatrix2" | 163 | | not (compat m1 m2) = error "nonconformant matrices in liftMatrix2" |