summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Matrix.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Matrix.hs')
-rw-r--r--lib/Data/Packed/Matrix.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index 0c21b97..c6d8a90 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -455,6 +455,14 @@ class (Element e) => Container c e where
455 real :: c Double -> c e 455 real :: c Double -> c e
456 complex :: c e -> c (Complex Double) 456 complex :: c e -> c (Complex Double)
457 457
458instance Container Vector Float where
459 toComplex = toComplexV
460 fromComplex = fromComplexV
461 comp v = toComplex (v,constant 0 (dim v))
462 conj = conjV
463 real = mapVector realToFrac
464 complex = (mapVector (\(r :+ i) -> (realToFrac r :+ realToFrac i))) . comp
465
458instance Container Vector Double where 466instance Container Vector Double where
459 toComplex = toComplexV 467 toComplex = toComplexV
460 fromComplex = fromComplexV 468 fromComplex = fromComplexV