diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-03-16 08:47:46 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-03-16 08:47:46 +0100 |
commit | c8bf3420beba4d3ec6c024a7a068166f8b5a064f (patch) | |
tree | bacf418fa4b25306c53c5b3beca99f3fffc2e013 /packages/base/src | |
parent | 5a6bf1299d3bdad5289f559192d60fdaf33893e7 (diff) | |
parent | c1081dc0641de9ef9fe37a45ae14452dcb8c0722 (diff) |
Merge branch 'master' of github.com:albertoruiz/hmatrix
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/C/vector-aux.c | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/Internal/Numeric.hs | 2 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 7 |
3 files changed, 7 insertions, 3 deletions
diff --git a/packages/base/src/C/vector-aux.c b/packages/base/src/C/vector-aux.c index dda47cb..599f69e 100644 --- a/packages/base/src/C/vector-aux.c +++ b/packages/base/src/C/vector-aux.c | |||
@@ -13,6 +13,7 @@ typedef float complex TCF; | |||
13 | #include <math.h> | 13 | #include <math.h> |
14 | #include <stdio.h> | 14 | #include <stdio.h> |
15 | #include <stdlib.h> | 15 | #include <stdlib.h> |
16 | #include <stdint.h> | ||
16 | 17 | ||
17 | #define MACRO(B) do {B} while (0) | 18 | #define MACRO(B) do {B} while (0) |
18 | #define ERROR(CODE) MACRO(return CODE;) | 19 | #define ERROR(CODE) MACRO(return CODE;) |
diff --git a/packages/base/src/Data/Packed/Internal/Numeric.hs b/packages/base/src/Data/Packed/Internal/Numeric.hs index 9adc023..257ad73 100644 --- a/packages/base/src/Data/Packed/Internal/Numeric.hs +++ b/packages/base/src/Data/Packed/Internal/Numeric.hs | |||
@@ -241,7 +241,7 @@ instance Container Vector (Complex Float) | |||
241 | 241 | ||
242 | --------------------------------------------------------------- | 242 | --------------------------------------------------------------- |
243 | 243 | ||
244 | instance (Container Vector a) => Container Matrix a | 244 | instance (Fractional a, Element a, Container Vector a) => Container Matrix a |
245 | where | 245 | where |
246 | size' = size | 246 | size' = size |
247 | scale' x = liftMatrix (scale' x) | 247 | scale' x = liftMatrix (scale' x) |
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 037396d..3398e6a 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -52,7 +52,7 @@ module Numeric.LinearAlgebra.Static( | |||
52 | linSolve, (<\>), | 52 | linSolve, (<\>), |
53 | -- * Factorizations | 53 | -- * Factorizations |
54 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), | 54 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), |
55 | withNullspace, qr, | 55 | withNullspace, qr, chol, |
56 | -- * Misc | 56 | -- * Misc |
57 | mean, | 57 | mean, |
58 | Disp(..), Domain(..), | 58 | Disp(..), Domain(..), |
@@ -68,7 +68,7 @@ import Numeric.LinearAlgebra.HMatrix hiding ( | |||
68 | row,col,vector,matrix,linspace,toRows,toColumns, | 68 | row,col,vector,matrix,linspace,toRows,toColumns, |
69 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', | 69 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', |
70 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, | 70 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, |
71 | qr,size,app,mul,dot) | 71 | qr,size,app,mul,dot,chol) |
72 | import qualified Numeric.LinearAlgebra.HMatrix as LA | 72 | import qualified Numeric.LinearAlgebra.HMatrix as LA |
73 | import Data.Proxy(Proxy) | 73 | import Data.Proxy(Proxy) |
74 | import Numeric.LinearAlgebra.Static.Internal | 74 | import Numeric.LinearAlgebra.Static.Internal |
@@ -306,6 +306,9 @@ instance KnownNat n => Eigen (Sq n) (C n) (M n n) | |||
306 | where | 306 | where |
307 | (l,v) = LA.eig m | 307 | (l,v) = LA.eig m |
308 | 308 | ||
309 | chol :: KnownNat n => Sym n -> Sq n | ||
310 | chol (extract . unSym -> m) = mkL $ LA.cholSH m | ||
311 | |||
309 | -------------------------------------------------------------------------------- | 312 | -------------------------------------------------------------------------------- |
310 | 313 | ||
311 | withNullspace | 314 | withNullspace |