summaryrefslogtreecommitdiff
path: root/packages/base/src/Numeric/LinearAlgebra.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Numeric/LinearAlgebra.hs')
-rw-r--r--packages/base/src/Numeric/LinearAlgebra.hs141
1 files changed, 141 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra.hs b/packages/base/src/Numeric/LinearAlgebra.hs
new file mode 100644
index 0000000..96bf29f
--- /dev/null
+++ b/packages/base/src/Numeric/LinearAlgebra.hs
@@ -0,0 +1,141 @@
1-----------------------------------------------------------------------------
2{- |
3Module : Numeric.LinearAlgebra
4Copyright : (c) Alberto Ruiz 2006-14
5License : BSD3
6Maintainer : Alberto Ruiz
7Stability : provisional
8
9-}
10-----------------------------------------------------------------------------
11module Numeric.LinearAlgebra (
12
13 -- * Basic types and data processing
14 module Numeric.LinearAlgebra.Data,
15
16 -- | The standard numeric classes are defined elementwise:
17 --
18 -- >>> fromList [1,2,3] * fromList [3,0,-2 :: Double]
19 -- fromList [3.0,0.0,-6.0]
20 --
21 -- >>> (3><3) [1..9] * ident 3 :: Matrix Double
22 -- (3><3)
23 -- [ 1.0, 0.0, 0.0
24 -- , 0.0, 5.0, 0.0
25 -- , 0.0, 0.0, 9.0 ]
26 --
27 -- In arithmetic operations single-element vectors and matrices
28 -- (created from numeric literals or using 'scalar') automatically
29 -- expand to match the dimensions of the other operand:
30 --
31 -- >>> 5 + 2*ident 3 :: Matrix Double
32 -- (3><3)
33 -- [ 7.0, 5.0, 5.0
34 -- , 5.0, 7.0, 5.0
35 -- , 5.0, 5.0, 7.0 ]
36 --
37
38 -- * Matrix product
39 (<.>),
40
41 -- | This operator can also be written using the unicode symbol ◇ (25c7).
42 --
43
44 -- | The matrix x matrix product is also implemented in the "Data.Monoid" instance, where
45 -- single-element matrices (created from numeric literals or using 'scalar')
46 -- are used for scaling.
47 --
48 -- >>> let m = (2><3)[1..] :: Matrix Double
49 -- >>> m <> 2 <> diagl[0.5,1,0]
50 -- (2><3)
51 -- [ 1.0, 4.0, 0.0
52 -- , 4.0, 10.0, 0.0 ]
53 --
54 -- 'mconcat' uses 'optimiseMult' to get the optimal association order.
55
56 -- * Other products
57 outer, kronecker, cross,
58 scale,
59 sumElements, prodElements, absSum,
60
61 -- * Linear Systems
62 (<\>),
63 linearSolve,
64 linearSolveLS,
65 linearSolveSVD,
66 luSolve,
67 cholSolve,
68
69 -- * Inverse and pseudoinverse
70 inv, pinv, pinvTol,
71
72 -- * Determinant and rank
73 rcond, rank, ranksv,
74 det, invlndet,
75
76 -- * Singular value decomposition
77 svd,
78 fullSVD,
79 thinSVD,
80 compactSVD,
81 singularValues,
82 leftSV, rightSV,
83
84 -- * Eigensystems
85 eig, eigSH, eigSH',
86 eigenvalues, eigenvaluesSH, eigenvaluesSH',
87 geigSH',
88
89 -- * QR
90 qr, rq, qrRaw, qrgr,
91
92 -- * Cholesky
93 chol, cholSH, mbCholSH,
94
95 -- * Hessenberg
96 hess,
97
98 -- * Schur
99 schur,
100
101 -- * LU
102 lu, luPacked,
103
104 -- * Matrix functions
105 expm,
106 sqrtm,
107 matFunc,
108
109 -- * Nullspace
110 nullspacePrec,
111 nullVector,
112 nullspaceSVD,
113 null1, null1sym,
114
115 orth,
116
117 -- * Norms
118 norm1, norm2, normInf, pnorm, NormType(..),
119
120 -- * Correlation and convolution
121 corr, conv, corrMin, corr2, conv2,
122
123 -- * Random arrays
124
125 RandDist(..), randomVector, rand, randn, gaussianSample, uniformSample,
126
127 -- * Misc
128 meanCov, peps, relativeError, haussholder, optimiseMult, udot, Seed, (◇)
129) where
130
131import Numeric.LinearAlgebra.Data
132
133import Numeric.Matrix()
134import Numeric.Vector()
135import Numeric.Container
136import Numeric.LinearAlgebra.Algorithms
137import Numeric.LinearAlgebra.Util
138import Numeric.LinearAlgebra.Random
139
140
141