summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hmatrix.cabal1
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs4
-rw-r--r--lib/Numeric/Container.hs16
-rw-r--r--lib/Numeric/Conversion.hs6
-rw-r--r--lib/Numeric/LinearAlgebra/Algorithms.hs1
-rw-r--r--lib/Numeric/Matrix.hs5
6 files changed, 13 insertions, 20 deletions
diff --git a/hmatrix.cabal b/hmatrix.cabal
index e038eb2..9934b6e 100644
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -115,6 +115,7 @@ library
115 Data.Packed.Internal.Matrix, 115 Data.Packed.Internal.Matrix,
116 Numeric.GSL.Internal, 116 Numeric.GSL.Internal,
117 Numeric.Conversion 117 Numeric.Conversion
118 Numeric.MatrixBoot
118 Numeric.Chain 119 Numeric.Chain
119 120
120 C-sources: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c, 121 C-sources: lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.c,
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index 94b56cf..f3bab76 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -246,6 +246,8 @@ compat m1 m2 = rows m1 == rows m2 && cols m1 == cols m2
246------------------------------------------------------------------ 246------------------------------------------------------------------
247 247
248-- | Supported element types for basic matrix operations. 248-- | Supported element types for basic matrix operations.
249-- provides unoptimised defaults for all (Storable a) instances
250-- @instance Element Foo where@
249class (Storable a) => Element a where 251class (Storable a) => Element a where
250 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position 252 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position
251 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix 253 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix
@@ -329,7 +331,7 @@ transdataP c1 d c2 =
329 v <- createVector (dim d) 331 v <- createVector (dim d)
330 unsafeWith d $ \pd -> 332 unsafeWith d $ \pd ->
331 unsafeWith v $ \pv -> 333 unsafeWith v $ \pv ->
332 ctransP (fi r1) (fi c1) (castPtr pd) (fi sz) (fi r2) (fi c2) (castPtr pv) (fi sz) // check "transdataStorable" 334 ctransP (fi r1) (fi c1) (castPtr pd) (fi sz) (fi r2) (fi c2) (castPtr pv) (fi sz) // check "transdataP"
333 return v 335 return v
334 where r1 = dim d `div` c1 336 where r1 = dim d `div` c1
335 r2 = dim d `div` c2 337 r2 = dim d `div` c2
diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs
index 1afc5a1..09f8002 100644
--- a/lib/Numeric/Container.hs
+++ b/lib/Numeric/Container.hs
@@ -22,7 +22,6 @@
22module Numeric.Container ( 22module Numeric.Container (
23 -- * Generic operations 23 -- * Generic operations
24 Container(..), 24 Container(..),
25 ctrans, diag, ident,
26 -- * Matrix product and related functions 25 -- * Matrix product and related functions
27 Product(..), 26 Product(..),
28 mXm,mXv,vXm, 27 mXm,mXv,vXm,
@@ -222,21 +221,6 @@ instance (Container Vector a) => Container Matrix a where
222 221
223---------------------------------------------------- 222----------------------------------------------------
224 223
225-- | conjugate transpose
226ctrans :: Element e => Matrix e -> Matrix e
227ctrans = liftMatrix conjugateD . trans
228
229-- | Creates a square matrix with a given diagonal.
230diag :: (Num a, Element a) => Vector a -> Matrix a
231diag v = diagRect 0 v n n where n = dim v
232
233-- | creates the identity matrix of given dimension
234ident :: (Num a, Element a) => Int -> Matrix a
235ident n = diag (constantD 1 n)
236
237----------------------------------------------------
238
239
240-- | Matrix product and related functions 224-- | Matrix product and related functions
241class Element e => Product e where 225class Element e => Product e where
242 -- | matrix product 226 -- | matrix product
diff --git a/lib/Numeric/Conversion.hs b/lib/Numeric/Conversion.hs
index fbf608a..8941451 100644
--- a/lib/Numeric/Conversion.hs
+++ b/lib/Numeric/Conversion.hs
@@ -7,15 +7,15 @@
7 7
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- | 9-- |
10-- Module : Numeric.Container 10-- Module : Numeric.Conversion
11-- Copyright : (c) Alberto Ruiz 2007 11-- Copyright : (c) Alberto Ruiz 2010
12-- License : GPL-style 12-- License : GPL-style
13-- 13--
14-- Maintainer : Alberto Ruiz <aruiz@um.es> 14-- Maintainer : Alberto Ruiz <aruiz@um.es>
15-- Stability : provisional 15-- Stability : provisional
16-- Portability : portable 16-- Portability : portable
17-- 17--
18-- Numeric classes for containers of numbers, including conversion routines 18-- Conversion routines
19-- 19--
20----------------------------------------------------------------------------- 20-----------------------------------------------------------------------------
21 21
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs
index 394a1d7..64deba2 100644
--- a/lib/Numeric/LinearAlgebra/Algorithms.hs
+++ b/lib/Numeric/LinearAlgebra/Algorithms.hs
@@ -80,6 +80,7 @@ import Numeric.LinearAlgebra.LAPACK as LAPACK
80import Data.List(foldl1') 80import Data.List(foldl1')
81import Data.Array 81import Data.Array
82import Numeric.Container hiding ((.*),(*/)) 82import Numeric.Container hiding ((.*),(*/))
83import Numeric.MatrixBoot
83 84
84-- | Auxiliary typeclass used to define generic computations for both real and complex matrices. 85-- | Auxiliary typeclass used to define generic computations for both real and complex matrices.
85class (Product t, 86class (Product t,
diff --git a/lib/Numeric/Matrix.hs b/lib/Numeric/Matrix.hs
index 9260bd5..26d6d6b 100644
--- a/lib/Numeric/Matrix.hs
+++ b/lib/Numeric/Matrix.hs
@@ -28,6 +28,10 @@ module Numeric.Matrix (
28 -- * Basic functions 28 -- * Basic functions
29 module Data.Packed.Matrix, 29 module Data.Packed.Matrix,
30 module Numeric.Vector, 30 module Numeric.Vector,
31 -- * Matrix creation
32 diag, ident,
33 -- * matrix operations
34 ctrans,
31 optimiseMult, 35 optimiseMult,
32 -- * Operators 36 -- * Operators
33 (<>), (<\>) 37 (<>), (<\>)
@@ -38,6 +42,7 @@ module Numeric.Matrix (
38import Data.Packed.Matrix 42import Data.Packed.Matrix
39import Numeric.Vector 43import Numeric.Vector
40import Numeric.Chain 44import Numeric.Chain
45import Numeric.MatrixBoot
41import Numeric.LinearAlgebra.Algorithms 46import Numeric.LinearAlgebra.Algorithms
42 47
43------------------------------------------------------------------- 48-------------------------------------------------------------------