#include "kd_tree.h"
#include "bd_tree.h"
Go to the source code of this file.
|
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) |
|
static ANNkd_ptr | annReadTree (istream &in, ANNtreeType tree_type, ANNidxArray the_pidx, int &next_idx) |
|
Enumerator |
---|
KD_TREE |
|
BD_TREE |
|
Definition at line 46 of file kd_dump.cpp.
Definition at line 253 of file kd_dump.cpp.
References ANNabort, annAllocPt(), annAllocPts(), annError(), annReadTree(), ANNwarn, STRING_LEN, and version.
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) {
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
DLL_API ANNpoint annAllocPt(int dim, ANNcoord c=0)
void annError(const char *msg, ANNerr level)
DLL_API ANNpointArray annAllocPts(int n, int dim)
Definition at line 368 of file kd_dump.cpp.
References ANNabort, annError(), BD_TREE, KD_TRIVIAL, n_pts, and STRING_LEN.
Referenced by annReadDump().
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;
static ANNkd_ptr annReadTree(istream &in, ANNtreeType tree_type, ANNidxArray the_pidx, int &next_idx)
void annError(const char *msg, ANNerr level)
const double EPSILON = 1E-5 |
const int STRING_LEN = 500 |