type_node_adjacency Derived Type

type, public :: type_node_adjacency


Inherited by

type~~type_node_adjacency~~InheritedByGraph type~type_node_adjacency type_node_adjacency type~type_domain type_domain type~type_domain->type~type_node_adjacency node_adjacency type~type_ftdss type_ftdss type~type_ftdss->type~type_domain domain

Components

Type Visibility Attributes Name Initial
integer(kind=int32), public, allocatable :: col(:)
integer(kind=int32), public, allocatable :: ind(:)
integer(kind=int32), public :: nnz = 0
integer(kind=int32), public :: num_nodes = 0
integer(kind=int32), public, allocatable :: ptr(:)
integer(kind=int32), public, allocatable :: row(:)

Type-Bound Procedures

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

procedure, public, pass(self) :: get_coo

  • private subroutine get_coo(self, row_out, col_out)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(in) :: self
    integer(kind=int32), intent(inout), allocatable :: row_out(:)
    integer(kind=int32), intent(inout), allocatable :: col_out(:)

procedure, public, pass(self) :: get_csr

  • private subroutine get_csr(self, ptr_out, ind_out)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(in) :: self
    integer(kind=int32), intent(inout), allocatable :: ptr_out(:)
    integer(kind=int32), intent(inout), allocatable :: ind_out(:)

procedure, public, pass(self) :: get_degree => get_degree_csr

  • private pure function get_degree_csr(self, node_id) result(degree)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(in) :: self
    integer(kind=int32), intent(in) :: node_id

    Return Value integer(kind=int32)

procedure, public, pass(self) :: get_neighbors => get_neighbors_csr

  • private subroutine get_neighbors_csr(self, node_id, neighbors)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(in) :: self
    integer(kind=int32), intent(in) :: node_id
    integer(kind=int32), intent(out), allocatable :: neighbors(:)

procedure, public, pass(self) :: get_nnz

  • private pure function get_nnz(self) result(nnz)

    Arguments

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

    Return Value integer(kind=int32)

procedure, public, pass(self) :: get_num_nodes

  • private pure function get_num_nodes(self) result(n_nodes)

    Arguments

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

    Return Value integer(kind=int32)

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

  • private subroutine initialize_hybrid_from_mesh(self, num_nodes, computation_dimension, sides, elements)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(inout) :: self
    integer(kind=int32), intent(in) :: num_nodes
    integer(kind=int32), intent(in) :: computation_dimension
    class(holder_sides), intent(in) :: sides(:)
    class(holder_elements), intent(in) :: elements(:)

Source Code

    type :: type_node_adjacency
        integer(int32) :: num_nodes = 0
        integer(int32) :: nnz = 0

        ! COO (Coordinate list) 形式のデータ (ソート済み)
        integer(int32), allocatable :: row(:)
        integer(int32), allocatable :: col(:)

        ! CSR (Compressed Sparse Row) 形式のデータ
        integer(int32), allocatable :: ptr(:)
        integer(int32), allocatable :: ind(:)
    contains
        procedure, pass(self), public :: initialize => initialize_hybrid_from_mesh
        procedure, pass(self), public :: get_num_nodes => get_num_nodes
        procedure, pass(self), public :: get_degree => get_degree_csr
        procedure, pass(self), public :: get_neighbors => get_neighbors_csr
        procedure, pass(self), public :: get_nnz => get_nnz
        procedure, pass(self), public :: get_coo => get_coo
        procedure, pass(self), public :: get_csr => get_csr
        procedure, pass(self), public :: destroy => destroy_hybrid
    end type type_node_adjacency