type_node_adjacency Derived Type

type, public :: type_node_adjacency


Components

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

Type-Bound Procedures

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

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

  • private function get_node_degree(self, i) result(deg)

    Arguments

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

    Return Value integer(kind=int32)

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

  • private subroutine get_node_neighbors(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_num_nodes

  • private function get_num_nodes(self) result(n)

    Arguments

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

    Return Value integer(kind=int32)

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

  • private subroutine initialize_node_adjacency(self, num_nodes_in, num_elems, elements_conn_data, elements_ptr)

    Arguments

    Type IntentOptional Attributes Name
    class(type_node_adjacency), intent(inout) :: self
    integer(kind=int32), intent(in) :: num_nodes_in
    integer(kind=int32), intent(in) :: num_elems
    integer(kind=int32), intent(in) :: elements_conn_data(:)
    integer(kind=int32), intent(in) :: elements_ptr(:)

procedure, public, pass(self) :: is_adjacent => check_node_adjacent

  • private function check_node_adjacent(self, i, j) result(is_adj)

    Arguments

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

    Return Value logical

Source Code

    type :: type_node_adjacency
        integer(int32) :: num_nodes = 0
        integer(int32), allocatable :: ptr(:)
        integer(int32), allocatable :: ind(:)
    contains
        procedure, pass(self), public :: initialize => initialize_node_adjacency
        procedure, pass(self), public :: is_adjacent => check_node_adjacent
        procedure, pass(self), public :: get_degree => get_node_degree
        procedure, pass(self), public :: get_num_nodes => get_num_nodes
        ! 追加: 指定ノードの隣接ノードリストを取得
        procedure, pass(self), public :: get_neighbors => get_node_neighbors
        procedure, pass(self), public :: destroy => destroy_node_adjacency
    end type type_node_adjacency