summaryrefslogtreecommitdiff
path: root/lib/Data/Packed
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-09-06 09:59:08 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-09-06 09:59:08 +0000
commit9004922ad91c0b4ad8498c31171a3a1a1e27d9f2 (patch)
treec6d4759e584b7933029e405a73974e173046ddcc /lib/Data/Packed
parent29099e3bfb4eec87ac3d4d675d7cfc82234c20d6 (diff)
Merged changes with conversion-linear
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs16
-rw-r--r--lib/Data/Packed/Matrix.hs1
-rw-r--r--lib/Data/Packed/Vector.hs1
3 files changed, 1 insertions, 17 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index 100b8ea..e66817e 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -29,7 +29,6 @@ module Data.Packed.Internal.Matrix(
29 liftMatrix, liftMatrix2, 29 liftMatrix, liftMatrix2,
30 (@@>), 30 (@@>),
31 saveMatrix, 31 saveMatrix,
32 fromComplexV, toComplexV, conjV,
33 singleton 32 singleton
34) where 33) where
35 34
@@ -386,21 +385,6 @@ subMatrix' (r0,c0) (rt,ct) m = trans $ subMatrix' (c0,r0) (ct,rt) (trans m)
386 385
387-------------------------------------------------------------------------- 386--------------------------------------------------------------------------
388 387
389-- | obtains the complex conjugate of a complex vector
390conjV :: (Storable a, RealFloat a) => Vector (Complex a) -> Vector (Complex a)
391conjV = mapVector conjugate
392
393-- | creates a complex vector from vectors with real and imaginary parts
394toComplexV :: (RealFloat a, Element a) => (Vector a, Vector a) -> Vector (Complex a)
395toComplexV (r,i) = asComplex $ flatten $ fromColumns [r,i]
396
397-- | the inverse of 'toComplex'
398fromComplexV :: (RealFloat a, Element a) => Vector (Complex a) -> (Vector a, Vector a)
399fromComplexV z = (r,i) where
400 [r,i] = toColumns $ reshape 2 $ asReal z
401
402--------------------------------------------------------------------------
403
404-- | Saves a matrix as 2D ASCII table. 388-- | Saves a matrix as 2D ASCII table.
405saveMatrix :: FilePath 389saveMatrix :: FilePath
406 -> String -- ^ format (%f, %g, %e) 390 -> String -- ^ format (%f, %g, %e)
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index b860cb1..03e5889 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -55,6 +55,7 @@ import Control.Monad(replicateM)
55--import Control.Arrow((***)) 55--import Control.Arrow((***))
56--import GHC.Float(double2Float,float2Double) 56--import GHC.Float(double2Float,float2Double)
57 57
58
58------------------------------------------------------------------- 59-------------------------------------------------------------------
59 60
60instance (Binary a, Element a, Storable a) => Binary (Matrix a) where 61instance (Binary a, Element a, Storable a) => Binary (Matrix a) where
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index ad690f9..253f2fa 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -72,7 +72,6 @@ instance (Binary a, Storable a) => Binary (Vector a) where
72 72
73------------------------------------------------------------------- 73-------------------------------------------------------------------
74 74
75
76{- 75{-
77vectorFMax :: Vector Float -> Float 76vectorFMax :: Vector Float -> Float
78vectorFMax = toScalarF Max 77vectorFMax = toScalarF Max