From f901d49d1392327c79f1d4c63932fa350cfb506a Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 15 Sep 2007 09:59:20 +0000 Subject: minor changes --- lib/Data/Packed/Internal/Matrix.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Data/Packed/Internal') 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 singleton x = reshape 1 (fromList [x]) +-- | application of a vector function on the flattened matrix elements liftMatrix :: (Field a, Field b) => (Vector a -> Vector b) -> Matrix a -> Matrix b liftMatrix f MC { cols = c, cdat = d } = matrixFromVector RowMajor c (f d) liftMatrix f MF { cols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) - +-- | application of a vector function on the flattened matrices elements liftMatrix2 :: (Field t, Field a, Field b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t liftMatrix2 f m1 m2 | not (compat m1 m2) = error "nonconformant matrices in liftMatrix2" -- cgit v1.2.3