Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <util.h>
Public Member Functions | |
Percentile (int record_limit) | |
void | AddRecord (double record) |
int64_t | NumRecords () const |
Returns number of stored records. | |
double | GetPercentile (double percent) |
Utility to calculate percentile (First variant) for limited number of records. Reference: https://en.wikipedia.org/wiki/Percentile
After the vector is sorted, we assume that the element with index i correspond to the percentile 100*(i+0.5)/size. For percentiles before the first element (resp. after the last one) we return the first element (resp. the last). And otherwise we do a linear interpolation between the two element around the asked percentile.
|
inlineexplicit |
void operations_research::sat::Percentile::AddRecord | ( | double | record | ) |
double operations_research::sat::Percentile::GetPercentile | ( | double | percent | ) |
|
inline |