diff options
Diffstat (limited to 'packages/base/src/Numeric')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/HMatrix.hs | 18 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 10 |
2 files changed, 18 insertions, 10 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs b/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs index 54ddd68..d2cae6c 100644 --- a/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs +++ b/packages/base/src/Numeric/LinearAlgebra/HMatrix.hs | |||
@@ -45,12 +45,12 @@ module Numeric.LinearAlgebra.HMatrix ( | |||
45 | 45 | ||
46 | -- * Products | 46 | -- * Products |
47 | -- ** dot | 47 | -- ** dot |
48 | (<·>), | 48 | dot, (<·>), |
49 | -- ** matrix-vector | 49 | -- ** matrix-vector |
50 | (#>), (!#>), | 50 | app, (#>), (!#>), |
51 | -- ** matrix-matrix | 51 | -- ** matrix-matrix |
52 | (<>), | 52 | mul, (<>), |
53 | -- | The matrix x matrix product is also implemented in the "Data.Monoid" instance, where | 53 | -- | The matrix product is also implemented in the "Data.Monoid" instance, where |
54 | -- single-element matrices (created from numeric literals or using 'scalar') | 54 | -- single-element matrices (created from numeric literals or using 'scalar') |
55 | -- are used for scaling. | 55 | -- are used for scaling. |
56 | -- | 56 | -- |
@@ -96,7 +96,6 @@ module Numeric.LinearAlgebra.HMatrix ( | |||
96 | 96 | ||
97 | -- * SVD | 97 | -- * SVD |
98 | svd, | 98 | svd, |
99 | fullSVD, | ||
100 | thinSVD, | 99 | thinSVD, |
101 | compactSVD, | 100 | compactSVD, |
102 | singularValues, | 101 | singularValues, |
@@ -153,7 +152,7 @@ import Numeric.LinearAlgebra.Data | |||
153 | 152 | ||
154 | import Numeric.Matrix() | 153 | import Numeric.Matrix() |
155 | import Numeric.Vector() | 154 | import Numeric.Vector() |
156 | import Data.Packed.Numeric hiding ((<>)) | 155 | import Data.Packed.Numeric hiding ((<>), mul) |
157 | import Numeric.LinearAlgebra.Algorithms hiding (linearSolve,Normed,orth) | 156 | import Numeric.LinearAlgebra.Algorithms hiding (linearSolve,Normed,orth) |
158 | import qualified Numeric.LinearAlgebra.Algorithms as A | 157 | import qualified Numeric.LinearAlgebra.Algorithms as A |
159 | import Numeric.LinearAlgebra.Util | 158 | import Numeric.LinearAlgebra.Util |
@@ -161,7 +160,7 @@ import Numeric.LinearAlgebra.Random | |||
161 | import Numeric.Sparse((!#>)) | 160 | import Numeric.Sparse((!#>)) |
162 | import Numeric.LinearAlgebra.Util.CG | 161 | import Numeric.LinearAlgebra.Util.CG |
163 | 162 | ||
164 | {- | dense matrix product | 163 | {- | infix synonym of 'mul' |
165 | 164 | ||
166 | >>> let a = (3><5) [1..] | 165 | >>> let a = (3><5) [1..] |
167 | >>> a | 166 | >>> a |
@@ -190,6 +189,11 @@ import Numeric.LinearAlgebra.Util.CG | |||
190 | (<>) = mXm | 189 | (<>) = mXm |
191 | infixr 8 <> | 190 | infixr 8 <> |
192 | 191 | ||
192 | -- | dense matrix product | ||
193 | mul :: Numeric t => Matrix t -> Matrix t -> Matrix t | ||
194 | mul = mXm | ||
195 | |||
196 | |||
193 | -- | Solve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use 'linearSolveLS' or 'linearSolveSVD'. | 197 | -- | Solve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use 'linearSolveLS' or 'linearSolveSVD'. |
194 | linearSolve m b = A.mbLinearSolve m b | 198 | linearSolve m b = A.mbLinearSolve m b |
195 | 199 | ||
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 213c42c..cbcd4e2 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -25,6 +25,8 @@ Stability : experimental | |||
25 | 25 | ||
26 | Experimental interface with statically checked dimensions. | 26 | Experimental interface with statically checked dimensions. |
27 | 27 | ||
28 | This module is under active development and the interface is subject to changes. | ||
29 | |||
28 | -} | 30 | -} |
29 | 31 | ||
30 | module Numeric.LinearAlgebra.Static( | 32 | module Numeric.LinearAlgebra.Static( |
@@ -62,9 +64,11 @@ module Numeric.LinearAlgebra.Static( | |||
62 | 64 | ||
63 | import GHC.TypeLits | 65 | import GHC.TypeLits |
64 | import Numeric.LinearAlgebra.HMatrix hiding ( | 66 | import Numeric.LinearAlgebra.HMatrix hiding ( |
65 | (<>),(#>),(<·>),Konst(..),diag, disp,(¦),(——),row,col,vector,matrix,linspace,toRows,toColumns, | 67 | (<>),(#>),(<·>),Konst(..),diag, disp,(¦),(——), |
66 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH',eigenvalues,eigenvaluesSH,eigenvaluesSH',build, | 68 | row,col,vector,matrix,linspace,toRows,toColumns, |
67 | qr,size) | 69 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', |
70 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, | ||
71 | qr,size,app,mul,dot) | ||
68 | import qualified Numeric.LinearAlgebra.HMatrix as LA | 72 | import qualified Numeric.LinearAlgebra.HMatrix as LA |
69 | import Data.Proxy(Proxy) | 73 | import Data.Proxy(Proxy) |
70 | import Numeric.LinearAlgebra.Static.Internal | 74 | import Numeric.LinearAlgebra.Static.Internal |