diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-06-16 15:52:07 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-06-16 15:52:07 +0000 |
commit | b2af660f87a55dd15f4519b21e66837ec811dc25 (patch) | |
tree | f48a2dc5b1d996595e7cd69fbbff6397d3e7b600 /lib/Data/Packed/Matrix.hs | |
parent | cc2c8c39dc088dcace0d2749cfe9180bf5fdbfd2 (diff) |
Fourier, minimization, polySolve
Diffstat (limited to 'lib/Data/Packed/Matrix.hs')
-rw-r--r-- | lib/Data/Packed/Matrix.hs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 6ea76c0..ec5744d 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | module Data.Packed.Matrix ( | 15 | module Data.Packed.Matrix ( |
16 | Matrix(rows,cols), Field, | 16 | Matrix(rows,cols), Field, |
17 | toLists, (><), (>|<), | 17 | toLists, (><), (>|<), (@@>), |
18 | trans, | 18 | trans, |
19 | reshape, | 19 | reshape, |
20 | fromRows, toRows, fromColumns, toColumns, | 20 | fromRows, toRows, fromColumns, toColumns, |
@@ -22,7 +22,9 @@ module Data.Packed.Matrix ( | |||
22 | flipud, fliprl, | 22 | flipud, fliprl, |
23 | liftMatrix, liftMatrix2, | 23 | liftMatrix, liftMatrix2, |
24 | multiply, | 24 | multiply, |
25 | subMatrix, diag, takeDiag, diagRect, ident | 25 | subMatrix, |
26 | takeRows, dropRows, takeColumns, dropColumns, | ||
27 | diag, takeDiag, diagRect, ident | ||
26 | ) where | 28 | ) where |
27 | 29 | ||
28 | import Data.Packed.Internal | 30 | import Data.Packed.Internal |
@@ -69,3 +71,20 @@ r >|< c = f where | |||
69 | | otherwise = error $ "inconsistent list size = " | 71 | | otherwise = error $ "inconsistent list size = " |
70 | ++show (dim v) ++"in ("++show r++"><"++show c++")" | 72 | ++show (dim v) ++"in ("++show r++"><"++show c++")" |
71 | where v = fromList l | 73 | where v = fromList l |
74 | |||
75 | ---------------------------------------------------------------- | ||
76 | |||
77 | -- | Creates a matrix with the first n rows of another matrix | ||
78 | takeRows :: Field t => Int -> Matrix t -> Matrix t | ||
79 | takeRows n mat = subMatrix (0,0) (n, cols mat) mat | ||
80 | -- | Creates a copy of a matrix without the first n rows | ||
81 | dropRows :: Field t => Int -> Matrix t -> Matrix t | ||
82 | dropRows n mat = subMatrix (n,0) (rows mat - n, cols mat) mat | ||
83 | -- |Creates a matrix with the first n columns of another matrix | ||
84 | takeColumns :: Field t => Int -> Matrix t -> Matrix t | ||
85 | takeColumns n mat = subMatrix (0,0) (rows mat, n) mat | ||
86 | -- | Creates a copy of a matrix without the first n columns | ||
87 | dropColumns :: Field t => Int -> Matrix t -> Matrix t | ||
88 | dropColumns n mat = subMatrix (0,n) (rows mat, cols mat - n) mat | ||
89 | |||
90 | ---------------------------------------------------------------- | ||