Matrix_lsc Derived Type

type, public :: Matrix_lsc

A datatype for storing a local, complex CSR matrix.


Contents


Components

TypeVisibility AttributesNameInitial
integer, public, DIMENSION(:), ALLOCATABLE:: outer_index

Outer indices

integer, public, DIMENSION(:), ALLOCATABLE:: inner_index

Inner indices

complex(kind=NTCOMPLEX), public, DIMENSION(:), ALLOCATABLE:: values

Values

integer, public :: rows

Matrix dimension: rows

integer, public :: columns

Matrix dimension: columns


Constructor

public interface Matrix_lsc

  • private pure function ConstructEmptyMatrix_lsc(rows, columns, zero_in) result(this)

    Create a sparse matrix with a certain number of columns and rows. Will allocate storage for the outer values, nothing else unless you set zero_in to true.

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: rows

    The number of matrix rows.

    integer, intent(in) :: columns

    The number of matrix columns.

    logical, intent(in), optional :: zero_in

    Whether to set the matrix to zero.

    Return Value type(Matrix_lsc)

    The matrix to construct.

  • private function ConstructMatrixFromFile_lsc(file_name) result(this)

    Create a sparse matrix by reading in a matrix market file.

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: file_name

    Name of the file.

    Return Value type(Matrix_lsc)

    The matrix being constructed.

  • private pure function ConstructMatrixFromTripletList_lsc(triplet_list, rows, columns) result(this)

    Construct a sparse matrix from a \b SORTED triplet list. The triplet list must be sorted to efficiently fill in the matrix. This constructor assumes \b you have already sorted the triplet list.

    Arguments

    Type IntentOptional AttributesName
    type(TripletList_c), intent(in) :: triplet_list

    A list of triplet values. They must be sorted.

    integer, intent(in) :: rows

    Number of matrix rows

    integer, intent(in) :: columns

    Number of matrix columns

    Return Value type(Matrix_lsc)

    The matrix being constructed