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.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs
index 71869cb..67921d8 100644
--- a/lib/Numeric/LinearAlgebra/Linear.hs
+++ b/lib/Numeric/LinearAlgebra/Linear.hs
@@ -21,7 +21,7 @@ module Numeric.LinearAlgebra.Linear (
21 Linear(..), 21 Linear(..),
22 -- * Products 22 -- * Products
23 Prod(..), 23 Prod(..),
24 mXm,mXv,vXm, mulH, 24 mXm,mXv,vXm,
25 outer, kronecker, 25 outer, kronecker,
26 -- * Creation of numeric vectors 26 -- * Creation of numeric vectors
27 constant, linspace 27 constant, linspace
@@ -90,7 +90,7 @@ instance Vectors Vector (Complex Double) where
90---------------------------------------------------- 90----------------------------------------------------
91 91
92-- | Basic element-by-element functions. 92-- | Basic element-by-element functions.
93class (Element e, AutoReal e, Container c) => Linear c e where 93class (Element e, Container c) => Linear c e where
94 -- | create a structure with a single element 94 -- | create a structure with a single element
95 scalar :: e -> c e 95 scalar :: e -> c e
96 scale :: e -> c e -> c e 96 scale :: e -> c e -> c e
@@ -190,13 +190,8 @@ linspace n (a,b) = addConstant a $ scale s $ fromList [0 .. fromIntegral n-1]
190 190
191---------------------------------------------------- 191----------------------------------------------------
192 192
193-- reference multiply
194mulH a b = fromLists [[ doth ai bj | bj <- toColumns b] | ai <- toRows a ]
195 where doth u v = sum $ zipWith (*) (toList u) (toList v)
196
197class Element t => Prod t where 193class Element t => Prod t where
198 multiply :: Matrix t -> Matrix t -> Matrix t 194 multiply :: Matrix t -> Matrix t -> Matrix t
199 multiply = mulH
200 ctrans :: Matrix t -> Matrix t 195 ctrans :: Matrix t -> Matrix t
201 196
202instance Prod Double where 197instance Prod Double where