diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-10-01 15:04:16 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-10-01 15:04:16 +0000 |
commit | c99b8fd6e3f8a2fb365ec12baf838f864b118ece (patch) | |
tree | 11b5b8515861fe88d547253ae10c2182d5fadaf2 /examples | |
parent | 768f08d4134a066d773d56a9c03ae688e3850352 (diff) |
LinearAlgebra and GSL moved to Numeric
Diffstat (limited to 'examples')
-rw-r--r-- | examples/deriv.hs | 2 | ||||
-rw-r--r-- | examples/error.hs | 2 | ||||
-rw-r--r-- | examples/integrate.hs | 2 | ||||
-rw-r--r-- | examples/kalman.hs | 5 | ||||
-rw-r--r-- | examples/listlike.hs | 2 | ||||
-rw-r--r-- | examples/minimize.hs | 4 | ||||
-rw-r--r-- | examples/pca1.hs | 4 | ||||
-rw-r--r-- | examples/pca2.hs | 4 | ||||
-rw-r--r-- | examples/pinv1.hs | 2 | ||||
-rw-r--r-- | examples/pinv2.hs | 2 | ||||
-rw-r--r-- | examples/plot.hs | 4 | ||||
-rw-r--r-- | examples/tests.hs | 10 |
12 files changed, 20 insertions, 23 deletions
diff --git a/examples/deriv.hs b/examples/deriv.hs index 472a284..c9456d1 100644 --- a/examples/deriv.hs +++ b/examples/deriv.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | -- Numerical differentiation | 1 | -- Numerical differentiation |
2 | 2 | ||
3 | import GSL | 3 | import Numeric.GSL |
4 | 4 | ||
5 | d :: (Double -> Double) -> (Double -> Double) | 5 | d :: (Double -> Double) -> (Double -> Double) |
6 | d f x = fst $ derivCentral 0.01 f x | 6 | d f x = fst $ derivCentral 0.01 f x |
diff --git a/examples/error.hs b/examples/error.hs index bcfe224..16305dc 100644 --- a/examples/error.hs +++ b/examples/error.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | import GSL | 1 | import Numeric.GSL |
2 | import Prelude hiding (catch) | 2 | import Prelude hiding (catch) |
3 | import Control.Exception | 3 | import Control.Exception |
4 | 4 | ||
diff --git a/examples/integrate.hs b/examples/integrate.hs index 6da88ad..10f0269 100644 --- a/examples/integrate.hs +++ b/examples/integrate.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- Numerical integration | 1 | -- Numerical integration |
2 | import GSL | 2 | import Numeric.GSL |
3 | 3 | ||
4 | quad f a b = fst $ integrateQAGS 1E-9 100 f a b | 4 | quad f a b = fst $ integrateQAGS 1E-9 100 f a b |
5 | 5 | ||
diff --git a/examples/kalman.hs b/examples/kalman.hs index ccb8083..e191cbb 100644 --- a/examples/kalman.hs +++ b/examples/kalman.hs | |||
@@ -1,8 +1,5 @@ | |||
1 | import LinearAlgebra | 1 | import Numeric.LinearAlgebra |
2 | import Graphics.Plot | 2 | import Graphics.Plot |
3 | import LinearAlgebra.Instances | ||
4 | |||
5 | --import GSLHaskell | ||
6 | 3 | ||
7 | vector l = fromList l :: Vector Double | 4 | vector l = fromList l :: Vector Double |
8 | matrix ls = fromLists ls :: Matrix Double | 5 | matrix ls = fromLists ls :: Matrix Double |
diff --git a/examples/listlike.hs b/examples/listlike.hs index 6c54f17..43216cb 100644 --- a/examples/listlike.hs +++ b/examples/listlike.hs | |||
@@ -1,7 +1,7 @@ | |||
1 | {-# OPTIONS_GHC -fglasgow-exts #-} | 1 | {-# OPTIONS_GHC -fglasgow-exts #-} |
2 | 2 | ||
3 | import qualified Data.ListLike as LL | 3 | import qualified Data.ListLike as LL |
4 | import LinearAlgebra | 4 | import Numeric.LinearAlgebra |
5 | import Data.Monoid | 5 | import Data.Monoid |
6 | import Data.Packed.Internal.Vector | 6 | import Data.Packed.Internal.Vector |
7 | import Foreign | 7 | import Foreign |
diff --git a/examples/minimize.hs b/examples/minimize.hs index 0429a24..d7bc350 100644 --- a/examples/minimize.hs +++ b/examples/minimize.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | -- the multidimensional minimization example in the GSL manual | 1 | -- the multidimensional minimization example in the GSL manual |
2 | import GSL | 2 | import Numeric.GSL |
3 | import LinearAlgebra | 3 | import Numeric.LinearAlgebra |
4 | import Graphics.Plot | 4 | import Graphics.Plot |
5 | 5 | ||
6 | -- the function to be minimized | 6 | -- the function to be minimized |
diff --git a/examples/pca1.hs b/examples/pca1.hs index 2c5074d..4ad8720 100644 --- a/examples/pca1.hs +++ b/examples/pca1.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | -- Principal component analysis | 1 | -- Principal component analysis |
2 | 2 | ||
3 | import LinearAlgebra | 3 | import Numeric.LinearAlgebra |
4 | import System.Directory(doesFileExist) | 4 | import System.Directory(doesFileExist) |
5 | import System(system) | 5 | import System(system) |
6 | import Control.Monad(when) | 6 | import Control.Monad(when) |
@@ -26,7 +26,7 @@ pca n dataSet = (encode,decode) | |||
26 | decode x = x <> vp + m | 26 | decode x = x <> vp + m |
27 | m = mean dataSet | 27 | m = mean dataSet |
28 | c = cov dataSet | 28 | c = cov dataSet |
29 | (_,v) = eigS c | 29 | (_,v) = eigSH c |
30 | vp = takeRows n (trans v) | 30 | vp = takeRows n (trans v) |
31 | 31 | ||
32 | main = do | 32 | main = do |
diff --git a/examples/pca2.hs b/examples/pca2.hs index bd498e4..8c20370 100644 --- a/examples/pca2.hs +++ b/examples/pca2.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | -- Improved PCA, including illustrative graphics | 1 | -- Improved PCA, including illustrative graphics |
2 | 2 | ||
3 | import LinearAlgebra | 3 | import Numeric.LinearAlgebra |
4 | import Graphics.Plot | 4 | import Graphics.Plot |
5 | import System.Directory(doesFileExist) | 5 | import System.Directory(doesFileExist) |
6 | import System(system) | 6 | import System(system) |
@@ -24,7 +24,7 @@ type Stat = (Vec, [Double], Mat) | |||
24 | stat :: Mat -> Stat | 24 | stat :: Mat -> Stat |
25 | stat x = (m, toList s, trans v) where | 25 | stat x = (m, toList s, trans v) where |
26 | m = mean x | 26 | m = mean x |
27 | (s,v) = eigS (cov x) | 27 | (s,v) = eigSH' (cov x) |
28 | 28 | ||
29 | -- creates the compression and decompression functions from the desired reconstruction | 29 | -- creates the compression and decompression functions from the desired reconstruction |
30 | -- quality and the statistics of a data set | 30 | -- quality and the statistics of a data set |
diff --git a/examples/pinv1.hs b/examples/pinv1.hs index 76fa0a9..301eac8 100644 --- a/examples/pinv1.hs +++ b/examples/pinv1.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- initial check for the polynomial model example | 1 | -- initial check for the polynomial model example |
2 | import LinearAlgebra | 2 | import Numeric.LinearAlgebra |
3 | 3 | ||
4 | 4 | ||
5 | prepSyst :: Int -> Matrix Double -> (Matrix Double, Vector Double) | 5 | prepSyst :: Int -> Matrix Double -> (Matrix Double, Vector Double) |
diff --git a/examples/pinv2.hs b/examples/pinv2.hs index c1038d1..7423540 100644 --- a/examples/pinv2.hs +++ b/examples/pinv2.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- MSE polynomial model using the pseudoinverse | 1 | -- MSE polynomial model using the pseudoinverse |
2 | import LinearAlgebra | 2 | import Numeric.LinearAlgebra |
3 | import Graphics.Plot | 3 | import Graphics.Plot |
4 | 4 | ||
5 | expand :: Int -> Vector Double -> Matrix Double | 5 | expand :: Int -> Vector Double -> Matrix Double |
diff --git a/examples/plot.hs b/examples/plot.hs index 1177c11..e4025fd 100644 --- a/examples/plot.hs +++ b/examples/plot.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | import LinearAlgebra | 1 | import Numeric.LinearAlgebra |
2 | import Graphics.Plot | 2 | import Graphics.Plot |
3 | import GSL(erf_Z, erf) | 3 | import Numeric.GSL(erf_Z, erf) |
4 | 4 | ||
5 | sombrero n = f x y where | 5 | sombrero n = f x y where |
6 | (x,y) = meshdom range range | 6 | (x,y) = meshdom range range |
diff --git a/examples/tests.hs b/examples/tests.hs index e66774b..b088069 100644 --- a/examples/tests.hs +++ b/examples/tests.hs | |||
@@ -3,11 +3,11 @@ | |||
3 | module Main where | 3 | module Main where |
4 | 4 | ||
5 | import Data.Packed.Internal((>|<), fdat, cdat, multiply', multiplyG, MatrixOrder(..),debug) | 5 | import Data.Packed.Internal((>|<), fdat, cdat, multiply', multiplyG, MatrixOrder(..),debug) |
6 | import GSL hiding (sin,cos,exp,choose) | 6 | import Numeric.GSL hiding (sin,cos,exp,choose) |
7 | import LinearAlgebra | 7 | import Numeric.LinearAlgebra |
8 | import LinearAlgebra.Linear(Linear) | 8 | import Numeric.LinearAlgebra.Linear(Linear) |
9 | import LinearAlgebra.LAPACK | 9 | import Numeric.LinearAlgebra.LAPACK |
10 | import GSL.Matrix | 10 | import Numeric.GSL.Matrix |
11 | import Test.QuickCheck hiding (test) | 11 | import Test.QuickCheck hiding (test) |
12 | import Test.HUnit hiding ((~:),test) | 12 | import Test.HUnit hiding ((~:),test) |
13 | import System.Random(randomRs,mkStdGen) | 13 | import System.Random(randomRs,mkStdGen) |