PSMatrixAlgebraModule Module

A Module For Performing Distributed Sparse Matrix Algebra Operations.



Contents


Interfaces

public interface MatrixSigma

  • private subroutine MatrixSigma_ps(this, sigma_value)

    Compute sigma for the inversion method. See \cite ozaki2001efficient for details.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: this

    The matrix to compute the sigma value of.

    real(kind=NTREAL), intent(out) :: sigma_value

    Sigma

public interface MatrixMultiply

  • private subroutine MatrixMultiply_ps(matA, matB, matC, alpha_in, beta_in, threshold_in, memory_pool_in)

    Multiply two matrices together, and add to the third. C := alphamatAmatB+ beta*matC

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: matA

    Matrix A.

    type(Matrix_ps), intent(in) :: matB

    Matrix B.

    type(Matrix_ps), intent(inout) :: matC

    matC = alphamatAmatB + beta*matC

    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.

    type(MatrixMemoryPool_p), intent(inout), optional :: memory_pool_in

    A memory pool for the calculation.

public interface MatrixGrandSum

  • private subroutine MatrixGrandSum_psr(this, sum)

    Sum up the elements in a matrix into a single value.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: this

    The matrix to compute.

    real(kind=NTREAL), intent(out) :: sum

    The sum of all elements.

  • private subroutine MatrixGrandSum_psc(this, sum)

    Sum up the elements in a matrix into a single value.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: this

    The matrix to compute.

    complex(kind=NTCOMPLEX), intent(out) :: sum

    The sum of all elements.

public interface PairwiseMultiplyMatrix

  • private recursive subroutine PairwiseMultiplyMatrix_ps(matA, matB, matC)

    Elementwise multiplication. C_ij = A_ij * B_ij. Also known as a Hadamard product.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: matA

    Matrix A.

    type(Matrix_ps), intent(in) :: matB

    Matrix B.

    type(Matrix_ps), intent(inout) :: matC

    matC = MatA mult MatB.

public interface MatrixNorm

  • private function MatrixNorm_ps(this) result(norm_value)

    Compute the norm of a distributed sparse matrix along the rows.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: this

    The matrix to compute the norm of.

    Return Value real(kind=NTREAL)

    The norm value of the full distributed sparse matrix.

public interface DotMatrix

  • private subroutine DotMatrix_psr(matA, matB, product)

    product = dot(Matrix A,Matrix B) Note that a dot product is the sum of elementwise multiplication, not traditional matrix multiplication.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: matA

    Matrix A.

    type(Matrix_ps), intent(in) :: matB

    Matrix B.

    real(kind=NTREAL), intent(out) :: product

    The dot product.

  • private subroutine DotMatrix_psc(matA, matB, product)

    product = dot(Matrix A,Matrix B) Note that a dot product is the sum of elementwise multiplication, not traditional matrix multiplication.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: matA

    Matrix A.

    type(Matrix_ps), intent(in) :: matB

    Matrix B.

    complex(kind=NTCOMPLEX), intent(out) :: product

    The dot product.

public interface IncrementMatrix

  • private recursive subroutine IncrementMatrix_ps(matA, matB, alpha_in, threshold_in)

    Matrix B = alpha*Matrix A + Matrix B (AXPY) This will utilize the sparse vector increment routine.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: matA

    Matrix A.

    type(Matrix_ps), 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).

public interface ScaleMatrix

  • private subroutine ScaleMatrix_psr(this, constant)

    Will scale a distributed sparse matrix by a constant.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(inout) :: this

    Matrix to scale.

    real(kind=NTREAL), intent(in) :: constant

    A constant scale factor.

  • private recursive subroutine ScaleMatrix_psc(this, constant)

    Will scale a distributed sparse matrix by a constant.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(inout) :: this

    Matrix to scale.

    complex(kind=NTCOMPLEX), intent(in) :: constant

    A constant scale factor.

public interface MatrixTrace

  • private subroutine MatrixTrace_psr(this, trace_value)

    Compute the trace of the matrix.

    Arguments

    Type IntentOptional Attributes Name
    type(Matrix_ps), intent(in) :: this

    The matrix to compute the trace of.

    real(kind=NTREAL), intent(out) :: trace_value

    The trace value of the full distributed sparse matrix.


Subroutines

public subroutine SimilarityTransform(A, P, PInv, ResMat, pool_in, threshold_in)

Transform a matrix B = P * A * P^-1

Arguments

Type IntentOptional Attributes Name
type(Matrix_ps), intent(in) :: A

The matrix to transform

type(Matrix_ps), intent(in) :: P

The left matrix.

type(Matrix_ps), intent(in) :: PInv

The right matrix.

type(Matrix_ps), intent(inout) :: ResMat

The computed matrix P * A * P^-1

type(MatrixMemoryPool_p), intent(inout), optional :: pool_in

A matrix memory pool.

real(kind=NTREAL), intent(in), optional :: threshold_in

The threshold for removing small elements.