tem_TreeIDComparison Function

public elemental function tem_TreeIDComparison(left, right) result(relation)

Compare Position of two treeIDs in the linearized tree This is relatively expansive, therefore the result should be stored, if more than one comparison of the same treeIDs has to be done. Result: -1: left is lower than right 0: left is same than right 1: left is higher than right

Arguments

Type IntentOptional Attributes Name
integer(kind=long_k), intent(in) :: left

candidate treeID

integer(kind=long_k), intent(in) :: right

candidate treeID

Return Value integer

relation between the treeIDs


Calls

proc~~tem_treeidcomparison~~CallsGraph proc~tem_treeidcomparison tem_TreeIDComparison proc~tem_pathcomparison tem_PathComparison proc~tem_treeidcomparison->proc~tem_pathcomparison proc~tem_pathof tem_PathOf proc~tem_treeidcomparison->proc~tem_pathof

Source Code

  elemental function tem_TreeIDComparison( left, right ) result(relation)
    ! ---------------------------------------------------------------------------
    !> candidate treeID
    integer(kind=long_k), intent(in) :: left
    !> candidate treeID
    integer(kind=long_k), intent(in) :: right
    !> relation between the treeIDs
    integer :: relation
    ! ---------------------------------------------------------------------------
    type(tem_path_type) :: left_path
    type(tem_path_type) :: right_path
    ! ---------------------------------------------------------------------------

    ! Build the path to the left from the leaf to the root (0).
    left_path = tem_PathOf(left)

    ! Build the path to the right from the leaf to the root (0).
    right_path = tem_PathOf(right)

    relation = tem_PathComparison(left_path, right_path)

  end function tem_TreeIDComparison