diff options
-rw-r--r-- | INSTALL | 28 | ||||
-rw-r--r-- | hmatrix.cabal | 11 | ||||
-rw-r--r-- | hmatrix.cabal-windows | 154 | ||||
-rw-r--r-- | lib/Data/Packed/Random.hs | 5 | ||||
-rw-r--r-- | lib/Graphics/Plot.hs | 18 | ||||
-rw-r--r-- | lib/Numeric/GSL.hs | 4 | ||||
-rw-r--r-- | lib/Numeric/GSL/ODE.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Interface.hs | 29 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Linear.hs | 2 |
11 files changed, 76 insertions, 183 deletions
@@ -7,7 +7,31 @@ Recommended method (ok in Ubuntu/Debian systems): | |||
7 | Detailed installation instructions: | 7 | Detailed installation instructions: |
8 | http://code.haskell.org/hmatrix/install.html | 8 | http://code.haskell.org/hmatrix/install.html |
9 | 9 | ||
10 | INSTALLATION ON WINDOWS ---------------------------------------- | 10 | INSTALLATION ON WINDOWS (hmatrix-0.9.x.x) |
11 | |||
12 | 1) Install the Haskell Platform (tested with 2009.2.0.2). | ||
13 | |||
14 | 2) Download and unzip the following file into a stable folder %GSL% | ||
15 | |||
16 | http://code.haskell.org/hmatrix/gsl-lapack-windows.zip | ||
17 | |||
18 | 3.a) In a msys shell | ||
19 | |||
20 | $ cabal install hmatrix --extra-lib-dir=${GSL} --extra-include-dir=${GSL} | ||
21 | |||
22 | 3.b) In a windows cmd | ||
23 | |||
24 | > cabal unpack hmatrix | ||
25 | |||
26 | Change build-type to "Simple" in hmatrix.cabal, line 18 | ||
27 | |||
28 | > cabal install --extra-lib-dir=%GSL% --extra-include-dir=%GSL% | ||
29 | |||
30 | 4) If everything is ok we can run the tests: | ||
31 | |||
32 | > runhaskell examples\tests.hs | ||
33 | |||
34 | INSTALLATION ON WINDOWS (hmatrix-0.8.3.1) | ||
11 | 35 | ||
12 | 1) Install the Haskell Platform (tested with 2009.2.0.2). | 36 | 1) Install the Haskell Platform (tested with 2009.2.0.2). |
13 | 37 | ||
@@ -24,7 +48,7 @@ INSTALLATION ON WINDOWS ---------------------------------------- | |||
24 | 4) Replace hmatrix.cabal by | 48 | 4) Replace hmatrix.cabal by |
25 | 49 | ||
26 | http://code.haskell.org/hmatrix/hmatrix-0.8.3.1-windows.cabal | 50 | http://code.haskell.org/hmatrix/hmatrix-0.8.3.1-windows.cabal |
27 | 51 | ||
28 | 5) In the hmatrix folder run | 52 | 5) In the hmatrix folder run |
29 | 53 | ||
30 | > cabal install | 54 | > cabal install |
diff --git a/hmatrix.cabal b/hmatrix.cabal index 892b846..e684acc 100644 --- a/hmatrix.cabal +++ b/hmatrix.cabal | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.9.2.0 | 2 | Version: 0.9.3.0 |
3 | License: GPL | 3 | License: GPL |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: Alberto Ruiz |
@@ -10,6 +10,8 @@ Synopsis: Linear algebra and numerical computation | |||
10 | Description: Purely functional interface to basic linear algebra | 10 | Description: Purely functional interface to basic linear algebra |
11 | and other numerical computations, internally implemented using | 11 | and other numerical computations, internally implemented using |
12 | GSL, BLAS and LAPACK. | 12 | GSL, BLAS and LAPACK. |
13 | . | ||
14 | See also hmatrix-special and hmatrix-glpk. | ||
13 | Category: Math | 15 | Category: Math |
14 | tested-with: GHC ==6.10.4, GHC ==6.12.1 | 16 | tested-with: GHC ==6.10.4, GHC ==6.12.1 |
15 | 17 | ||
@@ -89,8 +91,6 @@ library | |||
89 | Numeric.GSL, | 91 | Numeric.GSL, |
90 | Numeric.LinearAlgebra, | 92 | Numeric.LinearAlgebra, |
91 | Numeric.LinearAlgebra.LAPACK, | 93 | Numeric.LinearAlgebra.LAPACK, |
92 | Numeric.LinearAlgebra.Linear, | ||
93 | Numeric.LinearAlgebra.Instances, | ||
94 | Numeric.LinearAlgebra.Interface, | 94 | Numeric.LinearAlgebra.Interface, |
95 | Numeric.LinearAlgebra.Algorithms, | 95 | Numeric.LinearAlgebra.Algorithms, |
96 | Graphics.Plot, | 96 | Graphics.Plot, |
@@ -103,6 +103,8 @@ library | |||
103 | Data.Packed.Internal.Signatures, | 103 | Data.Packed.Internal.Signatures, |
104 | Data.Packed.Internal.Vector, | 104 | Data.Packed.Internal.Vector, |
105 | Data.Packed.Internal.Matrix, | 105 | Data.Packed.Internal.Matrix, |
106 | Numeric.LinearAlgebra.Linear, | ||
107 | Numeric.LinearAlgebra.Instances, | ||
106 | Numeric.GSL.Internal | 108 | Numeric.GSL.Internal |
107 | 109 | ||
108 | C-sources: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c, | 110 | C-sources: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c, |
@@ -141,6 +143,9 @@ library | |||
141 | extra-libraries: gsl | 143 | extra-libraries: gsl |
142 | frameworks: Accelerate | 144 | frameworks: Accelerate |
143 | 145 | ||
146 | if os(windows) | ||
147 | extra-libraries: gsl-0 blas lapack | ||
148 | |||
144 | -- The extra-libraries required for GSL and LAPACK | 149 | -- The extra-libraries required for GSL and LAPACK |
145 | -- should now be automatically detected by configure(.hs) | 150 | -- should now be automatically detected by configure(.hs) |
146 | 151 | ||
diff --git a/hmatrix.cabal-windows b/hmatrix.cabal-windows deleted file mode 100644 index 4dfaede..0000000 --- a/hmatrix.cabal-windows +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | Name: hmatrix | ||
2 | Version: 0.9.2.0 | ||
3 | License: GPL | ||
4 | License-file: LICENSE | ||
5 | Author: Alberto Ruiz | ||
6 | Maintainer: Alberto Ruiz <aruiz@um.es> | ||
7 | Stability: provisional | ||
8 | Homepage: http://code.haskell.org/hmatrix | ||
9 | Synopsis: Linear algebra and numerical computation | ||
10 | Description: Purely functional interface to basic linear algebra | ||
11 | and other numerical computations, internally implemented using | ||
12 | GSL, BLAS and LAPACK. | ||
13 | Category: Math | ||
14 | tested-with: GHC ==6.10.4, GHC ==6.12.1 | ||
15 | |||
16 | cabal-version: >=1.2 | ||
17 | |||
18 | build-type: Simple | ||
19 | |||
20 | extra-source-files: lib/Numeric/LinearAlgebra/Tests/quickCheckCompat.h | ||
21 | configure configure.hs THANKS INSTALL CHANGES | ||
22 | extra-tmp-files: hmatrix.buildinfo | ||
23 | |||
24 | extra-source-files: examples/tests.hs | ||
25 | examples/deriv.hs | ||
26 | examples/integrate.hs | ||
27 | examples/minimize.hs | ||
28 | examples/root.hs | ||
29 | examples/ode.hs | ||
30 | examples/pca1.hs | ||
31 | examples/pca2.hs | ||
32 | examples/pinv.hs | ||
33 | examples/data.txt | ||
34 | examples/lie.hs | ||
35 | examples/kalman.hs | ||
36 | examples/parallel.hs | ||
37 | examples/plot.hs | ||
38 | examples/inplace.hs | ||
39 | examples/error.hs | ||
40 | examples/devel/ej1/wrappers.hs | ||
41 | examples/devel/ej1/functions.c | ||
42 | examples/devel/ej2/wrappers.hs | ||
43 | examples/devel/ej2/functions.c | ||
44 | examples/Real.hs | ||
45 | examples/vector.hs | ||
46 | |||
47 | extra-source-files: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h, | ||
48 | lib/Numeric/LinearAlgebra/LAPACK/clapack.h | ||
49 | |||
50 | flag tests | ||
51 | description: Build tests | ||
52 | default: True | ||
53 | |||
54 | flag dd | ||
55 | description: svd = zgesdd | ||
56 | default: True | ||
57 | |||
58 | flag mkl | ||
59 | description: Link with Intel's MKL optimized libraries. | ||
60 | default: False | ||
61 | |||
62 | flag unsafe | ||
63 | description: Compile the library with bound checking disabled. | ||
64 | default: False | ||
65 | |||
66 | library | ||
67 | |||
68 | Build-Depends: base >= 4 && < 5, | ||
69 | array, | ||
70 | storable-complex, | ||
71 | process | ||
72 | |||
73 | Extensions: ForeignFunctionInterface, | ||
74 | CPP | ||
75 | |||
76 | hs-source-dirs: lib | ||
77 | Exposed-modules: Data.Packed, | ||
78 | Data.Packed.Vector, | ||
79 | Data.Packed.Matrix, | ||
80 | Numeric.GSL.Differentiation, | ||
81 | Numeric.GSL.Integration, | ||
82 | Numeric.GSL.Fourier, | ||
83 | Numeric.GSL.Polynomials, | ||
84 | Numeric.GSL.Minimization, | ||
85 | Numeric.GSL.Root, | ||
86 | Numeric.GSL.Fitting, | ||
87 | Numeric.GSL.ODE, | ||
88 | Numeric.GSL.Vector, | ||
89 | Numeric.GSL, | ||
90 | Numeric.LinearAlgebra, | ||
91 | Numeric.LinearAlgebra.LAPACK, | ||
92 | Numeric.LinearAlgebra.Linear, | ||
93 | Numeric.LinearAlgebra.Instances, | ||
94 | Numeric.LinearAlgebra.Interface, | ||
95 | Numeric.LinearAlgebra.Algorithms, | ||
96 | Graphics.Plot, | ||
97 | -- Data.Packed.Convert, | ||
98 | Data.Packed.ST, | ||
99 | Data.Packed.Development, | ||
100 | Data.Packed.Random | ||
101 | other-modules: Data.Packed.Internal, | ||
102 | Data.Packed.Internal.Common, | ||
103 | Data.Packed.Internal.Signatures, | ||
104 | Data.Packed.Internal.Vector, | ||
105 | Data.Packed.Internal.Matrix, | ||
106 | Numeric.GSL.Internal | ||
107 | |||
108 | C-sources: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c, | ||
109 | lib/Numeric/GSL/gsl-aux.c | ||
110 | |||
111 | if flag(tests) | ||
112 | Build-Depends: QuickCheck, HUnit | ||
113 | exposed-modules: Numeric.LinearAlgebra.Tests | ||
114 | other-modules: Numeric.LinearAlgebra.Tests.Instances, | ||
115 | Numeric.LinearAlgebra.Tests.Properties | ||
116 | |||
117 | -- ghc-prof-options: -auto | ||
118 | |||
119 | ghc-options: -Wall -fno-warn-missing-signatures | ||
120 | -fno-warn-orphans | ||
121 | -fno-warn-unused-binds | ||
122 | |||
123 | if flag(unsafe) | ||
124 | cpp-options: -DUNSAFE | ||
125 | |||
126 | if !flag(dd) | ||
127 | cpp-options: -DNOZGESDD | ||
128 | |||
129 | if impl(ghc < 6.10.2) | ||
130 | cpp-options: -DFINIT | ||
131 | |||
132 | if flag(mkl) | ||
133 | if arch(x86_64) | ||
134 | extra-libraries: gsl mkl_lapack mkl_intel_lp64 mkl_sequential mkl_core | ||
135 | else | ||
136 | extra-libraries: gsl mkl_lapack mkl_intel mkl_sequential mkl_core | ||
137 | |||
138 | if os(OSX) | ||
139 | extra-lib-dirs: /opt/local/lib/ | ||
140 | include-dirs: /opt/local/include | ||
141 | extra-libraries: gsl | ||
142 | frameworks: Accelerate | ||
143 | |||
144 | -- The extra-libraries required for GSL and LAPACK | ||
145 | -- should now be automatically detected by configure(.hs) | ||
146 | |||
147 | extra-libraries: gsl-0 blas lapack | ||
148 | extra-lib-dirs: c:\haskell\hmatrix-0.8.3.1\gsl-lapack-windows | ||
149 | extra-include-dirs: c:\haskell\hmatrix-0.8.3.1\gsl-lapack-windows | ||
150 | |||
151 | source-repository head | ||
152 | type: darcs | ||
153 | location: http://code.haskell.org/hmatrix | ||
154 | |||
diff --git a/lib/Data/Packed/Random.hs b/lib/Data/Packed/Random.hs index 260e4dc..e57ba6e 100644 --- a/lib/Data/Packed/Random.hs +++ b/lib/Data/Packed/Random.hs | |||
@@ -20,10 +20,9 @@ module Data.Packed.Random ( | |||
20 | ) where | 20 | ) where |
21 | 21 | ||
22 | import Numeric.GSL.Vector | 22 | import Numeric.GSL.Vector |
23 | import Data.Packed | 23 | import Data.Packed.Matrix |
24 | import Numeric.LinearAlgebra.Linear | 24 | import Data.Packed.Vector |
25 | import Numeric.LinearAlgebra.Algorithms | 25 | import Numeric.LinearAlgebra.Algorithms |
26 | import Numeric.LinearAlgebra.Instances() | ||
27 | import Numeric.LinearAlgebra.Interface | 26 | import Numeric.LinearAlgebra.Interface |
28 | 27 | ||
29 | -- | Obtains a matrix whose rows are pseudorandom samples from a multivariate | 28 | -- | Obtains a matrix whose rows are pseudorandom samples from a multivariate |
diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs index 3f66d98..b4e8a11 100644 --- a/lib/Graphics/Plot.hs +++ b/lib/Graphics/Plot.hs | |||
@@ -24,7 +24,7 @@ module Graphics.Plot( | |||
24 | 24 | ||
25 | matrixToPGM, imshow, | 25 | matrixToPGM, imshow, |
26 | 26 | ||
27 | gnuplotX, gnuplotpdf | 27 | gnuplotX, gnuplotpdf, gnuplotWin |
28 | 28 | ||
29 | ) where | 29 | ) where |
30 | 30 | ||
@@ -204,3 +204,19 @@ gnuplotpdf title command ds = gnuplot (prelude ++ command ++" "++ draw) >> postp | |||
204 | _ <- system "gnuplot gnuplotcommand" | 204 | _ <- system "gnuplot gnuplotcommand" |
205 | _ <- system "rm gnuplotcommand" | 205 | _ <- system "rm gnuplotcommand" |
206 | return () | 206 | return () |
207 | |||
208 | gnuplotWin :: String -> String -> [([[Double]], String)] -> IO () | ||
209 | gnuplotWin title command ds = gnuplot (prelude ++ command ++" "++ draw) where | ||
210 | (dats,defs) = unzip ds | ||
211 | draw = concat (intersperse ", " (map ("\"-\" "++) defs)) ++ "\n" ++ | ||
212 | concatMap pr dats | ||
213 | |||
214 | pr = (++"e\n") . unlines . map (unwords . (map show)) | ||
215 | |||
216 | prelude = "set title \""++title++"\";" | ||
217 | |||
218 | gnuplot cmd = do | ||
219 | writeFile "gnuplotcommand" cmd | ||
220 | _ <- system "gnuplot -persist gnuplotcommand" | ||
221 | _ <- system "rm gnuplotcommand" | ||
222 | return () | ||
diff --git a/lib/Numeric/GSL.hs b/lib/Numeric/GSL.hs index ae4c81e..e53022e 100644 --- a/lib/Numeric/GSL.hs +++ b/lib/Numeric/GSL.hs | |||
@@ -8,7 +8,9 @@ Maintainer : Alberto Ruiz (aruiz at um dot es) | |||
8 | Stability : provisional | 8 | Stability : provisional |
9 | Portability : uses -fffi and -fglasgow-exts | 9 | Portability : uses -fffi and -fglasgow-exts |
10 | 10 | ||
11 | This module reexports all the available GSL functions (except those in "Numeric.LinearAlgebra"). | 11 | This module reexports all available GSL functions. |
12 | |||
13 | The GSL special functions are in the separate package hmatrix-special. | ||
12 | 14 | ||
13 | -} | 15 | -} |
14 | 16 | ||
diff --git a/lib/Numeric/GSL/ODE.hs b/lib/Numeric/GSL/ODE.hs index eca06f8..912e8a8 100644 --- a/lib/Numeric/GSL/ODE.hs +++ b/lib/Numeric/GSL/ODE.hs | |||
@@ -33,7 +33,6 @@ module Numeric.GSL.ODE ( | |||
33 | ) where | 33 | ) where |
34 | 34 | ||
35 | import Data.Packed.Internal | 35 | import Data.Packed.Internal |
36 | import Data.Packed.Matrix | ||
37 | import Foreign | 36 | import Foreign |
38 | import Foreign.C.Types(CInt) | 37 | import Foreign.C.Types(CInt) |
39 | import Numeric.GSL.Internal | 38 | import Numeric.GSL.Internal |
diff --git a/lib/Numeric/LinearAlgebra.hs b/lib/Numeric/LinearAlgebra.hs index 337c007..2652f2d 100644 --- a/lib/Numeric/LinearAlgebra.hs +++ b/lib/Numeric/LinearAlgebra.hs | |||
@@ -8,23 +8,19 @@ Maintainer : Alberto Ruiz (aruiz at um dot es) | |||
8 | Stability : provisional | 8 | Stability : provisional |
9 | Portability : uses ffi | 9 | Portability : uses ffi |
10 | 10 | ||
11 | Basic matrix computations implemented by BLAS, LAPACK and GSL. | 11 | This module reexports all normally required functions for Linear Algebra applications. |
12 | |||
13 | This module reexports the most comon functions (including "Numeric.LinearAlgebra.Instances"). | ||
14 | 12 | ||
15 | -} | 13 | -} |
16 | ----------------------------------------------------------------------------- | 14 | ----------------------------------------------------------------------------- |
17 | module Numeric.LinearAlgebra ( | 15 | module Numeric.LinearAlgebra ( |
18 | module Data.Packed, | 16 | module Data.Packed, |
19 | module Data.Packed.Random, | 17 | module Data.Packed.Random, |
20 | module Numeric.LinearAlgebra.Linear, | ||
21 | module Numeric.LinearAlgebra.Algorithms, | 18 | module Numeric.LinearAlgebra.Algorithms, |
22 | module Numeric.LinearAlgebra.Interface | 19 | module Numeric.LinearAlgebra.Interface |
23 | ) where | 20 | ) where |
24 | 21 | ||
25 | import Data.Packed | 22 | import Data.Packed |
26 | import Data.Packed.Random | 23 | import Data.Packed.Random |
27 | import Numeric.LinearAlgebra.Linear | ||
28 | import Numeric.LinearAlgebra.Algorithms | 24 | import Numeric.LinearAlgebra.Algorithms |
29 | import Numeric.LinearAlgebra.Instances() | 25 | import Numeric.LinearAlgebra.Instances() |
30 | import Numeric.LinearAlgebra.Interface | 26 | import Numeric.LinearAlgebra.Interface |
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index fc2fcb2..7de9587 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -66,6 +66,7 @@ module Numeric.LinearAlgebra.Algorithms ( | |||
66 | -- * Misc | 66 | -- * Misc |
67 | ctrans, | 67 | ctrans, |
68 | eps, i, | 68 | eps, i, |
69 | Linear(..), | ||
69 | -- * Util | 70 | -- * Util |
70 | haussholder, | 71 | haussholder, |
71 | unpackQR, unpackHess, | 72 | unpackQR, unpackHess, |
diff --git a/lib/Numeric/LinearAlgebra/Interface.hs b/lib/Numeric/LinearAlgebra/Interface.hs index b74180f..750670b 100644 --- a/lib/Numeric/LinearAlgebra/Interface.hs +++ b/lib/Numeric/LinearAlgebra/Interface.hs | |||
@@ -9,7 +9,12 @@ Maintainer : Alberto Ruiz (aruiz at um dot es) | |||
9 | Stability : provisional | 9 | Stability : provisional |
10 | Portability : portable | 10 | Portability : portable |
11 | 11 | ||
12 | (Very provisional) operators for frequent operations. | 12 | Operators for frequent operations. |
13 | |||
14 | This module exports Show, Read, Eq, Num, Fractional, and Floating instances for Vector and Matrix. | ||
15 | |||
16 | In the context of the standard numeric operators, one-component vectors and matrices automatically expand to match the dimensions of the other operand. | ||
17 | |||
13 | 18 | ||
14 | -} | 19 | -} |
15 | ----------------------------------------------------------------------------- | 20 | ----------------------------------------------------------------------------- |
@@ -21,14 +26,14 @@ module Numeric.LinearAlgebra.Interface( | |||
21 | (<|>),(<->), | 26 | (<|>),(<->), |
22 | ) where | 27 | ) where |
23 | 28 | ||
24 | import Numeric.LinearAlgebra.Linear | 29 | import Numeric.LinearAlgebra.Instances() |
25 | import Data.Packed.Vector | 30 | import Data.Packed.Vector |
26 | import Data.Packed.Matrix | 31 | import Data.Packed.Matrix |
27 | import Numeric.LinearAlgebra.Algorithms | 32 | import Numeric.LinearAlgebra.Algorithms |
28 | 33 | ||
29 | class Mul a b c | a b -> c where | 34 | class Mul a b c | a b -> c where |
30 | infixl 7 <> | 35 | infixl 7 <> |
31 | -- | matrix product | 36 | -- | Matrix-matrix, matrix-vector, and vector-matrix products. |
32 | (<>) :: Field t => a t -> b t -> c t | 37 | (<>) :: Field t => a t -> b t -> c t |
33 | 38 | ||
34 | instance Mul Matrix Matrix Matrix where | 39 | instance Mul Matrix Matrix Matrix where |
@@ -42,7 +47,7 @@ instance Mul Vector Matrix Vector where | |||
42 | 47 | ||
43 | --------------------------------------------------- | 48 | --------------------------------------------------- |
44 | 49 | ||
45 | -- | @u \<.\> v = dot u v@ | 50 | -- | Dot product: @u \<.\> v = dot u v@ |
46 | (<.>) :: (Field t) => Vector t -> Vector t -> t | 51 | (<.>) :: (Field t) => Vector t -> Vector t -> t |
47 | infixl 7 <.> | 52 | infixl 7 <.> |
48 | (<.>) = dot | 53 | (<.>) = dot |
@@ -51,8 +56,8 @@ infixl 7 <.> | |||
51 | 56 | ||
52 | {-# DEPRECATED (.*) "use scale a x or scalar a * x" #-} | 57 | {-# DEPRECATED (.*) "use scale a x or scalar a * x" #-} |
53 | 58 | ||
54 | -- | @x .* a = scale x a@ | 59 | -- -- | @x .* a = scale x a@ |
55 | (.*) :: (Linear c a) => a -> c a -> c a | 60 | -- (.*) :: (Linear c a) => a -> c a -> c a |
56 | infixl 7 .* | 61 | infixl 7 .* |
57 | a .* x = scale a x | 62 | a .* x = scale a x |
58 | 63 | ||
@@ -60,8 +65,8 @@ a .* x = scale a x | |||
60 | 65 | ||
61 | {-# DEPRECATED (*/) "use scale (recip a) x or x / scalar a" #-} | 66 | {-# DEPRECATED (*/) "use scale (recip a) x or x / scalar a" #-} |
62 | 67 | ||
63 | -- | @a *\/ x = scale (recip x) a@ | 68 | -- -- | @a *\/ x = scale (recip x) a@ |
64 | (*/) :: (Linear c a) => c a -> a -> c a | 69 | -- (*/) :: (Linear c a) => c a -> a -> c a |
65 | infixl 7 */ | 70 | infixl 7 */ |
66 | v */ x = scale (recip x) v | 71 | v */ x = scale (recip x) v |
67 | 72 | ||
@@ -94,7 +99,7 @@ instance Joinable Vector Matrix where | |||
94 | infixl 4 <|> | 99 | infixl 4 <|> |
95 | infixl 3 <-> | 100 | infixl 3 <-> |
96 | 101 | ||
97 | {- | Horizontal concatenation of matrices and vectors: | 102 | {-- - | Horizontal concatenation of matrices and vectors: |
98 | 103 | ||
99 | @> (ident 3 \<-\> 3 * ident 3) \<|\> fromList [1..6.0] | 104 | @> (ident 3 \<-\> 3 * ident 3) \<|\> fromList [1..6.0] |
100 | (6><4) | 105 | (6><4) |
@@ -105,10 +110,10 @@ infixl 3 <-> | |||
105 | , 0.0, 3.0, 0.0, 5.0 | 110 | , 0.0, 3.0, 0.0, 5.0 |
106 | , 0.0, 0.0, 3.0, 6.0 ]@ | 111 | , 0.0, 0.0, 3.0, 6.0 ]@ |
107 | -} | 112 | -} |
108 | (<|>) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | 113 | -- (<|>) :: (Element t, Joinable a b) => a t -> b t -> Matrix t |
109 | a <|> b = joinH a b | 114 | a <|> b = joinH a b |
110 | 115 | ||
111 | -- | Vertical concatenation of matrices and vectors. | 116 | -- -- | Vertical concatenation of matrices and vectors. |
112 | (<->) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | 117 | -- (<->) :: (Element t, Joinable a b) => a t -> b t -> Matrix t |
113 | a <-> b = joinV a b | 118 | a <-> b = joinV a b |
114 | 119 | ||
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index 7e23745..2568410 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs | |||
@@ -21,7 +21,7 @@ module Numeric.LinearAlgebra.Linear ( | |||
21 | import Data.Packed | 21 | import Data.Packed |
22 | import Numeric.GSL.Vector | 22 | import Numeric.GSL.Vector |
23 | 23 | ||
24 | -- | A generic interface for vectors and matrices to a few element-by-element functions in Numeric.GSL.Vector. | 24 | -- | Basic element-by-element functions. |
25 | class (Container c e) => Linear c e where | 25 | class (Container c e) => Linear c e where |
26 | -- | create a structure with a single element | 26 | -- | create a structure with a single element |
27 | scalar :: e -> c e | 27 | scalar :: e -> c e |