summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Container.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-07-13 12:28:15 +0200
committerAlberto Ruiz <aruiz@um.es>2015-07-13 12:28:15 +0200
commit14f492c0139c7d7e2768311068beda5441730ce3 (patch)
tree14f325bbfa9b7d1bc7ccf16e6b73ac4db14db953 /packages/base/src/Internal/Container.hs
parenta3b28fdf0b6a335b4905c25413cf82438383319e (diff)
make Numeric superclass of Field
Diffstat (limited to 'packages/base/src/Internal/Container.hs')
-rw-r--r--packages/base/src/Internal/Container.hs41
1 files changed, 0 insertions, 41 deletions
diff --git a/packages/base/src/Internal/Container.hs b/packages/base/src/Internal/Container.hs
index 307c6a8..b08f892 100644
--- a/packages/base/src/Internal/Container.hs
+++ b/packages/base/src/Internal/Container.hs
@@ -28,7 +28,6 @@ import Internal.Vector
28import Internal.Matrix 28import Internal.Matrix
29import Internal.Element 29import Internal.Element
30import Internal.Numeric 30import Internal.Numeric
31import Data.Complex
32import Internal.Algorithms(Field,linearSolveSVD) 31import Internal.Algorithms(Field,linearSolveSVD)
33 32
34------------------------------------------------------------------ 33------------------------------------------------------------------
@@ -158,29 +157,6 @@ instance LSDiv Matrix
158 157
159-------------------------------------------------------------------------------- 158--------------------------------------------------------------------------------
160 159
161class Konst e d c | d -> c, c -> d
162 where
163 -- |
164 -- >>> konst 7 3 :: Vector Float
165 -- fromList [7.0,7.0,7.0]
166 --
167 -- >>> konst i (3::Int,4::Int)
168 -- (3><4)
169 -- [ 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0
170 -- , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0
171 -- , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0 ]
172 --
173 konst :: e -> d -> c e
174
175instance Container Vector e => Konst e Int Vector
176 where
177 konst = konst'
178
179instance (Num e, Container Vector e) => Konst e (Int,Int) Matrix
180 where
181 konst = konst'
182
183--------------------------------------------------------------------------------
184 160
185class Build d f c e | d -> c, c -> d, f -> e, f -> d, f -> c, c e -> f, d e -> f 161class Build d f c e | d -> c, c -> d, f -> e, f -> d, f -> c, c e -> f, d e -> f
186 where 162 where
@@ -241,23 +217,6 @@ meanCov x = (med,cov) where
241 217
242-------------------------------------------------------------------------------- 218--------------------------------------------------------------------------------
243 219
244class ( Container Vector t
245 , Container Matrix t
246 , Konst t Int Vector
247 , Konst t (Int,Int) Matrix
248 , CTrans t
249 , Product t
250 ) => Numeric t
251
252instance Numeric Double
253instance Numeric (Complex Double)
254instance Numeric Float
255instance Numeric (Complex Float)
256instance Numeric I
257instance Numeric Z
258
259--------------------------------------------------------------------------------
260
261sortVector :: (Ord t, Element t) => Vector t -> Vector t 220sortVector :: (Ord t, Element t) => Vector t -> Vector t
262sortVector = sortV 221sortVector = sortV
263 222