109 out <<
"points " <<
dim <<
" " <<
n_pts <<
"\n";
110 for (
int i = 0; i <
n_pts; i++) {
137 out <<
"split " << cut_dim <<
" " << cut_val <<
" ";
138 out << cd_bnds[
ANN_LO] <<
" " << cd_bnds[
ANN_HI] <<
"\n";
151 out <<
"leaf " <<
n_pts;
152 for (
int j = 0; j <
n_pts; j++) {
153 out <<
" " << bkt[j];
162 out <<
"shrink " << n_bnds <<
"\n";
163 for (
int j = 0; j < n_bnds; j++) {
164 out << bnds[j].cd <<
" " << bnds[j].cv <<
" " << bnds[j].sd <<
"\n";
203 the_dim, the_n_pts, the_bkt_size,
204 the_bnd_box_lo, the_bnd_box_hi);
207 SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
209 bnd_box_lo = the_bnd_box_lo;
210 bnd_box_hi = the_bnd_box_hi;
232 the_dim, the_n_pts, the_bkt_size,
233 the_bnd_box_lo, the_bnd_box_hi);
236 SkeletonTree(the_n_pts, the_dim, the_bkt_size, the_pts, the_pidx);
237 bnd_box_lo = the_bnd_box_lo;
238 bnd_box_hi = the_bnd_box_hi;
273 if (strcmp(str,
"#ANN") != 0) {
284 if (strcmp(str,
"points") == 0) {
289 for (
int i = 0; i < the_n_pts; i++) {
292 if (idx < 0 || idx >= the_n_pts) {
295 for (j = 0; j < the_dim; j++) {
296 in >> the_pts[idx][j];
313 if (strcmp(str,
"tree") == 0) {
320 for (j = 0; j < the_dim; j++) {
321 in >> the_bnd_box_lo[j];
323 for (j = 0; j < the_dim; j++) {
324 in >> the_bnd_box_hi[j];
326 the_pidx =
new ANNidx[the_n_pts];
329 the_root =
annReadTree(in, tree_type, the_pidx, next_idx);
330 if (next_idx != the_n_pts) {
385 if (strcmp(tag,
"null") == 0) {
391 if (strcmp(tag,
"leaf") == 0) {
394 int old_idx = next_idx;
399 for (
int i = 0; i <
n_pts; i++) {
400 in >> the_pidx[next_idx++];
403 return new ANNkd_leaf(n_pts, &the_pidx[old_idx]);
408 else if (strcmp(tag,
"split") == 0) {
410 in >> cd >> cv >> lb >> hb;
421 else if (strcmp(tag,
"shrink") == 0) {
429 for (
int i = 0; i < n_bnds; i++) {
430 in >> cd >> cv >> sd;
virtual void dump(ostream &out)
static ANNkd_ptr annReadTree(istream &in, ANNtreeType tree_type, ANNidxArray the_pidx, int &next_idx)
and that you are informed that you can do these things To protect your we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it For if you distribute copies of the whether gratis or for a you must give the recipients all the rights that we gave you You must make sure that receive or can get the source code If you link other code with the you must provide complete object files to the so that they can relink them with the library after making changes to the library and recompiling it And you must show them these terms so they know their rights We protect your rights with a two step which gives you legal permission to distribute and or modify the library To protect each we want to make it very clear that there is no warranty for the free library if the library is modified by someone else and passed the recipients should know that what they have is not the original version
ANNbd_tree(int n, int dd, int bs=1)
virtual void dump(ostream &out)
ANNkd_tree(int n=0, int dd=0, int bs=1)
DLL_API ANNpoint annAllocPt(int dim, ANNcoord c=0)
void annError(const char *msg, ANNerr level)
virtual void dump(ostream &out)
DLL_API ANNpointArray annAllocPts(int n, int dim)
virtual void Dump(ANNbool with_pts, std::ostream &out)
static ANNkd_ptr annReadDump(istream &in, ANNtreeType tree_type, ANNpointArray &the_pts, ANNidxArray &the_pidx, int &the_dim, int &the_n_pts, int &the_bkt_size, ANNpoint &the_bnd_box_lo, ANNpoint &the_bnd_box_hi)
void annPrintPt(ANNpoint pt, int dim, std::ostream &out)