CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
Loading...
Searching...
No Matches
Matrix-Matrix Operations

High-performance matrix multiplications (GEMM). More...

Functions

template<typename T_Scalar>
void cla3p::ops::mult (T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, op_t opB, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
 Updates a general matrix with a matrix-matrix product.
template<typename T_Scalar>
void cla3p::ops::trimult (T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, dns::XxMatrix< T_Scalar > &B)
 Replaces a matrix with a scaled triangular matrix-matrix product.
template<typename T_Scalar>
void cla3p::ops::trimult (T_Scalar alpha, dns::XxMatrix< T_Scalar > &B, op_t opA, const dns::XxMatrix< T_Scalar > &A)
 Replaces a matrix with a scaled triangular matrix-matrix product.
template<typename T_Scalar>
void cla3p::ops::trisol (T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, dns::XxMatrix< T_Scalar > &B)
 Replaces a matrix with the scaled solution of a triangular system.
template<typename T_Scalar>
void cla3p::ops::trisol (T_Scalar alpha, dns::XxMatrix< T_Scalar > &B, op_t opA, const dns::XxMatrix< T_Scalar > &A)
 Replaces a matrix with the scaled solution of a triangular system.
template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult (T_Scalar alpha, op_t opA, const csr::XxMatrix< T_Int, T_Scalar > &A, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
 Updates a general dense matrix with a sparse-dense matrix-matrix product.
template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult (T_Scalar alpha, op_t opA, const csc::XxMatrix< T_Int, T_Scalar > &A, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
 Updates a general dense matrix with a sparse-dense matrix-matrix product.
template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult (T_Scalar alpha, op_t opA, const csr::XxMatrix< T_Int, T_Scalar > &A, op_t opB, const csr::XxMatrix< T_Int, T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
 Updates a dense matrix with a sparse-sparse matrix-matrix product.
template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult (T_Scalar alpha, op_t opA, const csc::XxMatrix< T_Int, T_Scalar > &A, op_t opB, const csc::XxMatrix< T_Int, T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C)
 Updates a dense matrix with a sparse-sparse matrix-matrix product.
template<typename T_Int, typename T_Scalar>
csr::XxMatrix< T_Int, T_Scalar > cla3p::ops::mult (T_Scalar alpha, op_t opA, const csr::XxMatrix< T_Int, T_Scalar > &A, op_t opB, const csr::XxMatrix< T_Int, T_Scalar > &B)
 Creates a general sparse matrix from a sparse-sparse matrix-matrix product.
template<typename T_Int, typename T_Scalar>
csc::XxMatrix< T_Int, T_Scalar > cla3p::ops::mult (T_Scalar alpha, op_t opA, const csc::XxMatrix< T_Int, T_Scalar > &A, op_t opB, const csc::XxMatrix< T_Int, T_Scalar > &B)
 Creates a general sparse matrix from a sparse-sparse matrix-matrix product.

Detailed Description

High-performance matrix multiplications (GEMM).

Function Documentation

◆ mult() [1/7]

template<typename T_Scalar>
void cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const dns::XxMatrix< T_Scalar > & A,
op_t opB,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C )

Updates a general matrix with a matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot op_B(B) \). C can be General/Symmetric/Hermitian. If C is Symmetric/Hermitian, it is assumed that the outcome of the operation \( op_A(A) \cdot op_B(B) \) is also Symmetric/Hermitian and only the corresponding part (upper/lower) will be calculated. Valid combinations are the following:

A B opA opB C
General General unconstrained unconstrained General/Symmetric/Hermitian
Symmetric General ignored must be set to N General
Hermitian General ignored must be set to N General
Triangular General unconstrained must be set to N General
General Symmetric must be set to N ignored General
General Hermitian must be set to N ignored General
General Triangular must be set to N unconstrained General
Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe matrix to be updated.
Examples
ex02m_dense_matrix_algebra_vmult.cpp, ex02n_dense_matrix_algebra_mmult.cpp, ex02o_dense_matrix_algebra_mtmult.cpp, ex06m_sparse_matrix_algebra_vmult.cpp, and ex06n_sparse_matrix_algebra_mmult.cpp.

◆ trimult() [1/2]

template<typename T_Scalar>
void cla3p::ops::trimult ( T_Scalar alpha,
op_t opA,
const dns::XxMatrix< T_Scalar > & A,
dns::XxMatrix< T_Scalar > & B )

Replaces a matrix with a scaled triangular matrix-matrix product.

Performs the operation \( B = \alpha \cdot op_A(A) \cdot B \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input triangular matrix.
[in,out]BThe matrix to be replaced.

◆ trimult() [2/2]

template<typename T_Scalar>
void cla3p::ops::trimult ( T_Scalar alpha,
dns::XxMatrix< T_Scalar > & B,
op_t opA,
const dns::XxMatrix< T_Scalar > & A )

Replaces a matrix with a scaled triangular matrix-matrix product.

Performs the operation \( B = \alpha \cdot B \cdot op_A(A) \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in,out]BThe matrix to be replaced.
[in]opAThe operation to be performed for matrix A.
[in]AThe input triangular matrix.

◆ trisol() [1/2]

template<typename T_Scalar>
void cla3p::ops::trisol ( T_Scalar alpha,
op_t opA,
const dns::XxMatrix< T_Scalar > & A,
dns::XxMatrix< T_Scalar > & B )

Replaces a matrix with the scaled solution of a triangular system.

Solves the system \( op_A(A) \cdot X = \alpha \cdot B \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input triangular matrix.
[in,out]BOn entry, the rhs, on exit the system solution X.

◆ trisol() [2/2]

template<typename T_Scalar>
void cla3p::ops::trisol ( T_Scalar alpha,
dns::XxMatrix< T_Scalar > & B,
op_t opA,
const dns::XxMatrix< T_Scalar > & A )

Replaces a matrix with the scaled solution of a triangular system.

Solves the system \( X \cdot op_A(A) = \alpha \cdot B \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in,out]BOn entry, the rhs, on exit the system solution X.
[in]opAThe operation to be performed for matrix A.
[in]AThe input triangular matrix.

◆ mult() [2/7]

template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csr::XxMatrix< T_Int, T_Scalar > & A,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C )

Updates a general dense matrix with a sparse-dense matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot B \). Valid combinations are the following:

A B opA C
General General unconstrained General
Symmetric General ignored General
Hermitian General ignored General
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.

◆ mult() [3/7]

template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csc::XxMatrix< T_Int, T_Scalar > & A,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C )

Updates a general dense matrix with a sparse-dense matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot B \). Valid combinations are the following:

