summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index c0824a3..94b56cf 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -221,13 +221,13 @@ where r is the desired number of rows.)
221 , 9.0, 10.0, 11.0, 12.0 ]@ 221 , 9.0, 10.0, 11.0, 12.0 ]@
222 222
223-} 223-}
224reshape :: Element t => Int -> Vector t -> Matrix t 224reshape :: Storable t => Int -> Vector t -> Matrix t
225reshape c v = matrixFromVector RowMajor c v 225reshape c v = matrixFromVector RowMajor c v
226 226
227singleton x = reshape 1 (fromList [x]) 227singleton x = reshape 1 (fromList [x])
228 228
229-- | application of a vector function on the flattened matrix elements 229-- | application of a vector function on the flattened matrix elements
230liftMatrix :: (Element a, Element b) => (Vector a -> Vector b) -> Matrix a -> Matrix b 230liftMatrix :: (Storable a, Storable b) => (Vector a -> Vector b) -> Matrix a -> Matrix b
231liftMatrix f MC { icols = c, cdat = d } = matrixFromVector RowMajor c (f d) 231liftMatrix f MC { icols = c, cdat = d } = matrixFromVector RowMajor c (f d)
232liftMatrix f MF { icols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) 232liftMatrix f MF { icols = c, fdat = d } = matrixFromVector ColumnMajor c (f d)
233 233
@@ -246,7 +246,6 @@ compat m1 m2 = rows m1 == rows m2 && cols m1 == cols m2
246------------------------------------------------------------------ 246------------------------------------------------------------------
247 247
248-- | Supported element types for basic matrix operations. 248-- | Supported element types for basic matrix operations.
249--class (Storable a, Floating a) => Element a where
250class (Storable a) => Element a where 249class (Storable a) => Element a where
251 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position 250 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position
252 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix 251 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix