A module for performing linear algebra using sparse matrices.
Will scale a sparse matrix by a constant.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(inout) | :: | matA | Matrix A. |
||
real(kind=NTREAL), | intent(in) | :: | constant | Constant scale factor. |
Will scale a sparse matrix by a constant.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(inout) | :: | matA | Matrix A. |
||
real(kind=NTREAL), | intent(in) | :: | constant | Constant scale factor. |
Will scale a sparse matrix by a constant.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(inout) | :: | matA | Matrix A. |
||
complex(kind=NTCOMPLEX), | intent(in) | :: | constant | Constant scale factor. |
Matrix B = alpha*Matrix A + Matrix B (AXPY). This will utilize the sparse vector addition routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsr), | intent(inout) | :: | matB | Matrix B. |
||
real(kind=NTREAL), | intent(in), | optional | :: | alpha_in | Multiplier (default=1.0). |
|
real(kind=NTREAL), | intent(in), | optional | :: | threshold_in | For flushing values to zero (default=0). |
Matrix B = alpha*Matrix A + Matrix B (AXPY). This will utilize the sparse vector addition routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsc), | intent(inout) | :: | matB | Matrix B. |
||
real(kind=NTREAL), | intent(in), | optional | :: | alpha_in | Multiplier (default=1.0). |
|
real(kind=NTREAL), | intent(in), | optional | :: | threshold_in | For flushing values to zero (default=0). |
Product = sum(MatA[ij]*MatB[ij])
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsr), | intent(in) | :: | matB | Matrix B. |
||
real(kind=NTREAL), | intent(out) | :: | product | Dot product. |
Product = sum(MatA^H[ij]*MatB[ij])
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsc), | intent(in) | :: | matB | Matrix B. |
||
complex(kind=NTCOMPLEX), | intent(out) | :: | product | Dot product. |
Pairwise Multiply two matrices. This will utilize the sparse vector pairwise multiply routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsr), | intent(in) | :: | matB | Matrix B. |
||
type(Matrix_lsr), | intent(inout) | :: | matC | matC = MatA mult MatB. |
Pairwise Multiply two matrices. This will utilize the sparse vector pairwise routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsc), | intent(in) | :: | matB | Matrix B. |
||
type(Matrix_lsc), | intent(inout) | :: | matC | matC = MatA mult MatB. |
Multiply two matrices together, and add to the third. C := alphamatAop( matB ) + beta*matC
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsr), | intent(in) | :: | matB | Matrix B. |
||
type(Matrix_lsr), | intent(inout) | :: | matC | matC = alphamatAop( matB ) + beta*matC. |
||
logical, | intent(in), | optional | :: | IsATransposed_in | True if A is already transposed. |
|
logical, | intent(in), | optional | :: | IsBTransposed_in | True if B is already transposed. |
|
real(kind=NTREAL), | intent(in), | optional | :: | alpha_in | Scales the multiplication. |
|
real(kind=NTREAL), | intent(in), | optional | :: | beta_in | Scales matrix we sum on to. |
|
real(kind=NTREAL), | intent(in), | optional | :: | threshold_in | For flushing values to zero. Default value is 0.0. |
|
type(MatrixMemoryPool_lr), | intent(inout), | optional | TARGET | :: | blocked_memory_pool_in | An optional memory pool for doing the calculation. |
Multiply two matrices together, and add to the third. C := alphamatAop( matB ) + beta*matC
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | matA | Matrix A. |
||
type(Matrix_lsc), | intent(in) | :: | matB | Matrix B. |
||
type(Matrix_lsc), | intent(inout) | :: | matC | matC = alphamatAop( matB ) + beta*matC. |
||
logical, | intent(in), | optional | :: | IsATransposed_in | True if A is already transposed. |
|
logical, | intent(in), | optional | :: | IsBTransposed_in | True if B is already transposed. |
|
real(kind=NTREAL), | intent(in), | optional | :: | alpha_in | Scales the multiplication. |
|
real(kind=NTREAL), | intent(in), | optional | :: | beta_in | Scales matrix we sum on to. |
|
real(kind=NTREAL), | intent(in), | optional | :: | threshold_in | For flushing values to zero. Default value is 0.0. |
|
type(MatrixMemoryPool_lc), | intent(inout), | optional | TARGET | :: | blocked_memory_pool_in | An optional memory pool for doing the calculation. |
Compute the norm of a sparse matrix along the columns.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | this | The matrix to compute the norm of. |
||
real(kind=NTREAL), | intent(out), | DIMENSION(this%columns) | :: | norm_per_column | The norm value for each column in this matrix. |
Compute the norm of a sparse matrix along the columns.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | this | The matrix to compute the norm of. |
||
real(kind=NTREAL), | intent(out), | DIMENSION(this%columns) | :: | norm_per_column | The norm value for each column in this matrix. |
Compute the 1 norm of a sparse matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | this | The matrix to compute the norm of. |
The norm of the matrix.
Compute the 1 norm of a sparse matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | this | The matrix to compute the norm of. |
The norm of the matrix.
Sum the elements of a matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsr), | intent(in) | :: | this | The matrix to sum |
||
real(kind=NTREAL), | intent(out) | :: | sum_value | The sum of the matrix elements |
Sum the elements of a matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(Matrix_lsc), | intent(in) | :: | this | The matrix to sum |
||
complex(kind=NTCOMPLEX), | intent(out) | :: | sum_value | The sum of the matrix elements |