csrmat_t Derived Type

type, public :: csrmat_t

Compressed-sparse-row (CSR) matrix format


Components

Type Visibility Attributes Name Initial
integer, public :: ndim

Number of rows (dimension)

integer, public :: ncol

Number of columns

integer, public :: nnz

Number of non-zero elements

integer, public, allocatable, dimension(:) :: i

i-array in CSR format, of dimension ndim+1

integer, public, allocatable, dimension(:) :: j

j-array in CSR format, of dimension nnz

real(kind=FP), public, allocatable, dimension(:) :: val

val-array in CSR format, of dimension nnz


Finalization Procedures

final :: destructor

  • public subroutine destructor(self)

    destructor, frees memory

    Arguments

    Type IntentOptional Attributes Name
    type(csrmat_t), intent(inout) :: self

    csr matrix


Type-Bound Procedures

procedure, public :: write_netcdf

  • public subroutine write_netcdf(self, fgid)

    writes csr matrix to file

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(in) :: self

    csr matrix

    integer, intent(in) :: fgid

    file or group id number of existing Netcdf4 file

procedure, public :: read_netcdf

  • public subroutine read_netcdf(self, fgid)

    Reads csr matrix from file

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(inout) :: self

    csr matrix

    integer, intent(in) :: fgid

    File or group id number of existing Netcdf4 file

procedure, public :: sortsum

  • public subroutine sortsum(self)

    sorts and sums entries in ascending j-order for each row

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(inout) :: self

    csr matrix

procedure, public :: create_copy

  • public subroutine create_copy(self, res)

    Creates a copy of the matrix

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(in) :: self

    Matrix

    type(csrmat_t), intent(out) :: res

    Copy of matrix

procedure, public :: display

  • public subroutine display(self)

    displays some information on matrix

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(in) :: self

    csr matrix

procedure, public :: expose_data

  • public subroutine expose_data(self, data_object)

    Exposes csrmat data through csrmat_data_t object

    Arguments

    Type IntentOptional Attributes Name
    class(csrmat_t), intent(in), target :: self

    Instance of the type

    type(csrmat_data_t), intent(out) :: data_object

    Destination csrmat data object that contains the exposed data of the csrmat object.