From 9eba8eaa9bd25377f10fd5a62cc6f8771824a0cf Mon Sep 17 00:00:00 2001 From: Vivian McPhail Date: Wed, 7 Jul 2010 09:30:56 +0000 Subject: rerename minIdx/maxIdx and deprecate vectorMinIdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Numeric/LinearAlgebra/Linear.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/Numeric') diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index e817642..aed6a2b 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs @@ -34,8 +34,8 @@ class Num e => Vectors a e where absSum :: a e -> e vectorMin :: a e -> e vectorMax :: a e -> e - vectorMinIndex :: a e -> Int - vectorMaxIndex :: a e -> Int + minIdx :: a e -> Int + maxIdx :: a e -> Int dot :: a e -> a e -> e instance Vectors Vector Float where @@ -44,8 +44,8 @@ instance Vectors Vector Float where absSum = toScalarF AbsSum vectorMin = toScalarF Min vectorMax = toScalarF Max - vectorMinIndex = round . toScalarF MinIdx - vectorMaxIndex = round . toScalarF MaxIdx + minIdx = round . toScalarF MinIdx + maxIdx = round . toScalarF MaxIdx dot = dotF instance Vectors Vector Double where @@ -54,28 +54,28 @@ instance Vectors Vector Double where absSum = toScalarR AbsSum vectorMin = toScalarR Min vectorMax = toScalarR Max - vectorMinIndex = round . toScalarR MinIdx - vectorMaxIndex = round . toScalarR MaxIdx + minIdx = round . toScalarR MinIdx + maxIdx = round . toScalarR MaxIdx dot = dotR instance Vectors Vector (Complex Float) where vectorSum = sumQ euclidean = (:+ 0) . toScalarQ Norm2 absSum = (:+ 0) . toScalarQ AbsSum - vectorMin = ap (@>) vectorMinIndex - vectorMax = ap (@>) vectorMaxIndex - vectorMinIndex = vectorMinIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) - vectorMaxIndex = vectorMaxIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + vectorMin = ap (@>) minIdx + vectorMax = ap (@>) maxIdx + minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) dot = dotQ instance Vectors Vector (Complex Double) where vectorSum = sumC euclidean = (:+ 0) . toScalarC Norm2 absSum = (:+ 0) . toScalarC AbsSum - vectorMin = ap (@>) vectorMinIndex - vectorMax = ap (@>) vectorMaxIndex - vectorMinIndex = vectorMinIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) - vectorMaxIndex = vectorMaxIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + vectorMin = ap (@>) minIdx + vectorMax = ap (@>) maxIdx + minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) + maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) dot = dotC ---------------------------------------------------- -- cgit v1.2.3