From 989bdf7e88c13500bd1986dcde36f6cc4f467efb Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 22 Jun 2007 10:21:15 +0000 Subject: reverting to the old signatures for aux C functions --- examples/pru.hs | 53 ++++++++++++++++++++++++++++++++++++-- lib/Data/Packed/Internal/Common.hs | 39 ++++++++++++++++++++++++++++ lib/Data/Packed/Internal/Matrix.hs | 25 +++++++++++------- lib/Data/Packed/Internal/Vector.hs | 9 ++++--- lib/GSL/Fourier.hs | 2 +- lib/GSL/Minimization.hs | 6 ++--- lib/GSL/Polynomials.hs | 2 +- lib/GSL/Vector.hs | 14 +++++----- lib/LAPACK.hs | 26 +++++++++---------- 9 files changed, 136 insertions(+), 40 deletions(-) diff --git a/examples/pru.hs b/examples/pru.hs index 4a5104b..fb33962 100644 --- a/examples/pru.hs +++ b/examples/pru.hs @@ -164,7 +164,7 @@ contractionF t1 t2 = contraction t1 n1 t2 n2 fn = snd . snd . head . dims -dual vs = foldl' contractionF (leviCivita n) vs +dualV vs = foldl' contractionF (leviCivita n) vs where n = fst . head . dims . head $ vs @@ -175,4 +175,53 @@ dual2 = foldl' contractionF (leviCivita 3) [u,v,w] contract1b t (n1,n2) = contract1 t n1 n2 dual1' = prod (foldl' contract1b ((leviCivita 3) <*> (u /\ v)) [("1","p'"),("2'","q''")]) (scalar (recip $ fact 2)) -dual2' = prod (foldl' contract1b ((leviCivita 3) <*> (u /\ v /\ w)) [("1","p'"),("2'","q''"),("3'","r''")]) (scalar (recip $ fact 3)) \ No newline at end of file +dual2' = prod (foldl' contract1b ((leviCivita 3) <*> (u /\ v /\ w)) [("1","p'"),("2'","q''"),("3'","r''")]) (scalar (recip $ fact 3)) + + +x1 = vector "p" [0,0,1] +x2 = vector "q" [2,2,2] +x3 = vector "r" [-3,-1,-1] +x4 = vector "s" [12,0,3] + +raise (T d v) = T (map raise' d) v + where raise' (n,(Covariant,s)) = (n,(Contravariant,s)) + raise' (n,(Contravariant,s)) = (n,(Covariant,s)) + +dualMV t = prod (foldl' contract1b (lc <*> t) ds) (scalar (recip $ fromIntegral $ fact (length ds))) + where + lc = leviCivita n + nms1 = map (snd.snd) (dims lc) + nms2 = map ((++"'").snd.snd) (dims t) + ds = zip nms1 nms2 + n = fst . head . dims $ t + +-- intersection of two lines :-) +-- > raise $ dualMV $ raise $ dualMV (x1/\x2) /\ dualV [x3,x4] +--(3'^[3]) [24.0,24.0,12.0] + +y1 = vector "p" [0,0,0,1] +y2 = vector "q" [2,2,0,2] +y3 = vector "r" [-3,-1,0,-1] +y4 = vector "s" [12,0,0,3] + +-- why not in R^4? +-- > raise $ dualMV $ raise $ dualMV (y1/\y2) /\ dualV [y3,y4] +-- scalar 0.0 +-- it seems that the sum of ranks must be greater than n :( + +asBase r n = filter (\x-> (x==nub x && x==sort x)) $ sequence $ replicate r [1..n] + +partF t i = part t (name,i) where name = snd . snd . head . dims $ t + +--partL = foldl' partF + +niceAS t = filter ((/=0.0).fst) $ zip vals base + where vals = map ((`at` 0).ten.foldl' partF t) (map (map pred) base) + base = asBase r n + r = length (dims t) + n = fst . head . dims $ t + +z1 = vector "p" [0,0,0,1] +z2 = vector "q" [1,0,0,1] +z3 = vector "r" [0,1,0,1] +z4 = vector "s" [0,0,1,1] diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs index 91985f7..bdd7f34 100644 --- a/lib/Data/Packed/Internal/Common.hs +++ b/lib/Data/Packed/Internal/Common.hs @@ -86,3 +86,42 @@ scast = fromJust . cast {- | conversion of Haskell functions into function pointers that can be used in the C side -} foreign import ccall "wrapper" mkfun:: (Double -> Ptr() -> Double) -> IO( FunPtr (Double -> Ptr() -> Double)) + +--------------------------------------------------- +-- ugly, but my haddock version doesn't understand +-- yet infix type constructors +--------------------------------------------------- +---------- signatures of the C functions ------- +------------------------------------------------ +type PD = Ptr Double -- +type PC = Ptr (Complex Double) -- +type TV = Int -> PD -> IO Int -- +type TVV = Int -> PD -> TV -- +type TVVV = Int -> PD -> TVV -- +type TM = Int -> Int -> PD -> IO Int -- +type TMM = Int -> Int -> PD -> TM -- +type TMMM = Int -> Int -> PD -> TMM -- +type TVM = Int -> PD -> TM -- +type TVVM = Int -> PD -> TVM -- +type TMV = Int -> Int -> PD -> TV -- +type TMVM = Int -> Int -> PD -> TVM -- +type TMMVM = Int -> Int -> PD -> TMVM -- +type TCM = Int -> Int -> PC -> IO Int -- +type TCVCM = Int -> PC -> TCM -- +type TCMCVCM = Int -> Int -> PC -> TCVCM -- +type TMCMCVCM = Int -> Int -> PD -> TCMCVCM -- +type TCMCMCVCM = Int -> Int -> PC -> TCMCVCM -- +type TCMCM = Int -> Int -> PC -> TCM -- +type TVCM = Int -> PD -> TCM -- +type TCMVCM = Int -> Int -> PC -> TVCM -- +type TCMCMVCM = Int -> Int -> PC -> TCMVCM -- +type TCMCMCM = Int -> Int -> PC -> TCMCM -- +type TCV = Int -> PC -> IO Int -- +type TCVCV = Int -> PC -> TCV -- +type TCVCVCV = Int -> PC -> TCVCV -- +type TCMCV = Int -> Int -> PC -> TCV -- +type TVCV = Int -> PD -> TCV -- +type TCVM = Int -> PC -> TM -- +type TMCVM = Int -> Int -> PD -> TCVM -- +type TMMCVM = Int -> Int -> PD -> TMCVM -- +------------------------------------------------ diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index fccf8bb..2925fc0 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs @@ -50,8 +50,9 @@ trans m = m { rows = cols m } type Mt t s = Int -> Int -> Ptr t -> s -infixr 6 ::> -type t ::> s = Mt t s +-- not yet admitted by my haddock version +-- infixr 6 ::> +-- type t ::> s = Mt t s mat d m f = f (rows m) (cols m) (ptr (d m)) @@ -117,9 +118,9 @@ transdataAux fun c1 d c2 = noneed = r1 == 1 || c1 == 1 foreign import ccall safe "aux.h transR" - ctransR :: Double ::> Double ::> IO Int + ctransR :: TMM -- Double ::> Double ::> IO Int foreign import ccall safe "aux.h transC" - ctransC :: Complex Double ::> Complex Double ::> IO Int + ctransC :: TCMCM -- Complex Double ::> Complex Double ::> IO Int transdata :: Field a => Int -> Vector a -> Int -> Vector a transdata c1 d c2 | isReal baseOf d = scast $ transdataR c1 (scast d) c2 @@ -170,10 +171,16 @@ multiplyAux order fun a b = unsafePerformIO $ do return r foreign import ccall safe "aux.h multiplyR" - cmultiplyR :: Int -> Double ::> (Int -> Double ::> (Double ::> IO Int)) + cmultiplyR :: Int -> Int -> Int -> Ptr Double + -> Int -> Int -> Int -> Ptr Double + -> Int -> Int -> Ptr Double + -> IO Int foreign import ccall safe "aux.h multiplyC" - cmultiplyC :: Int -> Complex Double ::> (Int -> Complex Double ::> (Complex Double ::> IO Int)) + cmultiplyC :: Int -> Int -> Int -> Ptr (Complex Double) + -> Int -> Int -> Int -> Ptr (Complex Double) + -> Int -> Int -> Ptr (Complex Double) + -> IO Int multiply :: (Num a, Field a) => MatrixOrder -> Matrix a -> Matrix a -> Matrix a multiply RowMajor a b = multiplyD RowMajor a b @@ -206,7 +213,7 @@ subMatrixR (r0,c0) (rt,ct) x = unsafePerformIO $ do c_submatrixR r0 (r0+rt-1) c0 (c0+ct-1) // mat cdat x // mat cdat r // check "subMatrixR" [dat r] return r foreign import ccall "aux.h submatrixR" - c_submatrixR :: Int -> Int -> Int -> Int -> Double ::> Double ::> IO Int + c_submatrixR :: Int -> Int -> Int -> Int -> TMM -- | extraction of a submatrix of a complex matrix subMatrixC :: (Int,Int) -- ^ (r0,c0) starting position @@ -239,12 +246,12 @@ diagAux fun msg (v@V {dim = n}) = unsafePerformIO $ do -- | diagonal matrix from a real vector diagR :: Vector Double -> Matrix Double diagR = diagAux c_diagR "diagR" -foreign import ccall "aux.h diagR" c_diagR :: Double :> Double ::> IO Int +foreign import ccall "aux.h diagR" c_diagR :: TVM -- | diagonal matrix from a real vector diagC :: Vector (Complex Double) -> Matrix (Complex Double) diagC = diagAux c_diagC "diagC" -foreign import ccall "aux.h diagC" c_diagC :: (Complex Double) :> (Complex Double) ::> IO Int +foreign import ccall "aux.h diagC" c_diagC :: TCVCM -- | diagonal matrix from a vector diag :: (Num a, Field a) => Vector a -> Matrix a diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 125df1e..8848062 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs @@ -21,8 +21,9 @@ import Complex import Control.Monad(when) type Vc t s = Int -> Ptr t -> s -infixr 5 :> -type t :> s = Vc t s +-- not yet admitted by my haddock version +-- infixr 5 :> +-- type t :> s = Vc t s vec :: Vector t -> (Vc t s) -> s vec v f = f (dim v) (ptr v) @@ -118,10 +119,10 @@ constantAux fun n x = unsafePerformIO $ do return v foreign import ccall safe "aux.h constantR" - cconstantR :: Ptr Double -> Double :> IO Int + cconstantR :: Ptr Double -> TV -- Double :> IO Int foreign import ccall safe "aux.h constantC" - cconstantC :: Ptr (Complex Double) -> Complex Double :> IO Int + cconstantC :: Ptr (Complex Double) -> TCV -- Complex Double :> IO Int constant :: Field a => Int -> a -> Vector a constant n x | isReal id x = scast $ constantR n (scast x) diff --git a/lib/GSL/Fourier.hs b/lib/GSL/Fourier.hs index c8c79f0..bf6cd60 100644 --- a/lib/GSL/Fourier.hs +++ b/lib/GSL/Fourier.hs @@ -29,7 +29,7 @@ genfft code v = unsafePerformIO $ do c_fft code // vec v // vec r // check "fft" [v] return r -foreign import ccall "gsl-aux.h fft" c_fft :: Int -> Complex Double :> Complex Double :> IO Int +foreign import ccall "gsl-aux.h fft" c_fft :: Int -> TCVCV -- Complex Double :> Complex Double :> IO Int {- | Fast 1D Fourier transform of a 'Vector' @(@'Complex' 'Double'@)@ using /gsl_fft_complex_forward/. It uses the same scaling conventions as GNU Octave. diff --git a/lib/GSL/Minimization.hs b/lib/GSL/Minimization.hs index bc228a7..32b266f 100644 --- a/lib/GSL/Minimization.hs +++ b/lib/GSL/Minimization.hs @@ -97,7 +97,7 @@ minimizeNMSimplex f xi sz tol maxit = unsafePerformIO $ do foreign import ccall "gsl-aux.h minimize" c_minimizeNMSimplex:: FunPtr (Int -> Ptr Double -> Double) -> Double -> Int - -> Double :> Double :> Double ::> IO Int + -> TVVM -- Double :> Double :> Double ::> IO Int ---------------------------------------------------------------------------------- @@ -164,8 +164,8 @@ minimizeConjugateGradient istep minimpar tol maxit f df xi = unsafePerformIO $ d foreign import ccall "gsl-aux.h minimizeWithDeriv" c_minimizeConjugateGradient :: FunPtr (Int -> Ptr Double -> Double) -> FunPtr (Int -> Ptr Double -> Ptr Double -> IO ()) - -> Double -> Double -> Double -> Int - -> Double :> Double ::> IO Int + -> Double -> Double -> Double -> Int + -> TVM -- Double :> Double ::> IO Int --------------------------------------------------------------------- iv :: (Vector Double -> Double) -> (Int -> Ptr Double -> Double) diff --git a/lib/GSL/Polynomials.hs b/lib/GSL/Polynomials.hs index d7db9a3..365c74e 100644 --- a/lib/GSL/Polynomials.hs +++ b/lib/GSL/Polynomials.hs @@ -51,4 +51,4 @@ polySolve' v | dim v > 1 = unsafePerformIO $ do return r | otherwise = error "polySolve on a polynomial of degree zero" -foreign import ccall "gsl-aux.h polySolve" c_polySolve:: Double :> Complex Double :> IO Int +foreign import ccall "gsl-aux.h polySolve" c_polySolve:: TVCV -- Double :> Complex Double :> IO Int diff --git a/lib/GSL/Vector.hs b/lib/GSL/Vector.hs index 3225139..fc80c16 100644 --- a/lib/GSL/Vector.hs +++ b/lib/GSL/Vector.hs @@ -122,7 +122,7 @@ toScalarR :: FunCodeS -> Vector Double -> Double toScalarR oper = toScalarAux c_toScalarR (fromEnum oper) foreign import ccall safe "gsl-aux.h toScalarR" - c_toScalarR :: Int -> Double :> Double :> IO Int + c_toScalarR :: Int -> TVV -- Double :> Double :> IO Int ------------------------------------------------------------------ @@ -131,14 +131,14 @@ vectorMapR :: FunCodeV -> Vector Double -> Vector Double vectorMapR = vectorMapAux c_vectorMapR foreign import ccall safe "gsl-aux.h mapR" - c_vectorMapR :: Int -> Double :> Double :> IO Int + c_vectorMapR :: Int -> TVV -- Double :> Double :> IO Int -- | map of complex vectors with given function vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) vectorMapC oper = vectorMapAux c_vectorMapC (fromEnum oper) foreign import ccall safe "gsl-aux.h mapC" - c_vectorMapC :: Int -> Complex Double :> Complex Double :> IO Int + c_vectorMapC :: Int -> TCVCV -- Complex Double :> Complex Double :> IO Int ------------------------------------------------------------------- @@ -147,14 +147,14 @@ vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromEnum oper) foreign import ccall safe "gsl-aux.h mapValR" - c_vectorMapValR :: Int -> Ptr Double -> Double :> Double :> IO Int + c_vectorMapValR :: Int -> Ptr Double -> TVV -- Double :> Double :> IO Int -- | map of complex vectors with given function vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) vectorMapValC = vectorMapValAux c_vectorMapValC foreign import ccall safe "gsl-aux.h mapValC" - c_vectorMapValC :: Int -> Ptr (Complex Double) -> Complex Double :> Complex Double :> IO Int + c_vectorMapValC :: Int -> Ptr (Complex Double) -> TCVCV -- Complex Double :> Complex Double :> IO Int ------------------------------------------------------------------- @@ -163,13 +163,13 @@ vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double vectorZipR = vectorZipAux c_vectorZipR foreign import ccall safe "gsl-aux.h zipR" - c_vectorZipR :: Int -> Double :> Double :> Double :> IO Int + c_vectorZipR :: Int -> TVVV -- Double :> Double :> Double :> IO Int -- | elementwise operation on complex vectors vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) vectorZipC = vectorZipAux c_vectorZipC foreign import ccall safe "gsl-aux.h zipC" - c_vectorZipC :: Int -> Complex Double :> Complex Double :> Complex Double :> IO Int + c_vectorZipC :: Int -> TCVCVCV -- Complex Double :> Complex Double :> Complex Double :> IO Int diff --git a/lib/LAPACK.hs b/lib/LAPACK.hs index 1531cfb..dc9eda1 100644 --- a/lib/LAPACK.hs +++ b/lib/LAPACK.hs @@ -32,7 +32,7 @@ import Foreign ----------------------------------------------------------------------------- -- dgesvd foreign import ccall "LAPACK/lapack-aux.h svd_l_R" - dgesvd :: Double ::> Double ::> (Double :> Double ::> IO Int) + dgesvd :: TMMVM -- Double ::> Double ::> (Double :> Double ::> IO Int) -- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix. -- @@ -50,7 +50,7 @@ svdR' x@M {rows = r, cols = c} = unsafePerformIO $ do ----------------------------------------------------------------------------- -- dgesdd foreign import ccall "LAPACK/lapack-aux.h svd_l_Rdd" - dgesdd :: Double ::> Double ::> (Double :> Double ::> IO Int) + dgesdd :: TMMVM --Double ::> Double ::> (Double :> Double ::> IO Int) -- | Wrapper for LAPACK's /dgesvd/, which computes the full svd decomposition of a real matrix. -- @@ -68,7 +68,7 @@ svdRdd' x@M {rows = r, cols = c} = unsafePerformIO $ do ----------------------------------------------------------------------------- -- zgesvd foreign import ccall "LAPACK/lapack-aux.h svd_l_C" - zgesvd :: (Complex Double) ::> (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) + zgesvd :: TCMCMVCM -- (Complex Double) ::> (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) -- | Wrapper for LAPACK's /zgesvd/, which computes the full svd decomposition of a complex matrix. -- @@ -87,7 +87,7 @@ svdC' x@M {rows = r, cols = c} = unsafePerformIO $ do ----------------------------------------------------------------------------- -- zgeev foreign import ccall "LAPACK/lapack-aux.h eig_l_C" - zgeev :: (Complex Double) ::> (Complex Double) ::> ((Complex Double) :> (Complex Double) ::> IO Int) + zgeev :: TCMCMCVCM -- (Complex Double) ::> (Complex Double) ::> ((Complex Double) :> (Complex Double) ::> IO Int) -- | Wrapper for LAPACK's /zgeev/, which computes the eigenvalues and right eigenvectors of a general complex matrix: -- @@ -108,7 +108,7 @@ eigC (m@M {rows = r}) ----------------------------------------------------------------------------- -- dgeev foreign import ccall "LAPACK/lapack-aux.h eig_l_R" - dgeev :: Double ::> Double ::> ((Complex Double) :> Double ::> IO Int) + dgeev :: TMMCVM -- Double ::> Double ::> ((Complex Double) :> Double ::> IO Int) -- | Wrapper for LAPACK's /dgeev/, which computes the eigenvalues and right eigenvectors of a general real matrix: -- @@ -144,7 +144,7 @@ scale r v = fromList [r] `outer` v ----------------------------------------------------------------------------- -- dsyev foreign import ccall "LAPACK/lapack-aux.h eig_l_S" - dsyev :: Double ::> (Double :> Double ::> IO Int) + dsyev :: TMVM -- Double ::> (Double :> Double ::> IO Int) -- | Wrapper for LAPACK's /dsyev/, which computes the eigenvalues and right eigenvectors of a symmetric real matrix: -- @@ -168,7 +168,7 @@ eigS' (m@M {rows = r}) ----------------------------------------------------------------------------- -- zheev foreign import ccall "LAPACK/lapack-aux.h eig_l_H" - zheev :: (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) + zheev :: TCMVCM -- (Complex Double) ::> (Double :> (Complex Double) ::> IO Int) -- | Wrapper for LAPACK's /zheev/, which computes the eigenvalues and right eigenvectors of a hermitian complex matrix: -- @@ -192,7 +192,7 @@ eigH' (m@M {rows = r}) ----------------------------------------------------------------------------- -- dgesv foreign import ccall "LAPACK/lapack-aux.h linearSolveR_l" - dgesv :: Double ::> Double ::> Double ::> IO Int + dgesv :: TMMM -- Double ::> Double ::> Double ::> IO Int -- | Wrapper for LAPACK's /dgesv/, which solves a general real linear system (for several right-hand sides) internally using the lu decomposition. linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double @@ -206,7 +206,7 @@ linearSolveR a@(M {rows = n1, cols = n2}) b@(M {rows = r, cols = c}) ----------------------------------------------------------------------------- -- zgesv foreign import ccall "LAPACK/lapack-aux.h linearSolveC_l" - zgesv :: (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int + zgesv :: TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int -- | Wrapper for LAPACK's /zgesv/, which solves a general complex linear system (for several right-hand sides) internally using the lu decomposition. linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) @@ -220,7 +220,7 @@ linearSolveC a@(M {rows = n1, cols = n2}) b@(M {rows = r, cols = c}) ----------------------------------------------------------------------------------- -- dgels foreign import ccall "LAPACK/lapack-aux.h linearSolveLSR_l" - dgels :: Double ::> Double ::> Double ::> IO Int + dgels :: TMMM -- Double ::> Double ::> Double ::> IO Int -- | Wrapper for LAPACK's /dgels/, which obtains the least squared error solution of an overconstrained real linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDR'. linearSolveLSR :: Matrix Double -> Matrix Double -> Matrix Double @@ -234,7 +234,7 @@ linearSolveLSR_l a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafePerformI ----------------------------------------------------------------------------------- -- zgels foreign import ccall "LAPACK/lapack-aux.h linearSolveLSC_l" - zgels :: (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int + zgels :: TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int -- | Wrapper for LAPACK's /zgels/, which obtains the least squared error solution of an overconstrained complex linear system or the minimum norm solution of an underdetermined system, for several right-hand sides. For rank deficient systems use 'linearSolveSVDC'. linearSolveLSC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) @@ -248,7 +248,7 @@ linearSolveLSC_l a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafePerformI ----------------------------------------------------------------------------------- -- dgelss foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDR_l" - dgelss :: Double -> Double ::> Double ::> Double ::> IO Int + dgelss :: Double -> TMMM -- Double ::> Double ::> Double ::> IO Int -- | Wrapper for LAPACK's /dgelss/, which obtains the minimum norm solution to a real linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSR'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used. linearSolveSVDR :: Maybe Double -- ^ rcond @@ -266,7 +266,7 @@ linearSolveSVDR_l rcond a@(M {rows = m, cols = n}) b@(M {cols = nrhs}) = unsafeP ----------------------------------------------------------------------------------- -- zgelss foreign import ccall "LAPACK/lapack-aux.h linearSolveSVDC_l" - zgelss :: Double -> (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int + zgelss :: Double -> TCMCMCM -- (Complex Double) ::> (Complex Double) ::> (Complex Double) ::> IO Int -- | Wrapper for LAPACK's /zgelss/, which obtains the minimum norm solution to a complex linear least squares problem Ax=B using the svd, for several right-hand sides. Admits rank deficient systems but it is slower than 'linearSolveLSC'. The effective rank of A is determined by treating as zero those singular valures which are less than rcond times the largest singular value. If rcond == Nothing machine precision is used. linearSolveSVDC :: Maybe Double -- ^ rcond -- cgit v1.2.3