diff options
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Matrix.hs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 951cec6..63ebddf 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -349,7 +349,7 @@ foreign import ccall safe "aux.h constantC" | |||
349 | @> constant 2 7 | 349 | @> constant 2 7 |
350 | 7 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0]@ | 350 | 7 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0]@ |
351 | -} | 351 | -} |
352 | constant :: Double -> Int -> Vector Double | 352 | constant :: Field a => a -> Int -> Vector a |
353 | constant = constantD | 353 | constant = constantD |
354 | 354 | ||
355 | -------------------------------------------------------------------------- | 355 | -------------------------------------------------------------------------- |
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 5a4b919..404fde7 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs | |||
@@ -27,7 +27,7 @@ module Data.Packed.Matrix ( | |||
27 | subMatrix, takeRows, dropRows, takeColumns, dropColumns, | 27 | subMatrix, takeRows, dropRows, takeColumns, dropColumns, |
28 | ident, diag, diagRect, takeDiag, | 28 | ident, diag, diagRect, takeDiag, |
29 | liftMatrix, liftMatrix2, | 29 | liftMatrix, liftMatrix2, |
30 | dispR, readMatrix, fromArray2D | 30 | format, dispR, readMatrix, fromArray2D |
31 | ) where | 31 | ) where |
32 | 32 | ||
33 | import Data.Packed.Internal | 33 | import Data.Packed.Internal |
@@ -95,7 +95,7 @@ takeDiag :: (Field t) => Matrix t -> Vector t | |||
95 | takeDiag m = fromList [cdat m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]] | 95 | takeDiag m = fromList [cdat m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]] |
96 | 96 | ||
97 | -- | creates the identity matrix of given dimension | 97 | -- | creates the identity matrix of given dimension |
98 | ident :: Int -> Matrix Double | 98 | ident :: Field a => Int -> Matrix a |
99 | ident n = diag (constant 1 n) | 99 | ident n = diag (constant 1 n) |
100 | 100 | ||
101 | ------------------------------------------------------------ | 101 | ------------------------------------------------------------ |