21 #include "SheafSystem/db0_point_locator.impl.h" 23 #include "SheafSystem/block.impl.h" 24 #include "SheafSystem/section_space_schema_poset.h" 37 bin_id(
const bin_coord_type xcoord[])
const 45 bin_id(
const bin_coord_type xcoord[])
const 47 return (xcoord[0]*_bin_ub[1] + xcoord[1]);
53 bin_id(
const bin_coord_type xcoord[])
const 55 return (xcoord[0]*_bin_ub[1] + xcoord[1])*_bin_ub[2] + xcoord[2];
61 print_bins(std::ostream& xos,
const std::string& xmsg)
const 68 xos << endl << xmsg << endl;
70 xos <<
"_bins.ub()= " << _bins.ub()
71 <<
" _bins.ct()= " << _bins.ct()
75 for(
int i=0; i<_bin_ub[0]; ++i)
77 for(
int j=0; j<_bin_ub[1]; ++j)
79 for(
int k=0; k<_bin_ub[2]; ++k)
81 cout <<
"bin: " << setw(3) << l++;
87 cout << setw(16) << i*_bin_size[0] + _lb[0];
88 cout << setw(16) << j*_bin_size[1] + _lb[1];
89 cout << setw(16) << k*_bin_size[2] + _lb[2];
92 cout <<
" vertices: " << endl;
94 const vertex_list_type& lverts = _bins[i];
96 for(vertex_list_type::const_iterator lv_itr = lverts.begin();
97 lv_itr != lverts.end();
100 cout << setw(6) << lv_itr->disc_id
101 << setw(6) << lv_itr->branch_id
102 << setw(16) << lv_itr->coords[0]
103 << setw(16) << lv_itr->coords[1]
104 << setw(16) << lv_itr->coords[2]
147 result = dist > result ? dist : result;
151 ensure(result >= 0.0);
173 for(
int i=0; i< 2; ++i)
177 del[i][0] = deli0*deli0;
180 del[i][1] = deli1*deli1;
185 for(
int i=0; i<2; ++i)
187 for(
int j=0; j<2; ++j)
195 result =
sqrt(result);
199 ensure(result >= 0.0);
220 #ifdef DIAGNOSTIC_OUTPUT 223 << setw(3) << xbin_pos[0]
224 << setw(3) << xbin_pos[1]
225 << setw(3) << xbin_pos[2]
230 for(
int i=0; i< 3; ++i)
234 del[i][0] = deli0*deli0;
237 del[i][1] = deli1*deli1;
239 #ifdef DIAGNOSTIC_OUTPUT 242 <<
" del[c][0]: " << del[i][0]
243 <<
" del[c][1]: " << del[i][1] << endl;
250 for(
int i=0; i<2; ++i)
252 for(
int j=0; j<2; ++j)
254 for(
int k=0; k<2; ++k)
260 #ifdef DIAGNOSTIC_OUTPUT 262 cout <<
"corner: " << setw(2) << i << setw(2) << j << setw(2) << k
263 <<
" dist:" << setw(16) << dist
264 <<
" result:" << setw(16) << result
272 result =
sqrt(result);
276 ensure(result >= 0.0);
297 for(
int i=_search_region_lb[0]; i<_search_region_ub[0]; ++i)
302 #ifdef DIAGNOSTIC_OUTPUT 303 print_queue(cout,
"search_q: ");
330 for(i=_search_region_lb[0]; i<_search_region_ub[0]; ++i)
332 for(j=_search_region_lb[1]; j<_search_region_ub[1]; ++j)
334 _search_q.push(bin_id(lbin_coord));
338 #ifdef DIAGNOSTIC_OUTPUT 339 print_queue(cout,
"search_q: ");
366 for(i=_search_region_lb[0]; i<_search_region_ub[0]; ++i)
368 for(j=_search_region_lb[1]; j<_search_region_ub[1]; ++j)
370 for(k=_search_region_lb[2]; k<_search_region_ub[2]; ++k)
372 _search_q.push(bin_id(lbin_coord));
377 #ifdef DIAGNOSTIC_OUTPUT 378 print_queue(cout,
"search_q: ");
395 for(
int i=_search_region_lb[0]; i<_search_region_ub[0];)
397 bool new_i = (i < xold_lb[0]) || (i >= xold_ub[0]);
402 _search_q.push(bin_id(&i));
413 #ifdef DIAGNOSTIC_OUTPUT 414 print_queue(cout,
"search_q: ");
436 for(j=_search_region_lb[1]; j<_search_region_ub[1]; ++j)
438 bool new_j = (j < xold_lb[1]) || (j >= xold_ub[1]);
439 for(i=_search_region_lb[0]; i<_search_region_ub[0];)
441 bool new_i = (i < xold_lb[0]) || (i >= xold_ub[0]);
444 _search_q.push(bin_id(lbin_coord));
454 #ifdef DIAGNOSTIC_OUTPUT 455 print_queue(cout,
"search_q: ");
477 for(k=_search_region_lb[2]; k<_search_region_ub[2]; ++k)
479 bool new_k = (k < xold_lb[2]) || (k >= xold_ub[2]);
480 for(j=_search_region_lb[1]; j<_search_region_ub[1]; ++j)
482 bool new_j = (j < xold_lb[1]) || (j >= xold_ub[1]);
483 for(i=_search_region_lb[0]; i<_search_region_ub[0];)
485 bool new_i = (i < xold_lb[0]) || (i >= xold_ub[0]);
486 if(new_k || new_j || new_i)
488 _search_q.push(bin_id(lbin_coord));
499 #ifdef DIAGNOSTIC_OUTPUT 500 print_queue(cout,
"search_q: ");
SHEAF_DLL_SPEC void sqrt(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute sqrt of x0 (sqrt(x0)) (pre-allocated version).
An abstract point location query in domains with global coordinate dimension DC and local coordinate ...
int bin_coord_type
The type of the bin coordinates.
SHEAF_DLL_SPEC void max(const vd &x0, vd_value_type &xresult, bool xauto_access)
Maximum component of x0, pre-allocated version.
void print_bins(std::ostream &xos, const std::string &xmsg) const
Prints the contents of the bins on xos; intended for debugging.
sec_vd_value_type max_bin_distance(const sec_vd_value_type xpt[], const bin_coord_type xbin_pos[]) const
The maximum distance from the query point xpt to any point in the bin with coordinates xbin_pos...
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.
int bin_id(const bin_coord_type xcoord[]) const
The id of the bin with bin coords xcoord.