21 #ifndef D_ARRAY_POINT_LOCATOR_IMPL_H 22 #define D_ARRAY_POINT_LOCATOR_IMPL_H 24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 28 #ifndef D_ARRAY_POINT_LOCATOR_H 29 #include "SheafSystem/d_array_point_locator.h" 32 #ifndef D_BIN_POINT_LOCATOR_IMPL_H 33 #include "SheafSystem/d_bin_point_locator.impl.h" 45 template <
int DC,
int DB>
53 require(xpt_ub >= this->dc());
54 require(this->domain_contains(xpt, xpt_ub));
59 this->relative_position_pa(xpt, xpt_ub, lcoord);
70 template <
int DC,
int DB>
88 typename box_list_type::const_iterator itr = llist.
begin();
89 while((itr != llist.
end()) && (*itr != xbox))
94 result = (itr != llist.
end());
107 template <
int DC,
int DB>
125 ensure(this->is_empty());
136 template <
int DC,
int DB>
144 require(xcoords.
schema().
df() == DC);
145 require(xbin_ub.
ct() >= DC);
146 require_for_all(i, 0, xbin_ub.
ct(), xbin_ub[i] > 0);
150 for(
int i=0; i<DC; i++)
155 this->
update(xpopulate, xeval_capacity);
165 template <
int DC,
int DB>
173 require(xcoords.
schema().
df() == DC);
185 lbin_ub = (lbin_ub > 1) ? lbin_ub : 1;
188 for(
int i=0; i<DC; i++)
193 this->
update(xpopulate, xeval_capacity);
204 template <
int DC,
int DB>
221 template <
int DC,
int DB>
244 template <
int DC,
int DB>
268 template <
int DC,
int DB>
280 for(
int i=0; i<this->
dc(); i++)
282 xos <<
" " << this->
lb()[i];
287 for(
int i=0; i<this->
dc(); i++)
289 xos <<
" " << this->
ub()[i];
293 xos <<
"bin ct: " << this->
_bins.ct() << endl;
294 xos <<
"bins: " << endl;
297 xos <<
"bin " << i << endl;
298 xos << this->
_bins[i] << endl;
312 template <
int DC,
int DB>
325 for(
int i=0; i<DC; i++)
334 for(
int i=0; i<DC; i++)
342 for(
int i=0; i<DC; i++)
347 _bins.reserve(lbin_ct);
348 _bins.set_ct(lbin_ct);
362 template <
int DC,
int DB>
367 return (xi*this->
_bin_ub[1] + xj);
370 template <
int DC,
int DB>
385 template <
int DC,
int DB>
392 invariance(
size() > 0);
404 template <
int DC,
int DB>
406 operator<<(std::ostream& xos, const d_array_point_locator<DC, DB>& xpl)
421 template <
int DC,
int DB>
423 operator<<(std::ostream& xos, const singly_linked_list<const d_bounding_box<DC, DB>*>& xbl)
433 for(
typename list_type::const_iterator i = xbl.begin(); i != xbl.end(); ++i)
447 #endif // D_ARRAY_POINT_LOCATOR_IMPL_H virtual void update()
Updates the search structure to the current values of coordinates(); synonym for update(true);.
singly_linked_list< const d_bounding_box< DC, DB > * > box_list_type
The type of box list.
size_type size() const
The number of bins used by the search structure.
size_type ct() const
The number of items currently in use.
virtual bool invariant() const
Class invariant.
block< sec_vd_value_type > _one_over_min_bin_size
Reciprocal of the dimensions of the smallest bins.
virtual ~d_array_point_locator()
Destructor.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool is_empty() const
True if this contains no bounding boxes.
const block< sec_vd_value_type > & lb() const
The lower bound of the domain defined by coordinates().
iterator begin()
Returns an iterator to the first element of the container.
Fixed point relative coordinates for a tree domain.
block< box_list_type > _bins
The search structure; a d-dimensional array of bins.
static int_type ub()
The upper bound for components.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
d_array_point_locator()
Default constructor; disabled.
block< sec_vd_value_type > _lb
The lower bound of the domain.
block< size_type > _bin_ub
The upper bound for the bin index.
virtual bool contains_box(d_bounding_box< DC, DB > *xbox) const
True if xbox is in this.
const d_bin_coordinates< DC, DB > & lb() const
The lower bound; the lower, left, front corner.
size_type bin_id(const d_bin_coordinates< DC, DB > &xcoord) const
The single index (offset) associated with tree coordinates xcoord.
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.
iterator end()
Returns an iterator to the element following the last element of the container.
SHEAF_DLL_SPEC void log(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute log of x0 (log(x0)) (pre-allocated version).
virtual const box_list_type & box_list(sec_vd_value_type *xpt, size_type xpt_ub) const
The list of bounding boxes which may contain xpt.
void update_bins()
Resets this with bounds xlb, xub, and xbin_ub. If xbin_ub == 0; use default_bin_ub().
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
int dc() const
The spatial dimension of the domain; the dimension of the global coordinates.
int evaluation_ct() const
The number of members in the intersection of the evaluation subposet and the down set of the base spa...
block< sec_vd_value_type > _ub
The upper bound of the domain.
virtual void clear()
Clear this of all bounding boxes.
const block< sec_vd_value_type > & ub() const
The upper bound of the domain defined by coordinates().
int df() const
The dimension of the fiber space component.
SHEAF_DLL_SPEC void exp(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute exp of x0 (exp(x0)) (pre-allocated version).
void to_stream(std::ostream &xos) const
Inserts this in ostream xos.
size_type capacity() const
The number of bins allocated for use by the search structure.
Namespace for geometry component of sheaf system.
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
An abstract point location query in domains with global coordinate dimension dc and local coordinate ...
block< sec_vd_value_type > _bin_size
The dimensions of the smallest bins.
Wrapper class for forward_list or slist depending on compiler. The class replicates the minimum subse...