#include <ctime>#include <cmath>#include <string>#include <fstream>#include <ANN/ANN.h>#include <ANN/ANNx.h>#include <ANN/ANNperf.h>#include "rand.h"Go to the source code of this file.
| #define CLOCKS_PER_SEC 1000000 |
Definition at line 49 of file ann_test.cpp.
Referenced by main().
| #define log2 | ( | x | ) | (log(x)/log(2.0)) |
Definition at line 1566 of file ann_test.cpp.
Referenced by treeStats().
| enum Distrib |
| UNIFORM | |
| GAUSS | |
| LAPLACE | |
| CO_GAUSS | |
| CO_LAPLACE | |
| CLUS_GAUSS | |
| CLUS_ORTH_FLATS | |
| CLUS_ELLIPSOIDS | |
| PLANTED | |
| N_DISTRIBS |
Definition at line 317 of file ann_test.cpp.
| enum PtType |
Definition at line 287 of file ann_test.cpp.
| enum StatLev |
Definition at line 293 of file ann_test.cpp.
| void doValidation | ( | ) |
Definition at line 1463 of file ann_test.cpp.
References ann_average_err, ANN_DBL_MAX, ANN_NULL_IDX, ann_rank_err, ANN_ROOT, ANNabort, ERR, and Error().
Referenced by main().
| void Error | ( | char * | msg, | |
| ANNerr | level | |||
| ) |
Definition at line 372 of file ann_test.cpp.
References ANNabort.
| void generatePts | ( | ANNpointArray & | pa, | |
| int | n, | |||
| PtType | type, | |||
| ANNbool | new_clust, | |||
| ANNpointArray | src = NULL, |
|||
| int | n_src = 0 | |||
| ) |
Definition at line 1187 of file ann_test.cpp.
References ANNabort, annAllocPts(), annClusEllipsoids(), annClusGaussPts(), annClusOrthFlats(), annCoGaussPts(), annCoLaplacePts(), annDeallocPts(), annGaussPts(), annIdum, annLaplacePts(), annPlanted(), annUniformPts(), CLUS_ELLIPSOIDS, CLUS_GAUSS, CLUS_ORTH_FLATS, CO_GAUSS, CO_LAPLACE, DATA, distr_table, Error(), GAUSS, LAPLACE, PLANTED, printPoint(), QUERY, QUERY_RES, SHOW_PTS, SILENT, and UNIFORM.
Referenced by main().
| ANNbool getDirective | ( | istream & | in, | |
| char * | directive | |||
| ) |
Definition at line 607 of file ann_test.cpp.
References ANNfalse, ANNtrue, and skipComment().
Referenced by main().
| void getTrueNN | ( | ) |
Definition at line 1370 of file ann_test.cpp.
References ANN_POW, ANNfalse, ANNbruteForce::annkFRSearch(), ANNbruteForce::annkSearch(), and SILENT.
Referenced by main().
| void initGlobals | ( | ) |
Definition at line 546 of file ann_test.cpp.
References annIdum, ANNtrue, def_shrink, and def_split.
Referenced by main().
| int lookUp | ( | const char * | arg, | |
| const char(*) | table[STRING_LEN], | |||
| int | size | |||
| ) |
Definition at line 397 of file ann_test.cpp.
Referenced by main().
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 624 of file ann_test.cpp.
References ANN_NULL_IDX, ANN_POW, ANN_ROOT, ANNabort, annClose(), ANNcopyright, annDeallocPts(), ANNfalse, annIdum, ANNkd_tree::annkFRSearch(), ANNkd_tree::annkPriSearch(), ANNkd_tree::annkSearch(), ANNlatestRev, annMaxPtsVisit(), annPrintStats(), annResetCounts(), annResetStats(), ANNtrue, annUpdateStats(), ANNversion, ANNversionCmt, ANNwarn, CLOCKS_PER_SEC, DATA, distr_table, doValidation(), ANNkd_tree::Dump(), Error(), EXEC_TIME, generatePts(), getDirective(), getTrueNN(), initGlobals(), lookUp(), N_DISTRIBS, N_SHRINK_RULES, N_SPLIT_RULES, N_STAT_LEVELS, ANNkd_tree::nPoints(), PLANTED, PREP_STATS, ANNkd_tree::Print(), QUERY, QUERY_RES, QUERY_STATS, readPts(), SHOW_STRUCT, shrink_table, SILENT, split_table, stat_table, STRING_LEN, ANNkd_tree::theDim(), ANNkd_tree::thePoints(), and treeStats().
| void printPoint | ( | ANNpoint | p, | |
| int | dim | |||
| ) |
Definition at line 385 of file ann_test.cpp.
Referenced by generatePts(), and readPts().
| void readPts | ( | ANNpointArray & | pa, | |
| int & | n, | |||
| char * | file_nm, | |||
| PtType | type | |||
| ) |
Definition at line 1279 of file ann_test.cpp.
References ANNabort, annAllocPts(), annDeallocPts(), ANNwarn, DATA, Error(), printPoint(), QUERY, QUERY_RES, SHOW_PTS, and SILENT.
Referenced by main().
| ANNbool skipComment | ( | istream & | in | ) |
Definition at line 590 of file ann_test.cpp.
References ANNfalse, and ANNtrue.
Referenced by getDirective().
| void treeStats | ( | ostream & | out, | |
| ANNbool | verbose | |||
| ) |
Definition at line 1568 of file ann_test.cpp.
References ANNtrue, ANNkdStats::avg_ar, ANNkdStats::bkt_size, ANNkdStats::depth, ANNkdStats::dim, ANNkd_tree::getStats(), Py::int, log2, ANNkdStats::n_lf, ANNkdStats::n_pts, ANNkdStats::n_shr, ANNkdStats::n_spl, and ANNkdStats::n_tl.
Referenced by main().
Definition at line 533 of file ann_test.cpp.
Definition at line 532 of file ann_test.cpp.
| int* apx_pts_in_range |
Definition at line 534 of file ann_test.cpp.
| int bucket_size |
Definition at line 479 of file ann_test.cpp.
| double corr_coef |
Definition at line 475 of file ann_test.cpp.
Definition at line 529 of file ann_test.cpp.
| int data_size |
Definition at line 469 of file ann_test.cpp.
| const int def_bucket_size = 1 |
Definition at line 448 of file ann_test.cpp.
| const double def_corr_coef = 0.05 |
Definition at line 447 of file ann_test.cpp.
| const int def_data_size = 100 |
Definition at line 440 of file ann_test.cpp.
| const int def_dim = 2 |
Definition at line 439 of file ann_test.cpp.
Definition at line 445 of file ann_test.cpp.
| const double def_epsilon = 0.0 |
Definition at line 449 of file ann_test.cpp.
| const int def_max_dim = 1 |
Definition at line 444 of file ann_test.cpp.
| const int def_max_visit = 0 |
Definition at line 451 of file ann_test.cpp.
| const int def_n_color = 5 |
Definition at line 442 of file ann_test.cpp.
| const int def_near_neigh = 1 |
Definition at line 450 of file ann_test.cpp.
| const ANNbool def_new_clust = ANNfalse |
Definition at line 443 of file ann_test.cpp.
| const int def_query_size = 100 |
Definition at line 441 of file ann_test.cpp.
| const int def_rad_bound = 0 |
Definition at line 452 of file ann_test.cpp.
| const int def_seed = 0 |
Definition at line 455 of file ann_test.cpp.
| const ANNshrinkRule def_shrink = ANN_BD_NONE |
Definition at line 462 of file ann_test.cpp.
Referenced by initGlobals().
| const ANNsplitRule def_split = ANN_KD_SUGGEST |
Definition at line 460 of file ann_test.cpp.
Referenced by initGlobals().
Definition at line 458 of file ann_test.cpp.
| const double def_std_dev = 1.00 |
Definition at line 446 of file ann_test.cpp.
| const int def_true_nn = def_near_neigh + extra_nn |
Definition at line 454 of file ann_test.cpp.
| const ANNbool def_validate = ANNfalse |
Definition at line 456 of file ann_test.cpp.
| int dim |
Definition at line 468 of file ann_test.cpp.
Definition at line 474 of file ann_test.cpp.
| const char distr_table[N_DISTRIBS][STRING_LEN] |
{
"uniform",
"gauss",
"laplace",
"co_gauss",
"co_laplace",
"clus_gauss",
"clus_orth_flats",
"clus_ellipsoids",
"planted"}
Definition at line 330 of file ann_test.cpp.
Referenced by generatePts(), and main().
| double epsilon |
Definition at line 480 of file ann_test.cpp.
Referenced by Base::BoundBoxPy::getIntersectionPoint(), and Base::Vector3< _Precision >::operator==().
| const double ERR = 0.00001 |
Definition at line 281 of file ann_test.cpp.
| const int extra_nn = 10 |
Definition at line 437 of file ann_test.cpp.
| int max_dim |
Definition at line 473 of file ann_test.cpp.
Referenced by annMaxSpread().
| int* max_pts_in_range |
Definition at line 538 of file ann_test.cpp.
| int max_pts_visit |
Definition at line 482 of file ann_test.cpp.
| int* min_pts_in_range |
Definition at line 537 of file ann_test.cpp.
| int n_color |
Definition at line 471 of file ann_test.cpp.
| const int N_SHRINK_RULES = 4 |
Definition at line 358 of file ann_test.cpp.
Referenced by main().
| const int N_SPLIT_RULES = 6 |
Definition at line 345 of file ann_test.cpp.
Referenced by main().
| int near_neigh |
Definition at line 481 of file ann_test.cpp.
Definition at line 472 of file ann_test.cpp.
Definition at line 530 of file ann_test.cpp.
| int query_size |
Definition at line 470 of file ann_test.cpp.
| double radius_bound |
Definition at line 483 of file ann_test.cpp.
Definition at line 488 of file ann_test.cpp.
| const char shrink_table[N_SHRINK_RULES][STRING_LEN] |
{
"none",
"simple",
"centroid",
"suggest"}
Definition at line 359 of file ann_test.cpp.
Referenced by main().
| ANNsplitRule split |
Definition at line 487 of file ann_test.cpp.
Referenced by Robot::Robot6Axis::readKinematic(), and MeshCore::MeshAlgorithm::SplitBoundaryLoops().
| const char split_table[N_SPLIT_RULES][STRING_LEN] |
{
"standard",
"midpt",
"fair",
"sl_midpt",
"sl_fair",
"suggest"}
Definition at line 346 of file ann_test.cpp.
Referenced by main().
| const char stat_table[N_STAT_LEVELS][STRING_LEN] |
{
"silent",
"exec_time",
"prep_stats",
"query_stats",
"query_res",
"show_pts",
"show_struct"}
Definition at line 304 of file ann_test.cpp.
Referenced by main().
Definition at line 486 of file ann_test.cpp.
| double std_dev |
Definition at line 476 of file ann_test.cpp.
Referenced by annClusEllipsoids().
| double std_dev_hi |
Definition at line 478 of file ann_test.cpp.
| double std_dev_lo |
Definition at line 477 of file ann_test.cpp.
| const int STRING_LEN = 500 |
Definition at line 280 of file ann_test.cpp.
Definition at line 531 of file ann_test.cpp.
Definition at line 536 of file ann_test.cpp.
| int true_nn |
Definition at line 484 of file ann_test.cpp.
Definition at line 535 of file ann_test.cpp.
Definition at line 540 of file ann_test.cpp.
Definition at line 485 of file ann_test.cpp.
Referenced by Sandbox::DocumentProtector::addObject(), Py::Boolean::Boolean(), Py::Char::Char(), Py::Complex::Complex(), Sandbox::DocumentObjectProtector::execute(), Py::Float::Float(), Py::Int::Int(), Py::Long::Long(), Py::Object::Object(), Sandbox::DocumentProtector::recompute(), Sandbox::DocumentProtector::removeObject(), Py::Object::set(), Sandbox::DocumentObjectProtector::setProperty(), Py::Type::Type(), and Py::Vector::Vector().
1.6.1