From c8182454327a0548daa2926f17d636c94b1fadfc Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 9 Sep 2010 12:41:32 +0000 Subject: ctrans moved to Data.Packed.Matrix --- lib/Data/Packed/Internal/Matrix.hs | 5 +++++ lib/Data/Packed/Matrix.hs | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/Data') 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 transdata = transdata' constantD :: a -> Int -> Vector a constantD = constant' + ctrans' :: Matrix a -> Matrix a instance Element Float where transdata = transdataAux ctransF constantD = constantAux cconstantF + ctrans' = trans instance Element Double where transdata = transdataAux ctransR constantD = constantAux cconstantR + ctrans' = trans instance Element (Complex Float) where transdata = transdataAux ctransQ constantD = constantAux cconstantQ + ctrans' = liftMatrix (mapVector conjugate) . trans instance Element (Complex Double) where transdata = transdataAux ctransC constantD = constantAux cconstantC + ctrans' = liftMatrix (mapVector conjugate) . trans ------------------------------------------------------------------- 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 ( Element, Matrix,rows,cols, (><), - trans, + trans, ctrans, reshape, flatten, fromLists, toLists, buildMatrix, (@@>), @@ -268,6 +268,10 @@ asRow v = reshape (dim v) v asColumn :: Element a => Vector a -> Matrix a asColumn v = reshape 1 v +-- | conjugate transpose +ctrans :: Element e => Matrix e -> Matrix e +ctrans = ctrans' + {- | creates a Matrix of the specified size using the supplied function to to map the row/column position to the value at that row/column position. -- cgit v1.2.3