Functions | Variables

perf.cpp File Reference

#include <ANN/ANN.h>
#include <ANN/ANNperf.h>

Go to the source code of this file.

Functions

void annResetStats (int data_size)
void annResetCounts ()
void annUpdateStats ()
void print_one_stat (const char *title, ANNsampStat s, double div)
void annPrintStats (ANNbool validate)

Variables

int ann_Ndata_pts = 0
int ann_Nvisit_lfs = 0
int ann_Nvisit_spl = 0
int ann_Nvisit_shr = 0
int ann_Nvisit_pts = 0
int ann_Ncoord_hts = 0
int ann_Nfloat_ops = 0
ANNsampStat ann_visit_lfs
ANNsampStat ann_visit_spl
ANNsampStat ann_visit_shr
ANNsampStat ann_visit_nds
ANNsampStat ann_visit_pts
ANNsampStat ann_coord_hts
ANNsampStat ann_float_ops
ANNsampStat ann_average_err
ANNsampStat ann_rank_err

Function Documentation

void annPrintStats ( ANNbool  validate )

Definition at line 114 of file perf.cpp.

References ann_average_err, ann_coord_hts, ann_float_ops, ann_Ndata_pts, ann_rank_err, ann_visit_lfs, ann_visit_nds, ann_visit_pts, ann_visit_shr, ann_visit_spl, and print_one_stat().

{
        cout.precision(4);                                      // set floating precision
        cout << "  (Performance stats: "
                 << " [      mean :    stddev ]<      min ,       max >\n";
        print_one_stat("    leaf_nodes       ", ann_visit_lfs, 1);
        print_one_stat("    splitting_nodes  ", ann_visit_spl, 1);
        print_one_stat("    shrinking_nodes  ", ann_visit_shr, 1);
        print_one_stat("    total_nodes      ", ann_visit_nds, 1);
        print_one_stat("    points_visited   ", ann_visit_pts, 1);
        print_one_stat("    coord_hits/pt    ", ann_coord_hts, ann_Ndata_pts);
        print_one_stat("    floating_ops_(K) ", ann_float_ops, 1000);
        if (validate) {
                print_one_stat("    average_error    ", ann_average_err, 1);
                print_one_stat("    rank_error       ", ann_rank_err, 1);
        }
        cout.precision(0);                                      // restore the default
        cout << "  )\n";
        cout.flush();
}
void annResetCounts (  )
void annResetStats ( int  data_size )
void annUpdateStats (  )
void print_one_stat ( const char *  title,
ANNsampStat  s,
double  div 
)

Definition at line 105 of file perf.cpp.

References ANNsampStat::max(), ANNsampStat::mean(), ANNsampStat::min(), and ANNsampStat::stdDev().

Referenced by annPrintStats().

{
        cout << title << "= [ ";
        cout.width(9); cout << s.mean()/div                     << " : ";
        cout.width(9); cout << s.stdDev()/div           << " ]<";
        cout.width(9); cout << s.min()/div                      << " , ";
        cout.width(9); cout << s.max()/div                      << " >\n";
}

Variable Documentation

Definition at line 62 of file perf.cpp.

Referenced by annPrintStats(), and annResetStats().

Definition at line 59 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

Definition at line 60 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

int ann_Ncoord_hts = 0

Definition at line 52 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

int ann_Ndata_pts = 0

Definition at line 47 of file perf.cpp.

Referenced by annPrintStats(), and annResetStats().

int ann_Nfloat_ops = 0

Definition at line 53 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

int ann_Nvisit_lfs = 0

Definition at line 48 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

int ann_Nvisit_pts = 0

Definition at line 51 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

int ann_Nvisit_shr = 0

Definition at line 50 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

int ann_Nvisit_spl = 0

Definition at line 49 of file perf.cpp.

Referenced by annResetCounts(), and annUpdateStats().

Definition at line 63 of file perf.cpp.

Referenced by annPrintStats(), and annResetStats().

Definition at line 54 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

Definition at line 57 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

Definition at line 58 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

Definition at line 56 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

Definition at line 55 of file perf.cpp.

Referenced by annPrintStats(), annResetStats(), and annUpdateStats().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines