diff options
Diffstat (limited to 'packages/base')
-rw-r--r-- | packages/base/THANKS.md | 15 | ||||
-rw-r--r-- | packages/base/hmatrix.cabal | 1 | ||||
-rw-r--r-- | packages/base/src/C/vector-aux.c | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/IO.hs | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/Internal/Numeric.hs | 2 | ||||
-rw-r--r-- | packages/base/src/Numeric/Chain.hs | 2 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 30 | ||||
-rw-r--r-- | packages/base/src/Numeric/Vectorized.hs | 1 |
8 files changed, 24 insertions, 29 deletions
diff --git a/packages/base/THANKS.md b/packages/base/THANKS.md index fdbbe14..a4188eb 100644 --- a/packages/base/THANKS.md +++ b/packages/base/THANKS.md | |||
@@ -92,7 +92,7 @@ module reorganization, monadic mapVectorM, and many other improvements. | |||
92 | 92 | ||
93 | - Carter Schonwald helped with the configuration for Homebrew OS X and | 93 | - Carter Schonwald helped with the configuration for Homebrew OS X and |
94 | found a tolerance problem in test "1E5 rots". He also discovered | 94 | found a tolerance problem in test "1E5 rots". He also discovered |
95 | a bug in the signature of cmap. | 95 | a bug in the signature of cmap and fixed the cabal file. |
96 | 96 | ||
97 | - Duncan Coutts reported a problem with configure.hs and contributed | 97 | - Duncan Coutts reported a problem with configure.hs and contributed |
98 | a solution and a simplified Setup.lhs. | 98 | a solution and a simplified Setup.lhs. |
@@ -159,7 +159,8 @@ module reorganization, monadic mapVectorM, and many other improvements. | |||
159 | 159 | ||
160 | - Denis Laxalde separated the gsl tests from the base ones. | 160 | - Denis Laxalde separated the gsl tests from the base ones. |
161 | 161 | ||
162 | - Dominic Steinitz (idontgetoutmuch) reported a bug in the static diagonal creation functions. | 162 | - Dominic Steinitz (idontgetoutmuch) reported a bug in the static diagonal creation functions and |
163 | added Cholesky to Static. | ||
163 | 164 | ||
164 | - Dylan Thurston reported an error in the glpk documentation and ambiguity in | 165 | - Dylan Thurston reported an error in the glpk documentation and ambiguity in |
165 | the description of linearSolve. | 166 | the description of linearSolve. |
@@ -179,3 +180,13 @@ module reorganization, monadic mapVectorM, and many other improvements. | |||
179 | 180 | ||
180 | - Kiwamu Ishikura improved randomVector for OSX | 181 | - Kiwamu Ishikura improved randomVector for OSX |
181 | 182 | ||
183 | - C.J. East fixed the examples for simplex. | ||
184 | |||
185 | - Ben Gamari contributed fixes for ghc 7.10 | ||
186 | |||
187 | - Piotr Mardziel added general sparse constraints to simplex and the interface to glp_exact | ||
188 | |||
189 | - Maxim Baz fixed an instance declaration for ghc 7.11 | ||
190 | |||
191 | - Thomas M. DuBuisson fixed a C include file. | ||
192 | |||
diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index f5384f3..350023f 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal | |||
@@ -35,6 +35,7 @@ extra-source-files: src/C/lapack-aux.h | |||
35 | flag openblas | 35 | flag openblas |
36 | description: Link with OpenBLAS (https://github.com/xianyi/OpenBLAS) optimized libraries. | 36 | description: Link with OpenBLAS (https://github.com/xianyi/OpenBLAS) optimized libraries. |
37 | default: False | 37 | default: False |
38 | manual: True | ||
38 | 39 | ||
39 | library | 40 | library |
40 | 41 | ||
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/IO.hs b/packages/base/src/Data/Packed/IO.hs index 85f1b37..b0999a8 100644 --- a/packages/base/src/Data/Packed/IO.hs +++ b/packages/base/src/Data/Packed/IO.hs | |||
@@ -22,7 +22,6 @@ import Text.Printf(printf) | |||
22 | import Data.List(intersperse) | 22 | import Data.List(intersperse) |
23 | import Data.Complex | 23 | import Data.Complex |
24 | import Numeric.Vectorized(vectorScan,saveMatrix) | 24 | import Numeric.Vectorized(vectorScan,saveMatrix) |
25 | import Control.Applicative((<$>)) | ||
26 | import Data.Packed.Internal | 25 | import Data.Packed.Internal |
27 | 26 | ||
28 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using | 27 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using |
diff --git a/packages/base/src/Data/Packed/Internal/Numeric.hs b/packages/base/src/Data/Packed/Internal/Numeric.hs index dc5724d..7a4dd29 100644 --- a/packages/base/src/Data/Packed/Internal/Numeric.hs +++ b/packages/base/src/Data/Packed/Internal/Numeric.hs | |||
@@ -240,7 +240,7 @@ instance Container Vector (Complex Float) | |||
240 | 240 | ||
241 | --------------------------------------------------------------- | 241 | --------------------------------------------------------------- |
242 | 242 | ||
243 | instance (Container Vector a) => Container Matrix a | 243 | instance (Fractional a, Element a, Container Vector a) => Container Matrix a |
244 | where | 244 | where |
245 | size' = size | 245 | size' = size |
246 | scale' x = liftMatrix (scale' x) | 246 | scale' x = liftMatrix (scale' x) |
diff --git a/packages/base/src/Numeric/Chain.hs b/packages/base/src/Numeric/Chain.hs index 55e2df6..64c09c0 100644 --- a/packages/base/src/Numeric/Chain.hs +++ b/packages/base/src/Numeric/Chain.hs | |||
@@ -14,6 +14,8 @@ | |||
14 | -- | 14 | -- |
15 | ----------------------------------------------------------------------------- | 15 | ----------------------------------------------------------------------------- |
16 | 16 | ||
17 | {-# LANGUAGE FlexibleContexts #-} | ||
18 | |||
17 | module Numeric.Chain ( | 19 | module Numeric.Chain ( |
18 | optimiseMult, | 20 | optimiseMult, |
19 | ) where | 21 | ) where |
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index a26cc4c..4c3186f 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -1,5 +1,3 @@ | |||
1 | #if __GLASGOW_HASKELL__ >= 708 | ||
2 | |||
3 | {-# LANGUAGE DataKinds #-} | 1 | {-# LANGUAGE DataKinds #-} |
4 | {-# LANGUAGE KindSignatures #-} | 2 | {-# LANGUAGE KindSignatures #-} |
5 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 3 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
@@ -51,7 +49,7 @@ module Numeric.LinearAlgebra.Static( | |||
51 | linSolve, (<\>), | 49 | linSolve, (<\>), |
52 | -- * Factorizations | 50 | -- * Factorizations |
53 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), | 51 | svd, withCompactSVD, svdTall, svdFlat, Eigen(..), |
54 | withNullspace, qr, | 52 | withNullspace, qr, chol, |
55 | -- * Misc | 53 | -- * Misc |
56 | mean, | 54 | mean, |
57 | Disp(..), Domain(..), | 55 | Disp(..), Domain(..), |
@@ -67,7 +65,7 @@ import Numeric.LinearAlgebra.HMatrix hiding ( | |||
67 | row,col,vector,matrix,linspace,toRows,toColumns, | 65 | row,col,vector,matrix,linspace,toRows,toColumns, |
68 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', | 66 | (<\>),fromList,takeDiag,svd,eig,eigSH,eigSH', |
69 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, | 67 | eigenvalues,eigenvaluesSH,eigenvaluesSH',build, |
70 | qr,size,app,mul,dot) | 68 | qr,size,app,mul,dot,chol) |
71 | import qualified Numeric.LinearAlgebra.HMatrix as LA | 69 | import qualified Numeric.LinearAlgebra.HMatrix as LA |
72 | import Data.Proxy(Proxy) | 70 | import Data.Proxy(Proxy) |
73 | import Numeric.LinearAlgebra.Static.Internal | 71 | import Numeric.LinearAlgebra.Static.Internal |
@@ -183,6 +181,7 @@ a ¦ b = tr (tr a —— tr b) | |||
183 | type Sq n = L n n | 181 | type Sq n = L n n |
184 | --type CSq n = CL n n | 182 | --type CSq n = CL n n |
185 | 183 | ||
184 | |||
186 | type GL = forall n m . (KnownNat n, KnownNat m) => L m n | 185 | type GL = forall n m . (KnownNat n, KnownNat m) => L m n |
187 | type GSq = forall n . KnownNat n => Sq n | 186 | type GSq = forall n . KnownNat n => Sq n |
188 | 187 | ||
@@ -305,6 +304,9 @@ instance KnownNat n => Eigen (Sq n) (C n) (M n n) | |||
305 | where | 304 | where |
306 | (l,v) = LA.eig m | 305 | (l,v) = LA.eig m |
307 | 306 | ||
307 | chol :: KnownNat n => Sym n -> Sq n | ||
308 | chol (extract . unSym -> m) = mkL $ LA.cholSH m | ||
309 | |||
308 | -------------------------------------------------------------------------------- | 310 | -------------------------------------------------------------------------------- |
309 | 311 | ||
310 | withNullspace | 312 | withNullspace |
@@ -614,23 +616,3 @@ instance (KnownNat n', KnownNat m') => Testable (L n' m') | |||
614 | where | 616 | where |
615 | checkT _ = test | 617 | checkT _ = test |
616 | 618 | ||
617 | #else | ||
618 | |||
619 | {- | | ||
620 | Module : Numeric.LinearAlgebra.Static | ||
621 | Copyright : (c) Alberto Ruiz 2014 | ||
622 | License : BSD3 | ||
623 | Stability : experimental | ||
624 | |||
625 | Experimental interface with statically checked dimensions. | ||
626 | |||
627 | This module requires GHC >= 7.8 | ||
628 | |||
629 | -} | ||
630 | |||
631 | module Numeric.LinearAlgebra.Static | ||
632 | {-# WARNING "This module requires GHC >= 7.8" #-} | ||
633 | where | ||
634 | |||
635 | #endif | ||
636 | |||
diff --git a/packages/base/src/Numeric/Vectorized.hs b/packages/base/src/Numeric/Vectorized.hs index 6f0d240..405ae01 100644 --- a/packages/base/src/Numeric/Vectorized.hs +++ b/packages/base/src/Numeric/Vectorized.hs | |||
@@ -37,7 +37,6 @@ import Foreign.C.String | |||
37 | import System.IO.Unsafe(unsafePerformIO) | 37 | import System.IO.Unsafe(unsafePerformIO) |
38 | 38 | ||
39 | import Control.Monad(when) | 39 | import Control.Monad(when) |
40 | import Control.Applicative((<$>)) | ||
41 | 40 | ||
42 | 41 | ||
43 | 42 | ||