From cd3daf7e12fa2a8c775a1d6516049bbc7e44da32 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 24 Apr 2014 20:50:10 +0200 Subject: deprecate vjoin, dot and (<.>). Move (⋅) to Container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Numeric/Container.hs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/Numeric/Container.hs') diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs index 46c2903..aac8c10 100644 --- a/lib/Numeric/Container.hs +++ b/lib/Numeric/Container.hs @@ -38,7 +38,7 @@ module Numeric.Container ( Product(..), Contraction(..), optimiseMult, - mXm,mXv,vXm,Mul(..),LSDiv(..), cdot, + mXm,mXv,vXm,Mul(..),LSDiv(..), cdot, (⋅), dot, (<.>), outer, kronecker, -- * Random numbers RandDist(..), @@ -175,6 +175,13 @@ instance Container Matrix t => Contraction (Matrix t) t (Matrix t) where -------------------------------------------------------------------------------- +-- | dot product (0x22C5): @u ⋅ v = 'cdot' u v@ +(⋅) :: (Container Vector t, Product t) => Vector t -> Vector t -> t +infixl 7 ⋅ +u ⋅ v = cdot u v + +-------------------------------------------------------------------------------- + -- bidirectional type inference class Konst e d c | d -> c, c -> d where @@ -200,3 +207,14 @@ instance Container Matrix e => Build (Int,Int) (e -> e -> e) Matrix e where build = build' +-------------------------------------------------------------------------------- + +{-# DEPRECATED dot "use udot" #-} +dot :: Product e => Vector e -> Vector e -> e +dot = udot + +{-# DEPRECATED (<.>) "use udot or (×)" #-} +infixl 7 <.> +(<.>) :: Product e => Vector e -> Vector e -> e +(<.>) = udot + -- cgit v1.2.3