build_leaf_vertices Module Subroutine

module subroutine build_leaf_vertices(this)

Calculate the output vertices of the network

Arguments

Type IntentOptional Attributes Name
class(network_type), intent(inout) :: this

Instance of network


Source Code

  module subroutine build_leaf_vertices(this)
    !! Calculate the output vertices of the network
    implicit none

    ! Arguments
    class(network_type), intent(inout) :: this
    !! Instance of network

    ! Local variables
    integer :: i
    !! Loop index

    if(allocated(this%leaf_vertices)) deallocate(this%leaf_vertices)
    allocate(this%leaf_vertices(0))
    do i = 1, this%auto_graph%num_vertices
       if(all(this%auto_graph%adjacency(i,:).eq.0))then
          this%leaf_vertices = [this%leaf_vertices, i]
       end if
    end do
  end subroutine build_leaf_vertices