Changeset 41 for trunk/lib/Stats.cc
- Timestamp:
- Jan 13, 2006, 5:41:57 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Stats.cc
r39 r41 8 8 #include <fstream> 9 9 10 #include <algorithm> 10 11 #include <map> 11 12 #include <numeric> … … 21 22 22 23 Gnuplot Stats::gnuplot_pipe_; 24 u_int Stats::latest_revision_=0; 23 25 24 26 std::vector<double> Stats::accumulated(void) const … … 28 30 29 31 // sum of all users 30 std::vector<u_int> sum ;32 std::vector<u_int> sum(latest_revision_+1,0); 31 33 sum=std::accumulate(map_.begin(), map_.end(), sum, 32 34 PairValuePlus<std::string,u_int>()); … … 43 45 return std::vector<double>(); 44 46 std::vector<u_int> vec=(map_.find(user))->second; 47 48 vec.reserve(latest_revision_+1); 49 if (vec.size() < latest_revision_+1) 50 vec.insert(vec.end(), latest_revision_+1-vec.size(), 0); 45 51 46 52 std::vector<double> accum(vec.size()); … … 58 64 vec[i]=0; 59 65 vec[rev]=1; 66 latest_revision_ = std::max(latest_revision_,rev); 60 67 } 61 68 else
Note: See TracChangeset
for help on using the changeset viewer.