diff options
author | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-07 09:30:56 +0000 |
---|---|---|
committer | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-07-07 09:30:56 +0000 |
commit | 9eba8eaa9bd25377f10fd5a62cc6f8771824a0cf (patch) | |
tree | 1007ebe02dd51a7e97fe91fd50e4a0f99493f364 /lib/Numeric/LinearAlgebra | |
parent | 0bcf8cb0860177376cdb04e54761432ccbe63bda (diff) |
rerename minIdx/maxIdx and deprecate vectorMinIdx
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Linear.hs | 28 |
1 files changed, 14 insertions, 14 deletions
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 | |||
34 | absSum :: a e -> e | 34 | absSum :: a e -> e |
35 | vectorMin :: a e -> e | 35 | vectorMin :: a e -> e |
36 | vectorMax :: a e -> e | 36 | vectorMax :: a e -> e |
37 | vectorMinIndex :: a e -> Int | 37 | minIdx :: a e -> Int |
38 | vectorMaxIndex :: a e -> Int | 38 | maxIdx :: a e -> Int |
39 | dot :: a e -> a e -> e | 39 | dot :: a e -> a e -> e |
40 | 40 | ||
41 | instance Vectors Vector Float where | 41 | instance Vectors Vector Float where |
@@ -44,8 +44,8 @@ instance Vectors Vector Float where | |||
44 | absSum = toScalarF AbsSum | 44 | absSum = toScalarF AbsSum |
45 | vectorMin = toScalarF Min | 45 | vectorMin = toScalarF Min |
46 | vectorMax = toScalarF Max | 46 | vectorMax = toScalarF Max |
47 | vectorMinIndex = round . toScalarF MinIdx | 47 | minIdx = round . toScalarF MinIdx |
48 | vectorMaxIndex = round . toScalarF MaxIdx | 48 | maxIdx = round . toScalarF MaxIdx |
49 | dot = dotF | 49 | dot = dotF |
50 | 50 | ||
51 | instance Vectors Vector Double where | 51 | instance Vectors Vector Double where |
@@ -54,28 +54,28 @@ instance Vectors Vector Double where | |||
54 | absSum = toScalarR AbsSum | 54 | absSum = toScalarR AbsSum |
55 | vectorMin = toScalarR Min | 55 | vectorMin = toScalarR Min |
56 | vectorMax = toScalarR Max | 56 | vectorMax = toScalarR Max |
57 | vectorMinIndex = round . toScalarR MinIdx | 57 | minIdx = round . toScalarR MinIdx |
58 | vectorMaxIndex = round . toScalarR MaxIdx | 58 | maxIdx = round . toScalarR MaxIdx |
59 | dot = dotR | 59 | dot = dotR |
60 | 60 | ||
61 | instance Vectors Vector (Complex Float) where | 61 | instance Vectors Vector (Complex Float) where |
62 | vectorSum = sumQ | 62 | vectorSum = sumQ |
63 | euclidean = (:+ 0) . toScalarQ Norm2 | 63 | euclidean = (:+ 0) . toScalarQ Norm2 |
64 | absSum = (:+ 0) . toScalarQ AbsSum | 64 | absSum = (:+ 0) . toScalarQ AbsSum |
65 | vectorMin = ap (@>) vectorMinIndex | 65 | vectorMin = ap (@>) minIdx |
66 | vectorMax = ap (@>) vectorMaxIndex | 66 | vectorMax = ap (@>) maxIdx |
67 | vectorMinIndex = vectorMinIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) | 67 | minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) |
68 | vectorMaxIndex = vectorMaxIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) | 68 | maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) |
69 | dot = dotQ | 69 | dot = dotQ |
70 | 70 | ||
71 | instance Vectors Vector (Complex Double) where | 71 | instance Vectors Vector (Complex Double) where |
72 | vectorSum = sumC | 72 | vectorSum = sumC |
73 | euclidean = (:+ 0) . toScalarC Norm2 | 73 | euclidean = (:+ 0) . toScalarC Norm2 |
74 | absSum = (:+ 0) . toScalarC AbsSum | 74 | absSum = (:+ 0) . toScalarC AbsSum |
75 | vectorMin = ap (@>) vectorMinIndex | 75 | vectorMin = ap (@>) minIdx |
76 | vectorMax = ap (@>) vectorMaxIndex | 76 | vectorMax = ap (@>) maxIdx |
77 | vectorMinIndex = vectorMinIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) | 77 | minIdx = minIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) |
78 | vectorMaxIndex = vectorMaxIndex . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) | 78 | maxIdx = maxIdx . fst . fromComplex . (zipVector (*) `ap` mapVector conjugate) |
79 | dot = dotC | 79 | dot = dotC |
80 | 80 | ||
81 | ---------------------------------------------------- | 81 | ---------------------------------------------------- |