MultiIndex
perfomance_util.h
Go to the documentation of this file.
00001 
00002 // Copyright 2012 Yandex Artem Babenko
00003 #include <iostream>
00004 #include <set>
00005 #include <vector>
00006 
00007 #include "data_util.h"
00008 
00009 using std::cout;
00010 using std::endl;
00011 using std::ofstream;
00012 using std::pair;
00013 using std::set;
00014 using std::vector;
00015 
00020 typedef pair<Distance, PointId> DistanceToPoint;
00021 
00025 class PerfTester {
00026  public:
00027   PerfTester();
00031   int current_points_count;
00035   void DoReport();
00040   void ResetQuerywiseStatistic();
00044   void NextNeighbour();
00048   int handled_queries_count;
00052   int cells_traversed;
00053   unsigned long long nearest_subcentroids_time;
00054   unsigned long long cache_init_time;
00055   unsigned long long merger_init_time;
00056   unsigned long long full_traversal_time;
00057   unsigned long long cell_coordinates_time;
00058   unsigned long long cell_edges_time;
00059   unsigned long long residual_time;
00060   unsigned long long refining_time;
00061   unsigned long long full_search_time;
00062   unsigned long long search_start;
00063  private:
00064   string report_file_;
00065   void DoReport(ofstream& out);
00066   vector<int> list_length_thresholds_;
00067   int current_threshold_index_;
00068   vector<float> list_length_times_;
00069 };
00070 
00077 int GetRecallAt(const int length, const vector<PointId>& groundtruth,
00078                 const vector<DistanceToPoint>& result);
00085 double GetPresicionAt(const int length, const set<PointId>& groundtruth,
00086                       const vector<DistanceToPoint>& result);
 All Classes Files Functions Variables Typedefs Enumerations Enumerator