This subroutine does a binary search on a given (sparse) list of elements. The result is the position of the given tree ID in the list, 0 if no corresponding node is found, or the negative of the found ID, if it is a virtual node.
Build the path to the searched TreeID from the leaf to the root.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=long_k), | intent(in) | :: | sTreeID | tree ID to search for |
||
| integer(kind=long_k), | intent(in) | :: | treeIDlist(:) | List to search in |
||
| integer, | intent(in), | optional | :: | lower | lowerbound of search interval |
|
| integer, | intent(in), | optional | :: | upper | upperbound of search interval |
position of sTreeID in the list of elements
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | lb | ||||
| integer, | private | :: | ub | ||||
| integer, | private | :: | middleSearch | ||||
| type(tem_path_type), | private | :: | searched | ||||
| type(tem_path_type), | private | :: | current | ||||
| integer, | private | :: | pathRelation |