Ignore:
Timestamp:
04/01/21 17:17:15 (4 years ago)
Author:
Maciej Komosinski
Message:

Added comments, removed unused variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/similarity/measure-distribution.cpp

    r1120 r1121  
    7070void SimilMeasureDistribution::calculateFun(std::pair<double, float> *fun, const Model &sampled)
    7171{
    72         int size = sampled.getPartCount();
    7372        int samples_taken = samples_num;
    7473
    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
    7881        //      samples_taken = min(samples_num, size*size);
    7982
     
    166169void SimilMeasureDistribution::D2(int samples_taken, std::uniform_int_distribution<> &distribution, const Model &sampled, std::vector<double> &dist_vect)
    167170{
    168         int size = sampled.getPartCount();
    169171        for (int i = 0; i < samples_taken; i++)
    170172        {
     
    227229void SimilMeasureDistribution::A3(int samples_taken, std::uniform_int_distribution<> &distribution, const Model &sampled, std::vector<double> &dist_vect)
    228230{
    229         int size = sampled.getPartCount();
    230231        for (int i = 0; i < samples_taken; i++)
    231232        {
Note: See TracChangeset for help on using the changeset viewer.