Changeset 21625
- Timestamp:
- 03/23/17 14:24:51 (8 years ago)
- Location:
- issm/trunk-jpl/src/c/bamg
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp ¶
r21623 r21625 8 8 namespace bamg { 9 9 #define ABS(i) ((i)<0 ?-(i) :(i)) 10 #define MAXDEPTH 30 10 11 /*DOCUMENTATION What is a BamgQuadtree? {{{ 11 12 * A Quadtree is a very simple way to group vertices according … … 60 61 61 62 /*Initialize fields*/ 62 this->MaxDepth = 30;63 63 this->MaxISize = 1073741824; //2^30 64 64 this->MaxICoord = 1073741823; //2^30 - 1 … … 76 76 77 77 /*Initialize fields*/ 78 this->MaxDepth = 30;79 78 this->MaxISize = 1073741824; //2^30 80 79 this->MaxICoord = 1073741823; //2^30 - 1 … … 142 141 } 143 142 144 /*check that l is not 0 (this should not happen as M axDepth= 30)*/143 /*check that l is not 0 (this should not happen as MAXDEPTH = 30)*/ 145 144 _assert_(level>0); 146 145 … … 249 248 250 249 /*Initialize level and sizes for largest box*/ 251 int levelbin = (1L<< this->MaxDepth);// = 2^30250 int levelbin = (1L<<MAXDEPTH);// = 2^30 252 251 int h = this->MaxISize; 253 252 int hb = this->MaxISize; … … 303 302 304 303 /*Initialize search variables*/ 305 BamgQuadtreeBox **pb = xNew<BamgQuadtreeBox*>(this->MaxDepth);306 int * pi = xNew<int>(this->MaxDepth);307 int * ii = xNew<int>(this->MaxDepth);308 int * jj = xNew<int>(this->MaxDepth);304 BamgQuadtreeBox* pb[MAXDEPTH]; 305 int pi[MAXDEPTH]; 306 int ii[MAXDEPTH]; 307 int jj[MAXDEPTH]; 309 308 pb[0]=b; //pointer toward the box b 310 309 pi[0]=b->nbitems>0?(int)b->nbitems:4;//number of boxes in b … … 382 381 383 382 /*return nearest vertex pointer*/ 384 xDelete<BamgQuadtreeBox*>(pb);385 xDelete<int>(pi);386 xDelete<int>(ii);387 xDelete<int>(jj);388 383 return nearest_v; 389 384 } … … 439 434 Metric* Mx = new Metric(v->m); 440 435 441 BamgQuadtreeBox *pb[M axDepth];442 int pi[M axDepth];443 int ii[M axDepth], jj[MaxDepth];436 BamgQuadtreeBox *pb[MAXDEPTH]; 437 int pi[MAXDEPTH]; 438 int ii[MAXDEPTH], jj[MAXDEPTH]; 444 439 int l=0; // level 445 440 BamgQuadtreeBox* b; -
TabularUnified issm/trunk-jpl/src/c/bamg/BamgQuadtree.h ¶
r21623 r21625 37 37 38 38 /*BamgQuadtree public Fields*/ 39 int MaxDepth; // maximum number of subdivision40 39 int MaxICoord; // maximum integer coordinate 2^MaxDepth -1 41 40 int MaxISize; // maximum integer coordinate 2^MaxDepth
Note:
See TracChangeset
for help on using the changeset viewer.