SparseRowData Derived Type

type, public, extends(Object) :: SparseRowData

Sparse row matrix representation


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

integer(kind=ik), public, allocatable, dimension(:) :: rowIndex

Row indices of each sparse row vector

type(IntArray), public, allocatable, dimension(:) :: columnVector

Arrays of column indices for each row

type(RealArray), public, allocatable, dimension(:) :: values

Values associated with each sparse row vector


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: addRow

  • interface

    private pure module subroutine addRow(this, rowIndex, columnIndices, values)

    Add sparse row vector to data Object and initialize its values to 0, unless value vector is supplied

    Arguments

    Type IntentOptional Attributes Name
    class(SparseRowData), intent(inout) :: this
    integer(kind=ik), intent(in) :: rowIndex

    Row index of added vector

    integer(kind=ik), intent(in), dimension(:) :: columnIndices

    Column indices of nonzeros in row

    real(kind=rk), intent(in), optional, dimension(:) :: values

    Values of nonzeros in row

procedure, public :: init => initSparseRowData

  • interface

    private pure module subroutine initSparseRowData(this, rowIndices, colVectors)

    Sparse row data Object initialization routine. If indices are supplied initializes values to 0.

    Arguments

    Type IntentOptional Attributes Name
    class(SparseRowData), intent(inout) :: this
    integer(kind=ik), intent(in), optional, dimension(:) :: rowIndices

    Row indices of each sparse row vector

    type(IntArray), intent(in), optional, dimension(:) :: colVectors

    Arrays of column indices for each row