coo_sparsity_pattern_class Module

Houses base coordinate list sparsity pattern


Used by


Interfaces

interface

  • private pure module function hasIndices(this, row, column) result(found)

    Return true if all elements with indices (row,column) are present in sparsity pattern

    Arguments

    Type IntentOptional Attributes Name
    class(COOSparsityPattern), intent(in) :: this
    integer(kind=ik), intent(in), dimension(:) :: row

    Row indices

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

    Column indices

    Return Value logical

interface

  • private pure module function findLocationOfIndices(this, row, column) result(indices)

    Return indices with given values of (row,column)

    Arguments

    Type IntentOptional Attributes Name
    class(COOSparsityPattern), intent(in) :: this
    integer(kind=ik), intent(in), dimension(:) :: row

    Row index

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

    Column index

    Return Value integer(kind=ik), allocatable, dimension(:)

interface

  • private pure module subroutine initCooSparsityPattern(this, numRows, numCols, bufferSize, rowOffset)

    COO sparsity pattern initialization routine

    Arguments

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

    Matrix number of rows

    integer(kind=ik), intent(in) :: numCols

    Matrix number of columns

    integer(kind=ik), intent(in), optional :: bufferSize

    Preallocated rolling buffer size

    integer(kind=ik), intent(in), optional :: rowOffset

    Row offset for distributed arrays

interface

  • private pure module subroutine addEntry(this, row, column)

    Add entry if not already present

    Arguments

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

    Row index

    integer(kind=ik), intent(in) :: column

    Column Index

interface

  • private pure module subroutine addPattern(this, pattern, rowOffset, colOffset)

    Add entries from existing pattern that are not already present

    Arguments

    Type IntentOptional Attributes Name
    class(COOSparsityPattern), intent(inout) :: this
    type(COOSparsityPattern), intent(in) :: pattern

    Pattern to add to this pattern

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

    Array by which to offset pattern row indices before adding

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

    Array by which to offset pattern column indices before adding


Derived Types

type, public, extends(Object) ::  COOSparsityPattern

Coordinate list format sparsity pattern

Components

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

True only if user explicitly sets it to true

integer(kind=ik), public :: numNonZeros

Total number of non-zero entries

integer(kind=ik), public :: numRows

Number of matrix rows

integer(kind=ik), public :: numCols

Number of matrix columns

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

Array of non-zero row indices

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

Array of non-zero column indices

integer(kind=ik), public :: bufferSize
integer(kind=ik), public :: numAddedElements
logical, private, allocatable, dimension(:) :: addedRow
logical, private, allocatable, dimension(:) :: addedCol
integer(kind=ik), private, allocatable, dimension(:) :: firstInstRow
integer(kind=ik), private, allocatable, dimension(:) :: firstInstCol
type(IntArray), private, allocatable, dimension(:) :: rowGlobalIndices

Element indices of each row

integer(kind=ik), private :: rowOffset

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: hasIndices
procedure, public :: findLocationOfIndices
procedure, public :: addEntry
procedure, public :: addPattern
procedure, public :: init => initCooSparsityPattern