summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/deriv.hs2
-rw-r--r--examples/error.hs2
-rw-r--r--examples/integrate.hs2
-rw-r--r--examples/kalman.hs5
-rw-r--r--examples/listlike.hs2
-rw-r--r--examples/minimize.hs4
-rw-r--r--examples/pca1.hs4
-rw-r--r--examples/pca2.hs4
-rw-r--r--examples/pinv1.hs2
-rw-r--r--examples/pinv2.hs2
-rw-r--r--examples/plot.hs4
-rw-r--r--examples/tests.hs10
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
3import GSL 3import Numeric.GSL
4 4
5d :: (Double -> Double) -> (Double -> Double) 5d :: (Double -> Double) -> (Double -> Double)
6d f x = fst $ derivCentral 0.01 f x 6d 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 @@
1import GSL 1import Numeric.GSL
2import Prelude hiding (catch) 2import Prelude hiding (catch)
3import Control.Exception 3import 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
2import GSL 2import Numeric.GSL
3 3
4quad f a b = fst $ integrateQAGS 1E-9 100 f a b 4quad 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 @@
1import LinearAlgebra 1import Numeric.LinearAlgebra
2import Graphics.Plot 2import Graphics.Plot
3import LinearAlgebra.Instances
4
5--import GSLHaskell
6 3
7vector l = fromList l :: Vector Double 4vector l = fromList l :: Vector Double
8matrix ls = fromLists ls :: Matrix Double 5matrix 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
3import qualified Data.ListLike as LL 3import qualified Data.ListLike as LL
4import LinearAlgebra 4import Numeric.LinearAlgebra
5import Data.Monoid 5import Data.Monoid
6import Data.Packed.Internal.Vector 6import Data.Packed.Internal.Vector
7import Foreign 7import 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
2import GSL 2import Numeric.GSL
3import LinearAlgebra 3import Numeric.LinearAlgebra
4import Graphics.Plot 4import 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
3import LinearAlgebra 3import Numeric.LinearAlgebra
4import System.Directory(doesFileExist) 4import System.Directory(doesFileExist)
5import System(system) 5import System(system)
6import Control.Monad(when) 6import 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
32main = do 32main = 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
3import LinearAlgebra 3import Numeric.LinearAlgebra
4import Graphics.Plot 4import Graphics.Plot
5import System.Directory(doesFileExist) 5import System.Directory(doesFileExist)
6import System(system) 6import System(system)
@@ -24,7 +24,7 @@ type Stat = (Vec, [Double], Mat)
24stat :: Mat -> Stat 24stat :: Mat -> Stat
25stat x = (m, toList s, trans v) where 25stat 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
2import LinearAlgebra 2import Numeric.LinearAlgebra
3 3
4 4
5prepSyst :: Int -> Matrix Double -> (Matrix Double, Vector Double) 5prepSyst :: 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
2import LinearAlgebra 2import Numeric.LinearAlgebra
3import Graphics.Plot 3import Graphics.Plot
4 4
5expand :: Int -> Vector Double -> Matrix Double 5expand :: 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 @@
1import LinearAlgebra 1import Numeric.LinearAlgebra
2import Graphics.Plot 2import Graphics.Plot
3import GSL(erf_Z, erf) 3import Numeric.GSL(erf_Z, erf)
4 4
5sombrero n = f x y where 5sombrero 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 @@
3module Main where 3module Main where
4 4
5import Data.Packed.Internal((>|<), fdat, cdat, multiply', multiplyG, MatrixOrder(..),debug) 5import Data.Packed.Internal((>|<), fdat, cdat, multiply', multiplyG, MatrixOrder(..),debug)
6import GSL hiding (sin,cos,exp,choose) 6import Numeric.GSL hiding (sin,cos,exp,choose)
7import LinearAlgebra 7import Numeric.LinearAlgebra
8import LinearAlgebra.Linear(Linear) 8import Numeric.LinearAlgebra.Linear(Linear)
9import LinearAlgebra.LAPACK 9import Numeric.LinearAlgebra.LAPACK
10import GSL.Matrix 10import Numeric.GSL.Matrix
11import Test.QuickCheck hiding (test) 11import Test.QuickCheck hiding (test)
12import Test.HUnit hiding ((~:),test) 12import Test.HUnit hiding ((~:),test)
13import System.Random(randomRs,mkStdGen) 13import System.Random(randomRs,mkStdGen)