summaryrefslogtreecommitdiff
path: root/lib/Data
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-09-09 12:41:32 +0000
committerAlberto Ruiz <aruiz@um.es>2010-09-09 12:41:32 +0000
commitc8182454327a0548daa2926f17d636c94b1fadfc (patch)
tree200ecfbbc6787eff7c74d2cd68fdda0f011d5281 /lib/Data
parentc1441ca0451f34e5615b3861175f9eef312dfc62 (diff)
ctrans moved to Data.Packed.Matrix
Diffstat (limited to 'lib/Data')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs5
-rw-r--r--lib/Data/Packed/Matrix.hs6
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index e66817e..5892f1c 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -255,22 +255,27 @@ class (Storable a, Floating a) => Element a where
255 transdata = transdata' 255 transdata = transdata'
256 constantD :: a -> Int -> Vector a 256 constantD :: a -> Int -> Vector a
257 constantD = constant' 257 constantD = constant'
258 ctrans' :: Matrix a -> Matrix a
258 259
259instance Element Float where 260instance Element Float where
260 transdata = transdataAux ctransF 261 transdata = transdataAux ctransF
261 constantD = constantAux cconstantF 262 constantD = constantAux cconstantF
263 ctrans' = trans
262 264
263instance Element Double where 265instance Element Double where
264 transdata = transdataAux ctransR 266 transdata = transdataAux ctransR
265 constantD = constantAux cconstantR 267 constantD = constantAux cconstantR
268 ctrans' = trans
266 269
267instance Element (Complex Float) where 270instance Element (Complex Float) where
268 transdata = transdataAux ctransQ 271 transdata = transdataAux ctransQ
269 constantD = constantAux cconstantQ 272 constantD = constantAux cconstantQ
273 ctrans' = liftMatrix (mapVector conjugate) . trans
270 274
271instance Element (Complex Double) where 275instance Element (Complex Double) where
272 transdata = transdataAux ctransC 276 transdata = transdataAux ctransC
273 constantD = constantAux cconstantC 277 constantD = constantAux cconstantC
278 ctrans' = liftMatrix (mapVector conjugate) . trans
274 279
275------------------------------------------------------------------- 280-------------------------------------------------------------------
276 281
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index 03e5889..af937f4 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -22,7 +22,7 @@ module Data.Packed.Matrix (
22 Element, 22 Element,
23 Matrix,rows,cols, 23 Matrix,rows,cols,
24 (><), 24 (><),
25 trans, 25 trans, ctrans,
26 reshape, flatten, 26 reshape, flatten,
27 fromLists, toLists, buildMatrix, 27 fromLists, toLists, buildMatrix,
28 (@@>), 28 (@@>),
@@ -268,6 +268,10 @@ asRow v = reshape (dim v) v
268asColumn :: Element a => Vector a -> Matrix a 268asColumn :: Element a => Vector a -> Matrix a
269asColumn v = reshape 1 v 269asColumn v = reshape 1 v
270 270
271-- | conjugate transpose
272ctrans :: Element e => Matrix e -> Matrix e
273ctrans = ctrans'
274
271 275
272{- | creates a Matrix of the specified size using the supplied function to 276{- | creates a Matrix of the specified size using the supplied function to
273 to map the row/column position to the value at that row/column position. 277 to map the row/column position to the value at that row/column position.