summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs3
-rw-r--r--lib/Data/Packed/Matrix.hs4
-rw-r--r--lib/Numeric/Container.hs2
-rw-r--r--lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h4
-rw-r--r--lib/Numeric/Matrix.hs2
5 files changed, 10 insertions, 5 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index 090826d..c0824a3 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -246,7 +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.
249class (Storable a, Floating a) => Element a where 249--class (Storable a, Floating a) => Element a where
250class (Storable a) => Element a where
250 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position 251 subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position
251 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix 252 -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix
252 -> Matrix a -> Matrix a 253 -> Matrix a -> Matrix a
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs
index 0fc7876..b8c309c 100644
--- a/lib/Data/Packed/Matrix.hs
+++ b/lib/Data/Packed/Matrix.hs
@@ -170,7 +170,7 @@ fliprl m = fromColumns . reverse . toColumns $ m
170------------------------------------------------------------ 170------------------------------------------------------------
171 171
172-- | Creates a square matrix with a given diagonal. 172-- | Creates a square matrix with a given diagonal.
173diag :: Element a => Vector a -> Matrix a 173diag :: (Num a, Element a) => Vector a -> Matrix a
174diag v = ST.runSTMatrix $ do 174diag v = ST.runSTMatrix $ do
175 let d = dim v 175 let d = dim v
176 m <- ST.newMatrix 0 d d 176 m <- ST.newMatrix 0 d d
@@ -199,7 +199,7 @@ takeDiag :: (Element t) => Matrix t -> Vector t
199takeDiag m = fromList [flatten m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]] 199takeDiag m = fromList [flatten m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]]
200 200
201-- | creates the identity matrix of given dimension 201-- | creates the identity matrix of given dimension
202ident :: Element a => Int -> Matrix a 202ident :: (Num a, Element a) => Int -> Matrix a
203ident n = diag (constantD 1 n) 203ident n = diag (constantD 1 n)
204 204
205------------------------------------------------------------ 205------------------------------------------------------------
diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs
index 8cf3e07..83bf44e 100644
--- a/lib/Numeric/Container.hs
+++ b/lib/Numeric/Container.hs
@@ -62,7 +62,7 @@ type instance IndexOf Matrix = (Int,Int)
62------------------------------------------------------------------- 62-------------------------------------------------------------------
63 63
64-- | Basic element-by-element functions for numeric containers 64-- | Basic element-by-element functions for numeric containers
65class (Complexable c, Element e) => Container c e where 65class (Complexable c, Fractional e, Element e) => Container c e where
66 -- | create a structure with a single element 66 -- | create a structure with a single element
67 scalar :: e -> c e 67 scalar :: e -> c e
68 -- | complex conjugate 68 -- | complex conjugate
diff --git a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
index 12dcde4..0543f7a 100644
--- a/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
+++ b/lib/Numeric/LinearAlgebra/LAPACK/lapack-aux.h
@@ -64,18 +64,22 @@ typedef short ftnlen;
64 64
65/********************************************************/ 65/********************************************************/
66 66
67int multiplyF(int ta, int tb, KFMAT(a),KFMAT(b),FMAT(r));
67int multiplyR(int ta, int tb, KDMAT(a),KDMAT(b),DMAT(r)); 68int multiplyR(int ta, int tb, KDMAT(a),KDMAT(b),DMAT(r));
68int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r)); 69int multiplyC(int ta, int tb, KCMAT(a),KCMAT(b),CMAT(r));
70int multiplyQ(int ta, int tb, KQMAT(a),KQMAT(b),QMAT(r));
69 71
70int transF(KFMAT(x),FMAT(t)); 72int transF(KFMAT(x),FMAT(t));
71int transR(KDMAT(x),DMAT(t)); 73int transR(KDMAT(x),DMAT(t));
72int transQ(KQMAT(x),QMAT(t)); 74int transQ(KQMAT(x),QMAT(t));
73int transC(KCMAT(x),CMAT(t)); 75int transC(KCMAT(x),CMAT(t));
76int transP(KPMAT(x),PMAT(t));
74 77
75int constantF(float * pval, FVEC(r)); 78int constantF(float * pval, FVEC(r));
76int constantR(double * pval, DVEC(r)); 79int constantR(double * pval, DVEC(r));
77int constantQ(complex* pval, QVEC(r)); 80int constantQ(complex* pval, QVEC(r));
78int constantC(doublecomplex* pval, CVEC(r)); 81int constantC(doublecomplex* pval, CVEC(r));
82int constantP(void* pval, PVEC(r));
79 83
80int float2double(FVEC(x),DVEC(y)); 84int float2double(FVEC(x),DVEC(y));
81int double2float(DVEC(x),FVEC(y)); 85int double2float(DVEC(x),FVEC(y));
diff --git a/lib/Numeric/Matrix.hs b/lib/Numeric/Matrix.hs
index f78e0c2..d5c6f44 100644
--- a/lib/Numeric/Matrix.hs
+++ b/lib/Numeric/Matrix.hs
@@ -63,7 +63,7 @@ instance (Container Vector a, Fractional (Vector a), Num (Matrix a)) => Fraction
63 63
64--------------------------------------------------------- 64---------------------------------------------------------
65 65
66instance (Container Vector a, Floating (Vector a), Fractional (Matrix a)) => Floating (Matrix a) where 66instance (Floating a, Container Vector a, Floating (Vector a), Fractional (Matrix a)) => Floating (Matrix a) where
67 sin = liftMatrix sin 67 sin = liftMatrix sin
68 cos = liftMatrix cos 68 cos = liftMatrix cos
69 tan = liftMatrix tan 69 tan = liftMatrix tan