summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-09-15 09:59:20 +0000
committerAlberto Ruiz <aruiz@um.es>2007-09-15 09:59:20 +0000
commitf901d49d1392327c79f1d4c63932fa350cfb506a (patch)
tree1955651cbd636686037ae279183c7f746ff5a1af /lib/Data/Packed/Internal
parentd14515a4a50d5b5335f9c1525432b68ab67fa7c8 (diff)
minor changes
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs3
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
153singleton x = reshape 1 (fromList [x]) 153singleton x = reshape 1 (fromList [x])
154 154
155-- | application of a vector function on the flattened matrix elements
155liftMatrix :: (Field a, Field b) => (Vector a -> Vector b) -> Matrix a -> Matrix b 156liftMatrix :: (Field a, Field b) => (Vector a -> Vector b) -> Matrix a -> Matrix b
156liftMatrix f MC { cols = c, cdat = d } = matrixFromVector RowMajor c (f d) 157liftMatrix f MC { cols = c, cdat = d } = matrixFromVector RowMajor c (f d)
157liftMatrix f MF { cols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) 158liftMatrix 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
160liftMatrix2 :: (Field t, Field a, Field b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t 161liftMatrix2 :: (Field t, Field a, Field b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t
161liftMatrix2 f m1 m2 162liftMatrix2 f m1 m2
162 | not (compat m1 m2) = error "nonconformant matrices in liftMatrix2" 163 | not (compat m1 m2) = error "nonconformant matrices in liftMatrix2"