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.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs
index 13d69ab..3403591 100644
--- a/lib/Numeric/LinearAlgebra/Linear.hs
+++ b/lib/Numeric/LinearAlgebra/Linear.hs
@@ -20,7 +20,7 @@ module Numeric.LinearAlgebra.Linear (
20) where 20) where
21 21
22 22
23import Data.Packed.Internal 23import Data.Packed.Internal(multiply,at,partit)
24import Data.Packed 24import Data.Packed
25import Numeric.GSL.Vector 25import Numeric.GSL.Vector
26import Complex 26import Complex
@@ -68,7 +68,7 @@ instance Linear Matrix Double where
68 sub = liftMatrix2 sub 68 sub = liftMatrix2 sub
69 mul = liftMatrix2 mul 69 mul = liftMatrix2 mul
70 divide = liftMatrix2 divide 70 divide = liftMatrix2 divide
71 equal a b = cols a == cols b && cdat a `equal` cdat b 71 equal a b = cols a == cols b && flatten a `equal` flatten b
72 72
73 73
74instance Linear Matrix (Complex Double) where 74instance Linear Matrix (Complex Double) where
@@ -79,13 +79,13 @@ instance Linear Matrix (Complex Double) where
79 sub = liftMatrix2 sub 79 sub = liftMatrix2 sub
80 mul = liftMatrix2 mul 80 mul = liftMatrix2 mul
81 divide = liftMatrix2 divide 81 divide = liftMatrix2 divide
82 equal a b = cols a == cols b && cdat a `equal` cdat b 82 equal a b = cols a == cols b && flatten a `equal` flatten b
83 83
84-------------------------------------------------- 84--------------------------------------------------
85 85
86-- | euclidean inner product 86-- | euclidean inner product
87dot :: (Element t) => Vector t -> Vector t -> t 87dot :: (Element t) => Vector t -> Vector t -> t
88dot u v = dat (multiply r c) `at` 0 88dot u v = multiply r c @@> (0,0)
89 where r = asRow u 89 where r = asRow u
90 c = asColumn v 90 c = asColumn v
91 91