| 
    queso-0.55.0
    
   | 
 
#include <ctime>#include <cmath>#include <cstring>#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.
Macros | |
| #define | CLOCKS_PER_SEC 1000000 | 
| #define | log2(x) (log(x)/log(2.0)) | 
Enumerations | |
| enum | PtType { DATA, QUERY } | 
| enum | StatLev {  SILENT, EXEC_TIME, PREP_STATS, QUERY_STATS, QUERY_RES, SHOW_PTS, SHOW_STRUCT, N_STAT_LEVELS }  | 
| enum | Distrib {  UNIFORM, GAUSS, LAPLACE, CO_GAUSS, CO_LAPLACE, CLUS_GAUSS, CLUS_ORTH_FLATS, CLUS_ELLIPSOIDS, PLANTED, N_DISTRIBS }  | 
Functions | |
| void | Error (const char *msg, ANNerr level) | 
| void | printPoint (ANNpoint p, int dim) | 
| int | lookUp (const char *arg, const char(*table)[STRING_LEN], int size) | 
| void | generatePts (ANNpointArray &pa, int n, PtType type, ANNbool new_clust, ANNpointArray src=NULL, int n_src=0) | 
| void | readPts (ANNpointArray &pa, int &n, char *file_nm, PtType type) | 
| void | doValidation () | 
| void | getTrueNN () | 
| void | treeStats (ostream &out, ANNbool verbose) | 
| void | initGlobals () | 
| ANNbool | skipComment (istream &in) | 
| ANNbool | getDirective (istream &in, char *directive) | 
| int | main (int argc, char **argv) | 
| #define CLOCKS_PER_SEC 1000000 | 
Definition at line 52 of file ann_test.cpp.
Referenced by main().
| #define log2 | ( | x | ) | (log(x)/log(2.0)) | 
Definition at line 1570 of file ann_test.cpp.
Referenced by treeStats().
| enum Distrib | 
| Enumerator | |
|---|---|
| UNIFORM | |
| GAUSS | |
| LAPLACE | |
| CO_GAUSS | |
| CO_LAPLACE | |
| CLUS_GAUSS | |
| CLUS_ORTH_FLATS | |
| CLUS_ELLIPSOIDS | |
| PLANTED | |
| N_DISTRIBS | |
Definition at line 321 of file ann_test.cpp.
| enum PtType | 
| Enumerator | |
|---|---|
| DATA | |
| QUERY | |
Definition at line 291 of file ann_test.cpp.
| enum StatLev | 
| Enumerator | |
|---|---|
| SILENT | |
| EXEC_TIME | |
| PREP_STATS | |
| QUERY_STATS | |
| QUERY_RES | |
| SHOW_PTS | |
| SHOW_STRUCT | |
| N_STAT_LEVELS | |
Definition at line 297 of file ann_test.cpp.
| void doValidation | ( | ) | 
Definition at line 1467 of file ann_test.cpp.
References ann_average_err, ANN_DBL_MAX, ANN_NULL_IDX, ann_rank_err, ANN_ROOT, ANNabort, apx_dists, apx_nn_idx, apx_pts_in_range, epsilon, ERR, Error(), max_pts_in_range, max_pts_visit, min_pts_in_range, near_neigh, query_size, radius_bound, RND_OFF, true_dists, true_nn, and true_nn_idx.
Referenced by main().
Definition at line 376 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 1191 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, corr_coef, DATA, dim, distr, distr_table, Error(), GAUSS, LAPLACE, max_dim, n_color, PLANTED, printPoint(), QUERY, QUERY_RES, SHOW_PTS, SILENT, stats, std_dev, std_dev_hi, std_dev_lo, and UNIFORM.
Referenced by main().
| ANNbool getDirective | ( | istream & | in, | 
| char * | directive | ||
| ) | 
Definition at line 611 of file ann_test.cpp.
References ANNfalse, ANNtrue, and skipComment().
Referenced by main().
| void getTrueNN | ( | ) | 
Definition at line 1374 of file ann_test.cpp.
References ANN_POW, ANNfalse, ANNbruteForce::annkFRSearch(), ANNbruteForce::annkSearch(), data_pts, data_size, dim, epsilon, max_pts_in_range, min_pts_in_range, query_pts, query_size, radius_bound, SILENT, stats, true_dists, true_nn, true_nn_idx, and valid_dirty.
Referenced by main().
| void initGlobals | ( | ) | 
Definition at line 550 of file ann_test.cpp.
References annIdum, ANNtrue, apx_dists, apx_nn_idx, apx_pts_in_range, bucket_size, corr_coef, data_pts, data_size, def_bucket_size, def_corr_coef, def_data_size, def_dim, def_distr, def_epsilon, def_max_dim, def_max_visit, def_n_color, def_near_neigh, def_new_clust, def_query_size, def_rad_bound, def_seed, def_shrink, def_split, def_stats, def_std_dev, def_true_nn, def_validate, dim, distr, epsilon, max_dim, max_pts_in_range, max_pts_visit, min_pts_in_range, n_color, near_neigh, new_clust, query_pts, query_size, radius_bound, shrink, split, stats, std_dev, std_dev_hi, std_dev_lo, the_tree, true_dists, true_nn, true_nn_idx, valid_dirty, and validate.
Referenced by main().
| int lookUp | ( | const char * | arg, | 
| const char(*) | table[STRING_LEN], | ||
| int | size | ||
| ) | 
Definition at line 401 of file ann_test.cpp.
References table.
Referenced by main().
| int main | ( | int | argc, | 
| char ** | argv | ||
| ) | 
Definition at line 628 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, apx_dists, apx_nn_idx, apx_pts_in_range, bucket_size, CLOCKS_PER_SEC, corr_coef, DATA, data_pts, data_size, dim, distr, distr_table, doValidation(), ANNkd_tree::Dump(), epsilon, Error(), EXEC_TIME, extra_nn, generatePts(), getDirective(), getTrueNN(), initGlobals(), lookUp(), max_dim, max_pts_visit, method, n_color, N_DISTRIBS, N_SHRINK_RULES, N_SPLIT_RULES, N_STAT_LEVELS, near_neigh, new_clust, ANNkd_tree::nPoints(), PLANTED, PREP_STATS, ANNkd_tree::Print(), QUERY, query_pts, QUERY_RES, query_size, QUERY_STATS, radius_bound, readPts(), SHOW_STRUCT, shrink, shrink_table, SILENT, split, split_table, stat_table, stats, std_dev, std_dev_hi, std_dev_lo, STRING_LEN, the_tree, ANNkd_tree::theDim(), ANNkd_tree::thePoints(), treeStats(), true_nn, valid_dirty, and validate.
Definition at line 389 of file ann_test.cpp.
References dim.
Referenced by generatePts(), and readPts().
| void readPts | ( | ANNpointArray & | pa, | 
| int & | n, | ||
| char * | file_nm, | ||
| PtType | type | ||
| ) | 
Definition at line 1283 of file ann_test.cpp.
References ANNabort, annAllocPts(), annDeallocPts(), ANNwarn, DATA, dim, Error(), printPoint(), QUERY, QUERY_RES, SHOW_PTS, SILENT, and stats.
Referenced by main().
| ANNbool skipComment | ( | istream & | in | ) | 
Definition at line 594 of file ann_test.cpp.
References ANNfalse, and ANNtrue.
Referenced by getDirective().
Definition at line 1572 of file ann_test.cpp.
References ANNtrue, ANNkdStats::avg_ar, ANNkdStats::bkt_size, ANNkdStats::depth, ANNkdStats::dim, ANNkd_tree::getStats(), log2, ANNkdStats::n_lf, ANNkdStats::n_pts, ANNkdStats::n_shr, ANNkdStats::n_spl, ANNkdStats::n_tl, and the_tree.
Referenced by main().
| ANNdistArray apx_dists | 
Definition at line 537 of file ann_test.cpp.
Referenced by doValidation(), initGlobals(), and main().
| ANNidxArray apx_nn_idx | 
Definition at line 536 of file ann_test.cpp.
Referenced by doValidation(), initGlobals(), and main().
| int* apx_pts_in_range | 
Definition at line 538 of file ann_test.cpp.
Referenced by doValidation(), initGlobals(), and main().
| int bucket_size | 
Definition at line 483 of file ann_test.cpp.
Referenced by initGlobals(), and main().
| double corr_coef | 
Definition at line 479 of file ann_test.cpp.
Referenced by generatePts(), initGlobals(), and main().
| ANNpointArray data_pts | 
Definition at line 533 of file ann_test.cpp.
Referenced by getTrueNN(), initGlobals(), and main().
| int data_size | 
Definition at line 473 of file ann_test.cpp.
Referenced by annResetStats(), getTrueNN(), initGlobals(), and main().
| const int def_bucket_size = 1 | 
Definition at line 452 of file ann_test.cpp.
Referenced by initGlobals().
| const double def_corr_coef = 0.05 | 
Definition at line 451 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_data_size = 100 | 
Definition at line 444 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_dim = 2 | 
Definition at line 443 of file ann_test.cpp.
Referenced by initGlobals().
Definition at line 449 of file ann_test.cpp.
Referenced by initGlobals().
| const double def_epsilon = 0.0 | 
Definition at line 453 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_max_dim = 1 | 
Definition at line 448 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_max_visit = 0 | 
Definition at line 455 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_n_color = 5 | 
Definition at line 446 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_near_neigh = 1 | 
Definition at line 454 of file ann_test.cpp.
Referenced by initGlobals().
Definition at line 447 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_query_size = 100 | 
Definition at line 445 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_rad_bound = 0 | 
Definition at line 456 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_seed = 0 | 
Definition at line 459 of file ann_test.cpp.
Referenced by initGlobals().
| const ANNshrinkRule def_shrink = ANN_BD_NONE | 
Definition at line 466 of file ann_test.cpp.
Referenced by initGlobals().
| const ANNsplitRule def_split = ANN_KD_SUGGEST | 
Definition at line 464 of file ann_test.cpp.
Referenced by initGlobals().
| const StatLev def_stats = QUERY_STATS | 
Definition at line 462 of file ann_test.cpp.
Referenced by initGlobals().
| const double def_std_dev = 1.00 | 
Definition at line 450 of file ann_test.cpp.
Referenced by initGlobals().
| const int def_true_nn = def_near_neigh + extra_nn | 
Definition at line 458 of file ann_test.cpp.
Referenced by initGlobals().
Definition at line 460 of file ann_test.cpp.
Referenced by initGlobals().
| int dim | 
Definition at line 472 of file ann_test.cpp.
| Distrib distr | 
Definition at line 478 of file ann_test.cpp.
Referenced by generatePts(), initGlobals(), and main().
| const char distr_table[N_DISTRIBS][STRING_LEN] | 
Definition at line 334 of file ann_test.cpp.
Referenced by generatePts(), and main().
| double epsilon | 
Definition at line 484 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), initGlobals(), and main().
| const double ERR = 0.00001 | 
Definition at line 284 of file ann_test.cpp.
| const int extra_nn = 10 | 
Definition at line 441 of file ann_test.cpp.
Referenced by main().
| int max_dim | 
Definition at line 477 of file ann_test.cpp.
Referenced by annMaxSpread(), generatePts(), initGlobals(), and main().
| int* max_pts_in_range | 
Definition at line 542 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), and initGlobals().
| int max_pts_visit | 
Definition at line 486 of file ann_test.cpp.
Referenced by doValidation(), initGlobals(), and main().
| int* min_pts_in_range | 
Definition at line 541 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), and initGlobals().
| int n_color | 
Definition at line 475 of file ann_test.cpp.
Referenced by generatePts(), initGlobals(), and main().
| const int N_SHRINK_RULES = 4 | 
Definition at line 362 of file ann_test.cpp.
Referenced by main().
| const int N_SPLIT_RULES = 6 | 
Definition at line 349 of file ann_test.cpp.
Referenced by main().
| int near_neigh | 
Definition at line 485 of file ann_test.cpp.
Referenced by doValidation(), initGlobals(), and main().
| ANNbool new_clust | 
Definition at line 476 of file ann_test.cpp.
Referenced by initGlobals(), and main().
| ANNpointArray query_pts | 
Definition at line 534 of file ann_test.cpp.
Referenced by getTrueNN(), initGlobals(), and main().
| int query_size | 
Definition at line 474 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), initGlobals(), and main().
| double radius_bound | 
Definition at line 487 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), initGlobals(), and main().
| const double RND_OFF = 5E-16 | 
Definition at line 285 of file ann_test.cpp.
Referenced by doValidation().
| ANNshrinkRule shrink | 
Definition at line 492 of file ann_test.cpp.
Referenced by initGlobals(), and main().
| const char shrink_table[N_SHRINK_RULES][STRING_LEN] | 
Definition at line 363 of file ann_test.cpp.
Referenced by main().
| ANNsplitRule split | 
Definition at line 491 of file ann_test.cpp.
Referenced by initGlobals(), and main().
| const char split_table[N_SPLIT_RULES][STRING_LEN] | 
Definition at line 350 of file ann_test.cpp.
Referenced by main().
| const char stat_table[N_STAT_LEVELS][STRING_LEN] | 
Definition at line 308 of file ann_test.cpp.
Referenced by main().
| StatLev stats | 
Definition at line 490 of file ann_test.cpp.
Referenced by generatePts(), getTrueNN(), initGlobals(), main(), and readPts().
| double std_dev | 
Definition at line 480 of file ann_test.cpp.
Referenced by annClusEllipsoids(), annGaussPts(), generatePts(), initGlobals(), and main().
| double std_dev_hi | 
Definition at line 482 of file ann_test.cpp.
Referenced by generatePts(), initGlobals(), and main().
| double std_dev_lo | 
Definition at line 481 of file ann_test.cpp.
Referenced by generatePts(), initGlobals(), and main().
| const int STRING_LEN = 500 | 
Definition at line 283 of file ann_test.cpp.
| ANNbd_tree* the_tree | 
Definition at line 535 of file ann_test.cpp.
Referenced by initGlobals(), main(), and treeStats().
| ANNdistArray true_dists | 
Definition at line 540 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), and initGlobals().
| int true_nn | 
Definition at line 488 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), initGlobals(), and main().
| ANNidxArray true_nn_idx | 
Definition at line 539 of file ann_test.cpp.
Referenced by doValidation(), getTrueNN(), and initGlobals().
| ANNbool valid_dirty | 
Definition at line 544 of file ann_test.cpp.
Referenced by getTrueNN(), initGlobals(), and main().
| ANNbool validate | 
Definition at line 489 of file ann_test.cpp.
Referenced by initGlobals(), and main().