A B opA C
General General unconstrained General
Symmetric General ignored General
Hermitian General ignored General
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.

◆ mult() [4/7]

template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csr::XxMatrix< T_Int, T_Scalar > & A,
op_t opB,
const csr::XxMatrix< T_Int, T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C )

Updates a dense matrix with a sparse-sparse matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot op_B(B) \). Valid combinations are the following:

A B opA opB
General General unconstrained unconstrained
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.

◆ mult() [5/7]

template<typename T_Int, typename T_Scalar>
void cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csc::XxMatrix< T_Int, T_Scalar > & A,
op_t opB,
const csc::XxMatrix< T_Int, T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C )

Updates a dense matrix with a sparse-sparse matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot op_B(B) \). Valid combinations are the following:

A B opA opB
General General unconstrained unconstrained
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.

◆ mult() [6/7]

template<typename T_Int, typename T_Scalar>
csr::XxMatrix< T_Int, T_Scalar > cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csr::XxMatrix< T_Int, T_Scalar > & A,
op_t opB,
const csr::XxMatrix< T_Int, T_Scalar > & B )

Creates a general sparse matrix from a sparse-sparse matrix-matrix product.

Performs the operation \( \alpha \cdot op_A(A) \cdot op_B(B) \). Valid combinations are the following:

A B opA opB
General General N or T N or T
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input sparse matrix.
Returns
The matrix \( \alpha \cdot op_A(A) \cdot op_B(B) \).

◆ mult() [7/7]

template<typename T_Int, typename T_Scalar>
csc::XxMatrix< T_Int, T_Scalar > cla3p::ops::mult ( T_Scalar alpha,
op_t opA,
const csc::XxMatrix< T_Int, T_Scalar > & A,
op_t opB,
const csc::XxMatrix< T_Int, T_Scalar > & B )

Creates a general sparse matrix from a sparse-sparse matrix-matrix product.

Performs the operation \( \alpha \cdot op_A(A) \cdot op_B(B) \). Valid combinations are the following:

A B opA opB
General General N or T N or T
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input sparse matrix.
Returns
The matrix \( \alpha \cdot op_A(A) \cdot op_B(B) \).