data BLASBackend { } #
PureHaskell

Pure Haskell implementation

OpenBLAS

OpenBLAS library

MKL

Intel Math Kernel Library

BLIS

BLAS-like Library Instantiation Software

AppleAccelerate

Apple Accelerate framework

CUDA

NVIDIA cuBLAS

ROCm

AMD rocBLAS

data MatrixOrder { } #
RowMajor

C-style row-major (default)

ColMajor

Fortran-style column-major

data Transpose { } #
NoTrans

No transpose

Trans

Transpose

ConjTrans

Conjugate transpose

Transpose operation specification.
data UpLo { } #
Upper

Upper triangular

Lower

Lower triangular

Upper/lower triangular specification.
data Diag { } #
NonUnit

Non-unit diagonal

Unit

Unit diagonal (implicit 1s)

Diagonal specification.
data Side { } #
LeftSide

Operation from left

RightSide

Operation from right

Side specification for matrix operations.
class Eq a, Num a => BLASNum a { } #

Methods

blasZero :: a
blasOne :: a
Types supporting BLAS operations.
class BLASNum a => BLASReal a { } #
Real BLAS types (Float, Double).
class BLASNum a => BLASComplex a { } #

Methods

conjg :: a -> a
realPart :: a -> a
imagPart :: a -> a
Complex BLAS types.
setBackend :: BLASBackend -> IO () { } #
Set active BLAS backend.
getBackend :: IO BLASBackend { } #
Get current BLAS backend.
availableBackends :: IO [BLASBackend] { } #
List available backends on this system.
matrix :: (BLASNum a) => Int -> Int -> ((Int, Int) -> a) -> Matrix a { } #
Create matrix from dimensions and function.
fromRows :: (BLASNum a) => [[a]] -> Matrix a { } #
Create matrix from list of rows.
fromCols :: (BLASNum a) => [[a]] -> Matrix a { } #
Create matrix from list of columns.
fromList :: (BLASNum a) => Int -> Int -> [a] -> Matrix a { } #
Create matrix from flat list with dimensions.
zeros :: (BLASNum a) => Int -> Int -> Matrix a { } #
Zero matrix.
ones :: (BLASNum a) => Int -> Int -> Matrix a { } #
Matrix of ones.
identity :: (BLASNum a) => Int -> Matrix a { } #
Identity matrix.
diagonal :: (BLASNum a) => [a] -> Matrix a { } #
Diagonal matrix from vector.
fill :: (BLASNum a) => Int -> Int -> a -> Matrix a { } #
Fill matrix with constant.
rows :: (Matrix a) -> Int { } #
Number of rows.
cols :: (Matrix a) -> Int { } #
Number of columns.
shape :: (Matrix a) -> (Int, Int) { } #
Shape as (rows, cols).
size :: (Matrix a) -> Int { } #
Total number of elements.
order :: (Matrix a) -> MatrixOrder { } #
Storage order.
isSquare :: (Matrix a) -> Bool { } #
Check if square.
isSymmetric :: (BLASNum a) => (Matrix a) -> Bool { } #
Check if symmetric.
isHermitian :: (BLASComplex a) => (Matrix a) -> Bool { } #
Check if Hermitian.
isUpperTriangular :: (BLASNum a) => (Matrix a) -> Bool { } #
Check if upper triangular.
isLowerTriangular :: (BLASNum a) => (Matrix a) -> Bool { } #
Check if lower triangular.
row :: (BLASNum a) => Int -> (Matrix a) -> [a] { } #
col :: (BLASNum a) => Int -> (Matrix a) -> [a] { } #
Extract column as vector.
diag :: (BLASNum a) => (Matrix a) -> [a] { } #
Extract diagonal.
slice :: (BLASNum a) => (Int, Int) -> (Int, Int) -> (Matrix a) -> Matrix a { } #
Slice submatrix.
submatrix :: (BLASNum a) => Int -> Int -> Int -> Int -> (Matrix a) -> Matrix a { } #
Extract submatrix.
transpose :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Transpose matrix.
conjugateTranspose :: (BLASComplex a) => (Matrix a) -> Matrix a { } #
Conjugate transpose.
reshape :: (BLASNum a) => Int -> Int -> (Matrix a) -> Matrix a { } #
Reshape matrix.
flatten :: (BLASNum a) => (Matrix a) -> [a] { } #
Flatten to vector.
asContiguous :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Force contiguous storage.
asRowMajor :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Convert to row-major order.
asColMajor :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Convert to column-major order.
rotg :: (BLASReal a) => a -> a -> (a, a, a, a) { } #
Generate Givens rotation.
rotmg :: (BLASReal a) => a -> a -> a -> a -> (a, [a]) { } #
Generate modified Givens rotation.
rot :: (BLASReal a) => [a] -> [a] -> a -> a -> ([a], [a]) { } #
Apply Givens rotation.
rotm :: (BLASReal a) => [a] -> [a] -> [a] -> ([a], [a]) { } #
Apply modified Givens rotation.
swap :: (BLASNum a) => [a] -> [a] -> ([a], [a]) { } #
Swap two vectors.
scal :: (BLASNum a) => a -> [a] -> [a] { } #
Scale vector: x = α·x
copy :: (BLASNum a) => [a] -> [a] { } #
Copy vector: y = x
axpy :: (BLASNum a) => a -> [a] -> [a] -> [a] { } #
Vector update: y = α·x + y
dot :: (BLASReal a) => [a] -> [a] -> a { } #
Dot product: x·y
dotu :: (BLASComplex a) => [a] -> [a] -> a { } #
Unconjugated complex dot product.
dotc :: (BLASComplex a) => [a] -> [a] -> a { } #
Conjugated complex dot product.
sdot :: [Float] -> [Float] -> Double { } #
Single precision dot with double accumulation.
nrm2 :: (BLASNum a) => [a] -> a { } #
Euclidean norm: ||x||₂
asum :: (BLASNum a) => [a] -> a { } #
Sum of absolute values.
iamax :: (BLASNum a) => [a] -> Int { } #
Index of maximum absolute value.
gemv :: (BLASNum a) => Transpose -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
General matrix-vector: y = α·op(A)·x + β·y
gbmv :: (BLASNum a) => Transpose -> Int -> Int -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
General banded matrix-vector.
hemv :: (BLASComplex a) => UpLo -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
Hermitian matrix-vector: y = α·A·x + β·y
hbmv :: (BLASComplex a) => UpLo -> Int -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
Hermitian banded matrix-vector.
hpmv :: (BLASComplex a) => UpLo -> a -> [a] -> [a] -> a -> [a] -> [a] { } #
Hermitian packed matrix-vector.
symv :: (BLASReal a) => UpLo -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
Symmetric matrix-vector: y = α·A·x + β·y
sbmv :: (BLASReal a) => UpLo -> Int -> a -> (Matrix a) -> [a] -> a -> [a] -> [a] { } #
Symmetric banded matrix-vector.
spmv :: (BLASReal a) => UpLo -> a -> [a] -> [a] -> a -> [a] -> [a] { } #
Symmetric packed matrix-vector.
trmv :: (BLASNum a) => UpLo -> Transpose -> Diag -> (Matrix a) -> [a] -> [a] { } #
Triangular matrix-vector: x = op(A)·x
tbmv :: (BLASNum a) => UpLo -> Transpose -> Diag -> Int -> (Matrix a) -> [a] -> [a] { } #
Triangular banded matrix-vector.
tpmv :: (BLASNum a) => UpLo -> Transpose -> Diag -> [a] -> [a] -> [a] { } #
Triangular packed matrix-vector.
trsv :: (BLASNum a) => UpLo -> Transpose -> Diag -> (Matrix a) -> [a] -> [a] { } #
Triangular solve: x = op(A)⁻¹·x
tbsv :: (BLASNum a) => UpLo -> Transpose -> Diag -> Int -> (Matrix a) -> [a] -> [a] { } #
Triangular banded solve.
tpsv :: (BLASNum a) => UpLo -> Transpose -> Diag -> [a] -> [a] -> [a] { } #
Triangular packed solve.
ger :: (BLASReal a) => a -> [a] -> [a] -> (Matrix a) -> Matrix a { } #
Rank-1 update: A = α·x·yᵀ + A
geru :: (BLASComplex a) => a -> [a] -> [a] -> (Matrix a) -> Matrix a { } #
Unconjugated rank-1 update.
gerc :: (BLASComplex a) => a -> [a] -> [a] -> (Matrix a) -> Matrix a { } #
Conjugated rank-1 update.
her :: (BLASComplex a) => UpLo -> a -> [a] -> (Matrix a) -> Matrix a { } #
Hermitian rank-1 update: A = α·x·x^H + A
hpr :: (BLASComplex a) => UpLo -> a -> [a] -> [a] -> [a] { } #
Hermitian packed rank-1 update.
her2 :: (BLASComplex a) => UpLo -> a -> [a] -> [a] -> (Matrix a) -> Matrix a { } #
Hermitian rank-2 update.
hpr2 :: (BLASComplex a) => UpLo -> a -> [a] -> [a] -> [a] -> [a] { } #
Hermitian packed rank-2 update.
syr :: (BLASReal a) => UpLo -> a -> [a] -> (Matrix a) -> Matrix a { } #
Symmetric rank-1 update: A = α·x·xᵀ + A
spr :: (BLASReal a) => UpLo -> a -> [a] -> [a] -> [a] { } #
Symmetric packed rank-1 update.
syr2 :: (BLASReal a) => UpLo -> a -> [a] -> [a] -> (Matrix a) -> Matrix a { } #
Symmetric rank-2 update.
spr2 :: (BLASReal a) => UpLo -> a -> [a] -> [a] -> [a] -> [a] { } #
Symmetric packed rank-2 update.
gemm :: (BLASNum a) => Transpose -> Transpose -> a -> (Matrix a) -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
General matrix-matrix: C = α·op(A)·op(B) + β·C
gemmBatched :: (BLASNum a) => Transpose -> Transpose -> a -> [Matrix a] -> [Matrix a] -> a -> [Matrix a] -> [Matrix a] { } #
Batched matrix multiply.
symm :: (BLASReal a) => Side -> UpLo -> a -> (Matrix a) -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Symmetric matrix-matrix: C = α·A·B + β·C or C = α·B·A + β·C
hemm :: (BLASComplex a) => Side -> UpLo -> a -> (Matrix a) -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Hermitian matrix-matrix.
syrk :: (BLASReal a) => UpLo -> Transpose -> a -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Symmetric rank-k update: C = α·A·Aᵀ + β·C
herk :: (BLASComplex a) => UpLo -> Transpose -> a -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Hermitian rank-k update: C = α·A·A^H + β·C
syr2k :: (BLASReal a) => UpLo -> Transpose -> a -> (Matrix a) -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Symmetric rank-2k update.
her2k :: (BLASComplex a) => UpLo -> Transpose -> a -> (Matrix a) -> (Matrix a) -> a -> (Matrix a) -> Matrix a { } #
Hermitian rank-2k update.
trmm :: (BLASNum a) => Side -> UpLo -> Transpose -> Diag -> a -> (Matrix a) -> (Matrix a) -> Matrix a { } #
Triangular matrix-matrix: B = α·op(A)·B or B = α·B·op(A)
trsm :: (BLASNum a) => Side -> UpLo -> Transpose -> Diag -> a -> (Matrix a) -> (Matrix a) -> Matrix a { } #
Triangular solve: B = α·op(A)⁻¹·B or B = α·B·op(A)⁻¹
matmul :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Simple matrix multiply: C = A·B
@@ :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Infix matrix multiply.
outer :: (BLASNum a) => [a] -> [a] -> Matrix a { } #
Outer product: A = x·yᵀ
vdot :: (BLASNum a) => [a] -> [a] -> a { } #
Vector dot product.
vnorm :: (BLASNum a) => [a] -> a { } #
Vector 2-norm.
vnorm1 :: (BLASNum a) => [a] -> a { } #
Vector 1-norm.
vnormInf :: (BLASNum a) => [a] -> a { } #
Vector infinity norm.
vscale :: (BLASNum a) => a -> [a] -> [a] { } #
Scale vector.
vadd :: (BLASNum a) => [a] -> [a] -> [a] { } #
Vector addition.
vsub :: (BLASNum a) => [a] -> [a] -> [a] { } #
Vector subtraction.
vmul :: (BLASNum a) => [a] -> [a] -> [a] { } #
Element-wise vector multiply.
madd :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Matrix addition.
msub :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Matrix subtraction.
mmul :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Element-wise matrix multiply.
mscale :: (BLASNum a) => a -> (Matrix a) -> Matrix a { } #
Scale matrix.
trace :: (BLASNum a) => (Matrix a) -> a { } #
Matrix trace.
det :: (BLASNum a) => (Matrix a) -> a { } #
Matrix determinant (via LU decomposition).
rank :: (BLASNum a) => (Matrix a) -> Int { } #
Matrix rank.
cond :: (BLASNum a) => (Matrix a) -> a { } #
Condition number.
solve :: (BLASNum a) => (Matrix a) -> (Matrix a) -> Matrix a { } #
Solve linear system A·X = B.
inv :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Matrix inverse.
pinv :: (BLASNum a) => (Matrix a) -> Matrix a { } #
Moore-Penrose pseudo-inverse.
lu :: (BLASNum a) => (Matrix a) -> (Matrix a, Matrix a, [Int]) { } #
LU decomposition with partial pivoting.
qr :: (BLASNum a) => (Matrix a) -> (Matrix a, Matrix a) { } #
QR decomposition.
cholesky :: (BLASNum a) => UpLo -> (Matrix a) -> Matrix a { } #
Cholesky decomposition.
svd :: (BLASNum a) => (Matrix a) -> (Matrix a, [a], Matrix a) { } #
Singular value decomposition.
eig :: (BLASNum a) => (Matrix a) -> ([a], Matrix a) { } #
Eigenvalue decomposition.
schur :: (BLASNum a) => (Matrix a) -> (Matrix a, Matrix a) { } #
Schur decomposition.
thaw :: (BLASNum a) => (Matrix a) -> ST s (MMatrix s a) { } #
Convert to mutable matrix.
freeze :: (BLASNum a) => (MMatrix s a) -> ST s (Matrix a) { } #
Convert to immutable matrix.
unsafeThaw :: (BLASNum a) => (Matrix a) -> ST s (MMatrix s a) { } #
Unsafe thaw (no copy).
unsafeFreeze :: (BLASNum a) => (MMatrix s a) -> ST s (Matrix a) { } #
Unsafe freeze (no copy).
create :: (BLASNum a) => (forall s. ST s (MMatrix s a)) -> Matrix a { } #
Create matrix via mutable computation.
gemmInPlace :: (BLASNum a) => Transpose -> Transpose -> a -> (Matrix a) -> (Matrix a) -> a -> (MMatrix s a) -> ST s () { } #
In-place GEMM.
scalInPlace :: (BLASNum a) => a -> (MMatrix s a) -> ST s () { } #
In-place scale.
axpyInPlace :: (BLASNum a) => a -> [a] -> (MMatrix s a) -> ST s () { } #
In-place axpy.
copyInPlace :: (BLASNum a) => (Matrix a) -> (MMatrix s a) -> ST s () { } #
In-place copy.
instance BLASNum Float { }
instance BLASNum Double { }
instance BLASReal Float { }
instance BLASReal Double { }