diff options
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 5 |
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 | -} |
224 | reshape :: Element t => Int -> Vector t -> Matrix t | 224 | reshape :: Storable t => Int -> Vector t -> Matrix t |
225 | reshape c v = matrixFromVector RowMajor c v | 225 | reshape c v = matrixFromVector RowMajor c v |
226 | 226 | ||
227 | singleton x = reshape 1 (fromList [x]) | 227 | singleton 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 |
230 | liftMatrix :: (Element a, Element b) => (Vector a -> Vector b) -> Matrix a -> Matrix b | 230 | liftMatrix :: (Storable a, Storable b) => (Vector a -> Vector b) -> Matrix a -> Matrix b |
231 | liftMatrix f MC { icols = c, cdat = d } = matrixFromVector RowMajor c (f d) | 231 | liftMatrix f MC { icols = c, cdat = d } = matrixFromVector RowMajor c (f d) |
232 | liftMatrix f MF { icols = c, fdat = d } = matrixFromVector ColumnMajor c (f d) | 232 | liftMatrix 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 | ||
250 | class (Storable a) => Element a where | 249 | class (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 |