type_crs Derived Type

type, public, extends(abst_matrix) :: type_crs


Inherits

type~~type_crs~~InheritsGraph type~type_crs type_crs type~abst_matrix abst_matrix type~type_crs->type~abst_matrix

Inherited by

type~~type_crs~~InheritedByGraph type~type_crs type_crs type~abst_hydraulic abst_hydraulic type~abst_hydraulic->type~type_crs KH_star type~abst_thermal abst_thermal type~abst_thermal->type~type_crs KT_star type~type_ftdss type_ftdss type~type_ftdss->type~abst_hydraulic hydraulic type~type_ftdss->type~abst_thermal thermal type~type_hydraulic_crs type_hydraulic_crs type~type_hydraulic_crs->type~abst_hydraulic type~type_thermal_crs type_thermal_crs type~type_thermal_crs->type~abst_thermal

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public, allocatable :: ind(:)
integer(kind=int32), public :: nnz
integer(kind=int32), public :: num_ptr
integer(kind=int32), public :: num_row
integer(kind=int32), public, allocatable :: ptr(:)
real(kind=real64), public, allocatable :: val(:)

Type-Bound Procedures

procedure, public, pass(self) :: add => add_crs

  • private subroutine add_crs(self, row, col, value)

    Arguments

    Type IntentOptional Attributes Name
    class(type_crs), intent(inout) :: self
    integer(kind=int32), intent(in) :: row
    integer(kind=int32), intent(in) :: col
    real(kind=real64), intent(in) :: value

procedure, public, pass(self) :: destroy => destroy_crs

  • private subroutine destroy_crs(self)

    Arguments

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

procedure, public, pass(self) :: find => find_crs

  • private pure function find_crs(self, row, col) result(index)

    Arguments

    Type IntentOptional Attributes Name
    class(type_crs), intent(in) :: self
    integer(kind=int32), intent(in) :: row
    integer(kind=int32), intent(in) :: col

    Return Value integer(kind=int32)

procedure, public, pass(self) :: initialize => initialize_type_crs

  • private subroutine initialize_type_crs(self, num_nodes, row, col)

    Arguments

    Type IntentOptional Attributes Name
    class(type_crs), intent(inout) :: self
    integer(kind=int32), intent(in) :: num_nodes
    integer(kind=int32), intent(in), optional :: row(:)
    integer(kind=int32), intent(in), optional :: col(:)

procedure, public, pass(self) :: set => set_crs

  • private subroutine set_crs(self, row, col, value)

    Arguments

    Type IntentOptional Attributes Name
    class(type_crs), intent(inout) :: self
    integer(kind=int32), intent(in) :: row
    integer(kind=int32), intent(in) :: col
    real(kind=real64), intent(in) :: value

procedure, public, pass(self) :: set_all => set_all_crs

  • private subroutine set_all_crs(self, value)

    Arguments

    Type IntentOptional Attributes Name
    class(type_crs), intent(inout) :: self
    real(kind=real64), intent(in) :: value

procedure, public, pass(self) :: zero => zero_crs

  • private subroutine zero_crs(self)

    Arguments

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

Source Code

    type, extends(abst_matrix) :: type_crs
        integer(int32) :: nnz ! number of non-zero elements
        integer(int32) :: num_row ! number of rows
        integer(int32) :: num_ptr ! size of ptr (num_row+1 entries)
        integer(int32), allocatable :: ptr(:) ! pointers to row starts (1-based)
        integer(int32), allocatable :: ind(:) ! column indices of non-zeros
        real(real64), allocatable :: val(:) ! non-zero values
    contains
        procedure, public, pass(self) :: initialize => initialize_type_crs !&
        procedure, public, pass(self) :: find       => find_crs !&
        procedure, public, pass(self) :: set        => set_crs !&
        procedure, public, pass(self) :: set_all    => set_all_crs !&
        procedure, public, pass(self) :: zero       => zero_crs !&
        procedure, public, pass(self) :: add        => add_crs !&
        procedure, public, pass(self) :: destroy    => destroy_crs !&
    end type type_crs