summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Matrix.hs
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-07-09 20:12:19 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-07-09 20:12:19 +0000
commit07bd78f10f2bcce8a5e9838d73754ab4d27f6d1c (patch)
treeac49b4c6eb3331c27ae8efa04ecbc9c553160eec /lib/Data/Packed/Internal/Matrix.hs
parent238a01e0c3b51569c28ede4259cdf33bf18eb94f (diff)
type signatures for use with vector package
Diffstat (limited to 'lib/Data/Packed/Internal/Matrix.hs')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index 861c72a..100b8ea 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -391,11 +391,11 @@ conjV :: (Storable a, RealFloat a) => Vector (Complex a) -> Vector (Complex a)
391conjV = mapVector conjugate 391conjV = mapVector conjugate
392 392
393-- | creates a complex vector from vectors with real and imaginary parts 393-- | creates a complex vector from vectors with real and imaginary parts
394toComplexV :: Element a => (Vector a, Vector a) -> Vector (Complex a) 394toComplexV :: (RealFloat a, Element a) => (Vector a, Vector a) -> Vector (Complex a)
395toComplexV (r,i) = asComplex $ flatten $ fromColumns [r,i] 395toComplexV (r,i) = asComplex $ flatten $ fromColumns [r,i]
396 396
397-- | the inverse of 'toComplex' 397-- | the inverse of 'toComplex'
398fromComplexV :: Element a => Vector (Complex a) -> (Vector a, Vector a) 398fromComplexV :: (RealFloat a, Element a) => Vector (Complex a) -> (Vector a, Vector a)
399fromComplexV z = (r,i) where 399fromComplexV z = (r,i) where
400 [r,i] = toColumns $ reshape 2 $ asReal z 400 [r,i] = toColumns $ reshape 2 $ asReal z
401 401