summaryrefslogtreecommitdiff
path: root/examples/multiply.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multiply.hs')
-rw-r--r--examples/multiply.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/multiply.hs b/examples/multiply.hs
index d7c74ee..fbfb9d7 100644
--- a/examples/multiply.hs
+++ b/examples/multiply.hs
@@ -6,7 +6,7 @@
6-- , OverlappingInstances 6-- , OverlappingInstances
7 , UndecidableInstances #-} 7 , UndecidableInstances #-}
8 8
9import Numeric.LinearAlgebra 9import Numeric.LinearAlgebra hiding (Contraction(..))
10 10
11class Scaling a b c | a b -> c where 11class Scaling a b c | a b -> c where
12 -- ^ 0x22C5 8901 DOT OPERATOR, scaling 12 -- ^ 0x22C5 8901 DOT OPERATOR, scaling
@@ -43,7 +43,7 @@ instance Container Vector t => Scaling (Matrix t) t (Matrix t) where
43 43
44 44
45instance Product t => Contraction (Vector t) (Vector t) t where 45instance Product t => Contraction (Vector t) (Vector t) t where
46 (×) = dot 46 (×) = udot
47 47
48instance Product t => Contraction (Matrix t) (Vector t) (Vector t) where 48instance Product t => Contraction (Matrix t) (Vector t) (Vector t) where
49 (×) = mXv 49 (×) = mXv
@@ -90,9 +90,9 @@ c = v ⊗ m ⊗ v ⊗ m
90d = s ⋅ (3 |> [10,20..] :: Vector Double) 90d = s ⋅ (3 |> [10,20..] :: Vector Double)
91 91
92main = do 92main = do
93 print $ scale s v <> m <.> v 93 print $ (scale s v <> m) `udot` v
94 print $ scale s v <.> (m <> v) 94 print $ scale s v `udot` (m <> v)
95 print $ s * (v <> m <.> v) 95 print $ s * ((v <> m) `udot` v)
96 print $ s ⋅ v × m × v 96 print $ s ⋅ v × m × v
97 print a 97 print a
98 print (b == c) 98 print (b == c)