From 8107bacedd0b898b574ede296bc0062d7cfc230d Mon Sep 17 00:00:00 2001 From: Vivian McPhail Date: Tue, 6 Jul 2010 06:56:17 +0000 Subject: vectors complex idx fix --- lib/Numeric/LinearAlgebra/Linear.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index e718e83..aed6a2b 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs @@ -64,8 +64,8 @@ instance Vectors Vector (Complex Float) where absSum = (:+ 0) . toScalarQ AbsSum vectorMin = ap (@>) minIdx vectorMax = ap (@>) maxIdx - minIdx = minIdx . (zipVector (*) `ap` mapVector conjugate) - maxIdx = maxIdx . (zipVector (*) `ap` mapVector conjugate) + minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) dot = dotQ instance Vectors Vector (Complex Double) where @@ -74,8 +74,8 @@ instance Vectors Vector (Complex Double) where absSum = (:+ 0) . toScalarC AbsSum vectorMin = ap (@>) minIdx vectorMax = ap (@>) maxIdx - minIdx = minIdx . (zipVector (*) `ap` mapVector conjugate) - maxIdx = maxIdx . (zipVector (*) `ap` mapVector conjugate) + minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) dot = dotC ---------------------------------------------------- -- cgit v1.2.3