hmatrix-0.4.0.0: Linear algebra and numerical computationsSource codeContentsIndex
Numeric.LinearAlgebra.LAPACK
Portabilityportable (uses FFI)
Stabilityprovisional
MaintainerAlberto Ruiz (aruiz at um dot es)
Description
Wrappers for a few LAPACK functions (http://www.netlib.org/lapack).
Synopsis
svdR :: Matrix Double -> (Matrix Double, Vector Double, Matrix Double)
svdRdd :: Matrix Double -> (Matrix Double, Vector Double, Matrix Double)
svdC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector Double, Matrix (Complex Double))
eigC :: Matrix (Complex Double) -> (Vector (Complex Double), Matrix (Complex Double))
eigR :: Matrix Double -> (Vector (Complex Double), Matrix (Complex Double))
eigS :: Matrix Double -> (Vector Double, Matrix Double)
eigH :: Matrix (Complex Double) -> (Vector Double, Matrix (Complex Double))
eigS'
eigH'
linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double
linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
linearSolveLSR :: Matrix Double -> Matrix Double -> Matrix Double
linearSolveLSC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
linearSolveSVDR :: Maybe Double -> Matrix Double -> Matrix Double -> Matrix Double
linearSolveSVDC :: Maybe Double -> Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)
luR :: Matrix Double -> (Matrix Double, [Int])
luC :: Matrix (Complex Double) -> (Matrix (Complex Double), [Int])
cholS :: Matrix Double -> Matrix Double
cholH :: Matrix (Complex Double) -> Matrix (Complex Double)
qrR :: Matrix Double -> (Matrix Double, Vector Double)
qrC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector (Complex Double))
hessR :: Matrix Double -> (Matrix Double, Vector Double)
hessC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector (Complex Double))
schurR :: Matrix Double -> (Matrix Double, Matrix Double)
schurC :: Matrix (Complex Double) -> (Matrix (Complex Double), Matrix (Complex Double))
Documentation
svdR :: Matrix Double -> (Matrix Double, Vector Double, Matrix Double)Source

Wrapper for LAPACK's dgesvd, which computes the full svd decomposition of a real matrix.

(u,s,v)=full svdR m so that m=u <> s <> trans v.

svdRdd :: Matrix Double -> (Matrix Double, Vector Double, Matrix Double)Source

Wrapper for LAPACK's dgesvd, which computes the full svd decomposition of a real matrix.

(u,s,v)=full svdRdd m so that m=u <> s <> trans v.

svdC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector Double, Matrix (Complex Double))Source

Wrapper for LAPACK's zgesvd, which computes the full svd decomposition of a complex matrix.

(u,s,v)=full svdC m so that m=u <> comp s <> trans v.

eigC :: Matrix (Complex Double) -> (Vector (Complex Double), Matrix (Complex Double))Source

Wrapper for LAPACK's zgeev, which computes the eigenvalues and right eigenvectors of a general complex matrix:

if (l,v)=eigC m then m <> v = v <> diag l.

The eigenvectors are the columns of v. The eigenvalues are not sorted.

eigR :: Matrix Double -> (Vector (Complex Double), Matrix (Complex Double))Source

Wrapper for LAPACK's dgeev, which computes the eigenvalues and right eigenvectors of a general real matrix:

if (l,v)=eigR m then m <> v = v <> diag l.

The eigenvectors are the columns of v. The eigenvalues are not sorted.

eigS :: Matrix Double -> (Vector Double, Matrix Double)Source

Wrapper for LAPACK's dsyev, which computes the eigenvalues and right eigenvectors of a symmetric real matrix:

if (l,v)=eigSl m then m <> v = v <> diag l.

The eigenvectors are the columns of v. The eigenvalues are sorted in descending order (use eigS' for ascending order).

eigH :: Matrix (Complex Double) -> (Vector Double, Matrix (Complex Double))Source

Wrapper for LAPACK's zheev, which computes the eigenvalues and right eigenvectors of a hermitian complex matrix:

if (l,v)=eigH m then m <> s v = v <> diag l.

The eigenvectors are the columns of v. The eigenvalues are sorted in descending order (use eigH' for ascending order).

eigS'
eigH'
linearSolveR :: Matrix Double -> Matrix Double -> Matrix DoubleSource
Wrapper for LAPACK's dgesv, which solves a general real linear system (for several right-hand sides) internally using the lu decomposition.
linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)Source
Wrapper for LAPACK's zgesv, which solves a general complex linear system (for several right-hand sides) internally using the lu decomposition.
linearSolveLSR :: Matrix Double -> Matrix Double -> Matrix DoubleSource
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.
linearSolveLSC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)Source
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.
linearSolveSVDRSource
:: Maybe Doublercond
-> Matrix Doublecoefficient matrix
-> Matrix Doubleright hand sides (as columns)
-> Matrix Doublesolution vectors (as columns)
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.
linearSolveSVDCSource
:: Maybe Doublercond
-> Matrix (Complex Double)coefficient matrix
-> Matrix (Complex Double)right hand sides (as columns)
-> Matrix (Complex Double)solution vectors (as columns)
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.
luR :: Matrix Double -> (Matrix Double, [Int])Source
Wrapper for LAPACK's dgetrf, which computes a LU factorization of a general real matrix.
luC :: Matrix (Complex Double) -> (Matrix (Complex Double), [Int])Source
Wrapper for LAPACK's zgees, which computes a Schur factorization of a square complex matrix.
cholS :: Matrix Double -> Matrix DoubleSource
Wrapper for LAPACK's dpotrf, which computes the Cholesky factorization of a real symmetric positive definite matrix.
cholH :: Matrix (Complex Double) -> Matrix (Complex Double)Source
Wrapper for LAPACK's zpotrf, which computes the Cholesky factorization of a complex Hermitian positive definite matrix.
qrR :: Matrix Double -> (Matrix Double, Vector Double)Source
Wrapper for LAPACK's dgeqr2, which computes a QR factorization of a real matrix.
qrC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector (Complex Double))Source
Wrapper for LAPACK's zgeqr2, which computes a QR factorization of a complex matrix.
hessR :: Matrix Double -> (Matrix Double, Vector Double)Source
Wrapper for LAPACK's dgehrd, which computes a Hessenberg factorization of a square real matrix.
hessC :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector (Complex Double))Source
Wrapper for LAPACK's zgehrd, which computes a Hessenberg factorization of a square complex matrix.
schurR :: Matrix Double -> (Matrix Double, Matrix Double)Source
Wrapper for LAPACK's dgees, which computes a Schur factorization of a square real matrix.
schurC :: Matrix (Complex Double) -> (Matrix (Complex Double), Matrix (Complex Double))Source
Wrapper for LAPACK's zgees, which computes a Schur factorization of a square complex matrix.
Produced by Haddock version 2.4.2