From 6fbed842525491e280448a00a4b5426e6830ccaa Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 24 Apr 2014 10:30:01 +0200 Subject: cdot and (×) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added cdot dot renamed to udot <.> changed to cdot and moved to Numeric.LinearAlgebra.Util new general contraction operator (×) Plot functions moved to Numeric.LinearAlgebra.Util --- examples/multiply.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') 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 @@ -- , OverlappingInstances , UndecidableInstances #-} -import Numeric.LinearAlgebra +import Numeric.LinearAlgebra hiding (Contraction(..)) class Scaling a b c | a b -> c where -- ^ 0x22C5 8901 DOT OPERATOR, scaling @@ -43,7 +43,7 @@ instance Container Vector t => Scaling (Matrix t) t (Matrix t) where instance Product t => Contraction (Vector t) (Vector t) t where - (×) = dot + (×) = udot instance Product t => Contraction (Matrix t) (Vector t) (Vector t) where (×) = mXv @@ -90,9 +90,9 @@ c = v ⊗ m ⊗ v ⊗ m d = s ⋅ (3 |> [10,20..] :: Vector Double) main = do - print $ scale s v <> m <.> v - print $ scale s v <.> (m <> v) - print $ s * (v <> m <.> v) + print $ (scale s v <> m) `udot` v + print $ scale s v `udot` (m <> v) + print $ s * ((v <> m) `udot` v) print $ s ⋅ v × m × v print a print (b == c) -- cgit v1.2.3