diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-04-24 20:50:10 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-04-24 20:50:10 +0200 |
commit | cd3daf7e12fa2a8c775a1d6516049bbc7e44da32 (patch) | |
tree | ee2969b42838c13a282a4082dbb0f8c8c53af2a5 /lib/Numeric/Container.hs | |
parent | c2b3835a9a43d822d6134ef51a9ec9627a9e95c3 (diff) |
deprecate vjoin, dot and (<.>). Move (⋅) to Container
Diffstat (limited to 'lib/Numeric/Container.hs')
-rw-r--r-- | lib/Numeric/Container.hs | 20 |
1 files changed, 19 insertions, 1 deletions
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 ( | |||
38 | Product(..), | 38 | Product(..), |
39 | Contraction(..), | 39 | Contraction(..), |
40 | optimiseMult, | 40 | optimiseMult, |
41 | mXm,mXv,vXm,Mul(..),LSDiv(..), cdot, | 41 | mXm,mXv,vXm,Mul(..),LSDiv(..), cdot, (⋅), dot, (<.>), |
42 | outer, kronecker, | 42 | outer, kronecker, |
43 | -- * Random numbers | 43 | -- * Random numbers |
44 | RandDist(..), | 44 | RandDist(..), |
@@ -175,6 +175,13 @@ instance Container Matrix t => Contraction (Matrix t) t (Matrix t) where | |||
175 | 175 | ||
176 | -------------------------------------------------------------------------------- | 176 | -------------------------------------------------------------------------------- |
177 | 177 | ||
178 | -- | dot product (0x22C5): @u ⋅ v = 'cdot' u v@ | ||
179 | (⋅) :: (Container Vector t, Product t) => Vector t -> Vector t -> t | ||
180 | infixl 7 ⋅ | ||
181 | u ⋅ v = cdot u v | ||
182 | |||
183 | -------------------------------------------------------------------------------- | ||
184 | |||
178 | -- bidirectional type inference | 185 | -- bidirectional type inference |
179 | class Konst e d c | d -> c, c -> d | 186 | class Konst e d c | d -> c, c -> d |
180 | where | 187 | where |
@@ -200,3 +207,14 @@ instance Container Matrix e => Build (Int,Int) (e -> e -> e) Matrix e | |||
200 | where | 207 | where |
201 | build = build' | 208 | build = build' |
202 | 209 | ||
210 | -------------------------------------------------------------------------------- | ||
211 | |||
212 | {-# DEPRECATED dot "use udot" #-} | ||
213 | dot :: Product e => Vector e -> Vector e -> e | ||
214 | dot = udot | ||
215 | |||
216 | {-# DEPRECATED (<.>) "use udot or (×)" #-} | ||
217 | infixl 7 <.> | ||
218 | (<.>) :: Product e => Vector e -> Vector e -> e | ||
219 | (<.>) = udot | ||
220 | |||