diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Util.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Numeric/LinearAlgebra/Util.hs b/lib/Numeric/LinearAlgebra/Util.hs index 2c77d3a..b38aeb2 100644 --- a/lib/Numeric/LinearAlgebra/Util.hs +++ b/lib/Numeric/LinearAlgebra/Util.hs | |||
@@ -23,7 +23,6 @@ module Numeric.LinearAlgebra.Util( | |||
23 | (?), (¿), | 23 | (?), (¿), |
24 | rand, randn, | 24 | rand, randn, |
25 | cross, | 25 | cross, |
26 | (⋅), | ||
27 | norm, | 26 | norm, |
28 | unitary, | 27 | unitary, |
29 | mt, | 28 | mt, |
@@ -86,7 +85,15 @@ rand = randm Uniform | |||
86 | randn :: Int -> Int -> IO (Matrix Double) | 85 | randn :: Int -> Int -> IO (Matrix Double) |
87 | randn = randm Gaussian | 86 | randn = randm Gaussian |
88 | 87 | ||
89 | -- | create a real diagonal matrix from a list | 88 | {- | create a real diagonal matrix from a list |
89 | |||
90 | >>> diagl [1,2,3] | ||
91 | (3><3) | ||
92 | [ 1.0, 0.0, 0.0 | ||
93 | , 0.0, 2.0, 0.0 | ||
94 | , 0.0, 0.0, 3.0 ] | ||
95 | |||
96 | -} | ||
90 | diagl :: [Double] -> Matrix Double | 97 | diagl :: [Double] -> Matrix Double |
91 | diagl = diag . fromList | 98 | diagl = diag . fromList |
92 | 99 | ||
@@ -164,11 +171,6 @@ size m = (rows m, cols m) | |||
164 | mt :: Matrix Double -> Matrix Double | 171 | mt :: Matrix Double -> Matrix Double |
165 | mt = trans . inv | 172 | mt = trans . inv |
166 | 173 | ||
167 | -- | dot product (0x22C5): @u ⋅ v = 'cdot' u v@ | ||
168 | (⋅) :: (Container Vector t, Product t) => Vector t -> Vector t -> t | ||
169 | infixl 7 ⋅ | ||
170 | u ⋅ v = cdot u v | ||
171 | |||
172 | ---------------------------------------------------------------------- | 174 | ---------------------------------------------------------------------- |
173 | 175 | ||
174 | -- | Matrix of pairwise squared distances of row vectors | 176 | -- | Matrix of pairwise squared distances of row vectors |