summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Linear.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-12 10:01:39 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-12 10:01:39 +0000
commitc41d21fefa04c66039a0b218daaa53c2577ef838 (patch)
tree3dd182457a89edbf52688fb43fdc8b2a130829e8 /lib/Numeric/LinearAlgebra/Linear.hs
parent9e6500bf8e925b363e74e01834f81dde0810f808 (diff)
data structures simplification
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