diff options
author | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-09-07 04:23:19 +0000 |
---|---|---|
committer | Vivian McPhail <haskell.vivian.mcphail@gmail.com> | 2010-09-07 04:23:19 +0000 |
commit | 7e103b8ada6fa1479790eac80eda997f5fdaf33f (patch) | |
tree | 7f8ab3cb23d76fc1f624c4b947e39a9257a036db /lib/Numeric/Container.hs | |
parent | 9004922ad91c0b4ad8498c31171a3a1a1e27d9f2 (diff) |
remove v_* functions
Diffstat (limited to 'lib/Numeric/Container.hs')
-rw-r--r-- | lib/Numeric/Container.hs | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs index a0e489b..d6b1342 100644 --- a/lib/Numeric/Container.hs +++ b/lib/Numeric/Container.hs | |||
@@ -21,7 +21,6 @@ | |||
21 | module Numeric.Container ( | 21 | module Numeric.Container ( |
22 | Linear(..), | 22 | Linear(..), |
23 | Container(..), RealElement, Precision(..), NumericContainer(..), comp, | 23 | Container(..), RealElement, Precision(..), NumericContainer(..), comp, |
24 | -- Complexable(..), Precisionable(..), | ||
25 | Convert(..), --AutoReal(..), | 24 | Convert(..), --AutoReal(..), |
26 | RealOf, ComplexOf, SingleOf, DoubleOf, | 25 | RealOf, ComplexOf, SingleOf, DoubleOf, |
27 | 26 | ||
@@ -123,70 +122,6 @@ type instance IndexOf Vector = Int | |||
123 | type instance IndexOf Matrix = (Int,Int) | 122 | type instance IndexOf Matrix = (Int,Int) |
124 | 123 | ||
125 | ------------------------------------------------------------------- | 124 | ------------------------------------------------------------------- |
126 | {- | ||
127 | -- | Supported single-double precision type pairs | ||
128 | class (Element e) => V_Precision e where | ||
129 | v_double2FloatG :: Vector e -> Vector (SingleOf e) | ||
130 | v_float2DoubleG :: Vector (SingleOf e) -> Vector e | ||
131 | {- | ||
132 | instance V_Precision Float where | ||
133 | v_double2FloatG = double2FloatV | ||
134 | v_float2DoubleG = float2DoubleV | ||
135 | -} | ||
136 | instance V_Precision Double where | ||
137 | v_double2FloatG = double2FloatV | ||
138 | v_float2DoubleG = float2DoubleV | ||
139 | {- | ||
140 | instance V_Precision (Complex Float) where | ||
141 | v_double2FloatG = asComplex . double2FloatV . asReal | ||
142 | v_float2DoubleG = asComplex . float2DoubleV . asReal | ||
143 | -} | ||
144 | instance V_Precision (Complex Double) where | ||
145 | v_double2FloatG = asComplex . double2FloatV . asReal | ||
146 | v_float2DoubleG = asComplex . float2DoubleV . asReal | ||
147 | -} | ||
148 | ------------------------------------------------------------------- | ||
149 | {- | ||
150 | -- | converting to/from complex containers | ||
151 | class RealElement t => Complexable c t where | ||
152 | v_toComplex :: (c t, c t) -> c (Complex t) | ||
153 | v_fromComplex :: c (Complex t) -> (c t, c t) | ||
154 | v_complex' :: c t -> c (Complex t) | ||
155 | v_conj :: c (Complex t) -> c (Complex t) | ||
156 | |||
157 | -- | converting to/from single/double precision numbers | ||
158 | class (Element (SingleOf t), Element t, RealElement (RealOf t)) => Precisionable c t where | ||
159 | v_single' :: (V_Precision (DoubleOf t)) => c t -> c (SingleOf t) | ||
160 | v_double' :: (V_Precision (DoubleOf t)) => c t -> c (DoubleOf t) | ||
161 | |||
162 | -- | generic conversion functions | ||
163 | class (Element t, RealElement (RealOf t)) => V_Convert t where | ||
164 | -- | real/complex | ||
165 | v_real :: Complexable c (RealOf t) => c (RealOf t) -> c t -- from the instances, this looks like it turns a real object into a complex object WHEN the context is a complex object | ||
166 | v_complex :: Complexable c (RealOf t) => c t -> c (ComplexOf t) | ||
167 | -- | single/double | ||
168 | v_single :: Precisionable c t => c t -> c (SingleOf t) | ||
169 | v_double :: Precisionable c t => c t -> c (DoubleOf t) | ||
170 | -} | ||
171 | ------------------------------------------------------------------- | ||
172 | {- | ||
173 | instance Precisionable Vector Float where | ||
174 | v_single' = id | ||
175 | v_double' = float2DoubleG | ||
176 | |||
177 | instance Precisionable Vector Double where | ||
178 | v_single' = double2FloatG | ||
179 | v_double' = id | ||
180 | |||
181 | instance Precisionable Vector (Complex Float) where | ||
182 | v_single' = id | ||
183 | v_double' = float2DoubleG | ||
184 | |||
185 | instance Precisionable Vector (Complex Double) where | ||
186 | v_single' = double2FloatG | ||
187 | v_double' = id | ||
188 | -} | ||
189 | ------------------------------------------------------------------- | ||
190 | 125 | ||
191 | class (Element t, Element (RealOf t)) => Convert t where | 126 | class (Element t, Element (RealOf t)) => Convert t where |
192 | real :: NumericContainer c => c (RealOf t) -> c t | 127 | real :: NumericContainer c => c (RealOf t) -> c t |