diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-06-11 10:46:39 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-06-11 10:46:39 +0000 |
commit | 473df6136476dfa07331dd25a6020260c4f02a9b (patch) | |
tree | 0639081371f7f0d3d03aba2a975921690c19f149 /lib/Data | |
parent | f2cf177e93d4578b404909c68b24625a76466ee5 (diff) |
all eig
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index b8de245..bae56f1 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -190,6 +190,8 @@ conj :: Vector (Complex Double) -> Vector (Complex Double) | |||
190 | conj v = asComplex $ cdat $ reshape 2 (asReal v) `mulC` diag (fromList [1,-1]) | 190 | conj v = asComplex $ cdat $ reshape 2 (asReal v) `mulC` diag (fromList [1,-1]) |
191 | where mulC = multiply RowMajor | 191 | where mulC = multiply RowMajor |
192 | 192 | ||
193 | comp v = toComplex (v,constant (dim v) 0) | ||
194 | |||
193 | ------------------------------------------------------------------------------ | 195 | ------------------------------------------------------------------------------ |
194 | 196 | ||
195 | -- | Reverse rows | 197 | -- | Reverse rows |
@@ -203,6 +205,7 @@ fliprl m = fromColumns . reverse . toColumns $ m | |||
203 | ----------------------------------------------------------------- | 205 | ----------------------------------------------------------------- |
204 | 206 | ||
205 | liftMatrix f m = m { dat = f (dat m), tdat = f (tdat m) } -- check sizes | 207 | liftMatrix f m = m { dat = f (dat m), tdat = f (tdat m) } -- check sizes |
208 | liftMatrix2 f m1 m2 = reshape (cols m1) (f (cdat m1) (cdat m2)) -- check sizes | ||
206 | 209 | ||
207 | ------------------------------------------------------------------ | 210 | ------------------------------------------------------------------ |
208 | 211 | ||
@@ -333,3 +336,7 @@ diagRect s r c | |||
333 | | r < c = trans $ diagRect s c r | 336 | | r < c = trans $ diagRect s c r |
334 | | r > c = joinVert [diag s , zeros (r-c,c)] | 337 | | r > c = joinVert [diag s , zeros (r-c,c)] |
335 | where zeros (r,c) = reshape c $ constant (r*c) 0 | 338 | where zeros (r,c) = reshape c $ constant (r*c) 0 |
339 | |||
340 | takeDiag m = fromList [cdat m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]] | ||
341 | |||
342 | ident n = diag (constant n 1) | ||