tem_PathComparison Function

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

Compare two Paths in the linearized tree Result: -1: left is lower than right 0: left is same than right 1: left is higher than right

Arguments

Type IntentOptional Attributes Name
type(tem_path_type), intent(in) :: left

candidate path

type(tem_path_type), intent(in) :: right

candidate path

Return Value integer

relation between the paths


Called by

proc~~tem_pathcomparison~~CalledByGraph proc~tem_pathcomparison tem_PathComparison proc~issmallerorequal isSmallerOrEqual proc~issmallerorequal->proc~tem_pathcomparison proc~tem_find_depproc_globsearch tem_find_depProc_globSearch proc~tem_find_depproc_globsearch->proc~tem_pathcomparison proc~tem_init_surfdata tem_init_surfData proc~tem_init_surfdata->proc~tem_pathcomparison proc~isgreater isGreater proc~isgreater->proc~tem_pathcomparison proc~isequal isEqual proc~isequal->proc~tem_pathcomparison proc~isunequal isUnequal proc~isunequal->proc~tem_pathcomparison proc~issmaller isSmaller proc~issmaller->proc~tem_pathcomparison proc~isgreaterorequal isGreaterOrEqual proc~isgreaterorequal->proc~tem_pathcomparison proc~tem_posofid tem_PosOfId proc~tem_posofid->proc~tem_pathcomparison proc~tem_find_depproc tem_find_depProc proc~tem_find_depproc->proc~tem_pathcomparison proc~tem_find_depproc->proc~tem_find_depproc_globsearch proc~tem_treeidcomparison tem_TreeIDComparison proc~tem_treeidcomparison->proc~tem_pathcomparison proc~tem_update_surfpos tem_update_surfPos proc~tem_update_surfpos->proc~tem_init_surfdata interface~operator(gt) operator(>) interface~operator(gt)->proc~isgreater interface~operator(==) operator(==) interface~operator(==)->proc~isequal interface~operator(lt) operator(<) interface~operator(lt)->proc~issmaller proc~evaluate_add_spacetime_scalarbycoordinate evaluate_add_spacetime_scalarByCoordinate proc~evaluate_add_spacetime_scalarbycoordinate->proc~tem_posofid proc~evaluate_add_spacetime_vectorbycoordinate evaluate_add_spacetime_vectorByCoordinate proc~evaluate_add_spacetime_vectorbycoordinate->proc~tem_posofid proc~evaluate_first_spacetime_scalarbycoordinate evaluate_first_spacetime_scalarByCoordinate proc~evaluate_first_spacetime_scalarbycoordinate->proc~tem_posofid proc~setup_indices_spacetime setup_indices_spacetime proc~setup_indices_spacetime->proc~tem_posofid proc~tem_cano_initsubtree tem_cano_initSubTree proc~tem_cano_initsubtree->proc~tem_posofid proc~tem_cano_storepntsinsubtree tem_cano_storePntsInSubTree proc~tem_cano_storepntsinsubtree->proc~tem_posofid proc~tem_unify_vrtx tem_unify_vrtx proc~tem_unify_vrtx->proc~tem_posofid interface~operator(lt=) operator(<=) interface~operator(lt=)->proc~issmallerorequal interface~operator(SLASH=) operator(/=) interface~operator(SLASH=)->proc~isunequal interface~operator(gt=) operator(>=) interface~operator(gt=)->proc~isgreaterorequal proc~evaluate_first_spacetime_vectorbycoordinate evaluate_first_spacetime_vectorByCoordinate proc~evaluate_first_spacetime_vectorbycoordinate->proc~tem_posofid proc~tem_cano_checkneigh tem_cano_checkNeigh proc~tem_cano_checkneigh->proc~tem_posofid proc~tem_findelement tem_findElement proc~tem_findelement->proc~tem_posofid proc~identify_elements identify_elements proc~identify_elements->proc~tem_find_depproc

Contents

Source Code


Source Code

  elemental function tem_PathComparison( left, right ) result(relation)
    ! ---------------------------------------------------------------------------
    !> candidate path
    type(tem_path_type), intent(in) :: left
    !> candidate path
    type(tem_path_type), intent(in) :: right
    !> relation between the paths
    integer :: relation
    ! ---------------------------------------------------------------------------
    integer :: maxPathLen
    integer(kind=long_k) :: diff
    ! ---------------------------------------------------------------------------

    ! Find the greatest common level.
    maxPathLen = min(left%level-1, right%level-1)

    ! Difference of treeIDs on that level indicates the relation of the two
    ! paths.
    diff =  left%Node( left%Level - maxPathLen)                                &
      &  - right%Node(right%Level - maxPathLen)

    ! Normalize the relation.
    relation = int(diff / max(1_long_k, abs(diff)))

  end function tem_PathComparison