Changeset 1121 for cpp/frams/model
 Timestamp:
 04/01/21 17:17:15 (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

cpp/frams/model/similarity/measuredistribution.cpp
r1120 r1121 70 70 void SimilMeasureDistribution::calculateFun(std::pair<double, float> *fun, const Model &sampled) 71 71 { 72 int size = sampled.getPartCount();73 72 int samples_taken = samples_num; 74 73 75 //Check if total number of points pairs is smaller than samples number 76 //but first, prevent exceeding int limits 77 //if (size < (int) sqrt((double) std::numeric_limits<int>::max())) 74 //Check if total number of point pairs is smaller than samples number (just to avoid the calculation of the same stats for the same pairs of Parts) 75 //This optimization turned out to have a minor effect, only present for very high simil_samples_num, and was not perfect anyway: 76 // samples are selected randomly so there are no guarantees that they will be repeated, 77 // even if they do, it has the benefit of averaging the result that becomes more stable, 78 // the concept of "point pairs" is not relevant when we randomly select more than two points, as some descriptors do. 79 //int size = sampled.getPartCount(); 80 //if (size < (int) sqrt((double) std::numeric_limits<int>::max())) //prevent exceeding int limits 78 81 // samples_taken = min(samples_num, size*size); 79 82 … … 166 169 void SimilMeasureDistribution::D2(int samples_taken, std::uniform_int_distribution<> &distribution, const Model &sampled, std::vector<double> &dist_vect) 167 170 { 168 int size = sampled.getPartCount();169 171 for (int i = 0; i < samples_taken; i++) 170 172 { … … 227 229 void SimilMeasureDistribution::A3(int samples_taken, std::uniform_int_distribution<> &distribution, const Model &sampled, std::vector<double> &dist_vect) 228 230 { 229 int size = sampled.getPartCount();230 231 for (int i = 0; i < samples_taken; i++) 231 232 {
Note: See TracChangeset
for help on using the changeset viewer.