Matrix_lsr Derived Type

type, public :: Matrix_lsr

A datatype for storing a local, real CSR matrix.


Contents


Components

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

Outer indices

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

Inner indices

real(kind=NTREAL), public, DIMENSION(:), ALLOCATABLE:: values

Values

integer, public :: rows

Matrix dimension: rows

integer, public :: columns

Matrix dimension: columns


Constructor

public interface Matrix_lsr

  • private pure function ConstructEmptyMatrix_lsr(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_lsr)

    The matrix to construct.

  • private function ConstructMatrixFromFile_lsr(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_lsr)

    The matrix being constructed.

  • private pure function ConstructMatrixFromTripletList_lsr(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_r), 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_lsr)

    The matrix being constructed