summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Linear.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Linear.hs')
-rw-r--r--lib/Numeric/LinearAlgebra/Linear.hs15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs
index a39df50..0ddbb55 100644
--- a/lib/Numeric/LinearAlgebra/Linear.hs
+++ b/lib/Numeric/LinearAlgebra/Linear.hs
@@ -1,4 +1,4 @@
1{-# OPTIONS_GHC -fglasgow-exts #-} 1{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
2----------------------------------------------------------------------------- 2-----------------------------------------------------------------------------
3{- | 3{- |
4Module : Numeric.LinearAlgebra.Linear 4Module : Numeric.LinearAlgebra.Linear
@@ -60,18 +60,7 @@ instance Linear Vector (Complex Double) where
60 divide = vectorZipC Div 60 divide = vectorZipC Div
61 equal u v = dim u == dim v && vectorMax (liftVector magnitude (sub u v)) == 0.0 61 equal u v = dim u == dim v && vectorMax (liftVector magnitude (sub u v)) == 0.0
62 62
63instance Linear Matrix Double where 63instance (Linear Vector a, Container Matrix a) => (Linear Matrix a) where
64 scale x = liftMatrix (scale x)
65 scaleRecip x = liftMatrix (scaleRecip x)
66 addConstant x = liftMatrix (addConstant x)
67 add = liftMatrix2 add
68 sub = liftMatrix2 sub
69 mul = liftMatrix2 mul
70 divide = liftMatrix2 divide
71 equal a b = cols a == cols b && flatten a `equal` flatten b
72
73
74instance Linear Matrix (Complex Double) where
75 scale x = liftMatrix (scale x) 64 scale x = liftMatrix (scale x)
76 scaleRecip x = liftMatrix (scaleRecip x) 65 scaleRecip x = liftMatrix (scaleRecip x)
77 addConstant x = liftMatrix (addConstant x) 66 addConstant x = liftMatrix (addConstant x)