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
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | left |
candidate treeID |
||
integer(kind=long_k), | intent(in) | :: | right |
candidate treeID |
relation between the treeIDs
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