21 #ifndef D_TREE_POINT_LOCATOR_PATH_IMPL_H 22 #define D_TREE_POINT_LOCATOR_PATH_IMPL_H 24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 28 #ifndef D_TREE_POINT_LOCATOR_PATH_H 29 #include "SheafSystem/d_tree_point_locator_path.h" 32 #ifndef ASSERT_CONTRACT_H 33 #include "SheafSystem/assert_contract.h" 36 #ifndef D_BOUNDING_BOX_H 37 #include "SheafSystem/d_bounding_box.h" 41 #include "SheafSystem/std_bitset.h" 45 #include "SheafSystem/std_limits.h" 60 template <
int DC,
int DB>
61 d_tree_point_locator_path<DC, DB>&
67 _height = xother._height;
73 template <
int DC,
int DB>
78 invariance(height() <= max_height());
79 invariance(depth() == max_height() - height());
80 invariance(max_depth() == max_height());
85 template <
int DC,
int DB>
93 template <
int DC,
int DB>
99 template <
int DC,
int DB>
115 ensure(depth() == 0);
116 ensure(tree() == xtree);
123 template <
int DC,
int DB>
139 ensure(depth() == 0);
140 ensure(tree() == xtree);
147 template <
int DC,
int DB>
152 size_type result = max_height() - _height;
156 ensure(result <= max_depth());
161 template <
int DC,
int DB>
170 ensure(result <= max_height());
175 template <
int DC,
int DB>
184 template <
int DC,
int DB>
192 template <
int DC,
int DB>
200 template <
int DC,
int DB>
211 result = _path.branch(_height);
215 ensure(result < DEGREE);
222 template <
int DC,
int DB>
229 require(depth() > 0);
233 define_old_variable(
size_type old_depth = depth());
239 ensure(depth() == old_depth - 1);
246 template <
int DC,
int DB>
253 require(depth() < max_depth());
257 define_old_variable(
size_type old_depth = depth());
263 ensure(depth() == old_depth + 1);
270 template <
int DC,
int DB>
277 require(xhead < DEGREE);
281 _path.put_branch(_height, xhead);
285 ensure(head() == xhead);
292 template <
int DC,
int DB>
301 _height = max_height();
305 ensure(depth() == 0);
312 template <
int DC,
int DB>
344 result = (lbox_lb <= lpath) && (lpath <= lbox_ub);
346 #ifdef DIAGNOSTIC_OUTPUT 348 cout <<
"height= " << _height << endl;
349 cout <<
"unshifted:" << endl;
350 cout << xbox->
lb() << endl;
351 cout << _path << endl;
352 cout << xbox->
ub() << endl;
353 cout <<
"shifted:" << endl;
354 cout << lbox_lb << endl;
355 cout << lpath << endl;
356 cout << lbox_ub << endl;
357 cout <<
"result= " << boolalpha << result << noboolalpha << endl;
368 template <
int DC,
int DB>
376 template <
int DC,
int DB>
384 template <
int DC,
int DB>
394 template <
int DC,
int DB>
396 operator<<(std::ostream &os, const d_tree_point_locator_path<DC, DB>& xpath)
398 os <<
"height = " << xpath.
height()
399 <<
", max_height = " << xpath.max_height()
400 <<
", head = " << xpath.head()
401 <<
", path = " << xpath.path()
409 #endif // ifndef D_TREE_POINT_LOCATOR_PATH_IMPL_H static size_type max_depth()
The depth of the head of the longest representable path.
size_type depth() const
The current depth.
void ascend()
Ascend one level in the path.
size_type head() const
The branch index of the head of the path.
void reset()
Sets depth to 0.
d_tree_point_locator_path< DC, DB > & operator=(const d_tree_point_locator_path< DC, DB > &xother)
Assignment operator.
static size_type leftmost_bit_id()
The index of the leftmost bit.
virtual ~d_tree_point_locator_path()
Destructor.
const d_bin_coordinates< DC, DB > & ub() const
The upper bound; the upper, right, rear corner.
Fixed point relative coordinates for a tree domain.
size_type height() const
The current height.
A point location query in domains with global coordinate dimension dc and local coordinate dimension ...
const d_bin_coordinates< DC, DB > & lb() const
The lower bound; the lower, left, front corner.
bool intersects(const d_bounding_box< DC, DB > *xbox) const
True if the tree box represented by the current head intersects the box with lower bound xlb and uppe...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
A bounding box that can be strung together into a list.
static size_type degree()
The degree of the tree this is a path for.
const d_bin_coordinates< DC, DB > & path() const
The representation of the path.
virtual bool invariant() const
Class invariant.
static size_type max_height()
The height of the root of the longest representable path.
A path in an d_tree_point_locator search structure.
void descend()
Descend one level in the path.
void put_head(size_type xhead)
Set the current head to xhead.
d_tree_point_locator< DC, DB > * tree() const
The tree this is a path in.
sheaf::size_type size_type
An unsigned integral type used to represent sizes and capacities.
Namespace for geometry component of sheaf system.