Changeset 3914


Ignore:
Timestamp:
May 29, 2020, 4:18:21 PM (3 years ago)
Author:
Peter
Message:

prefer do while loop rather than some home brewed version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Kendall.cc

    r2881 r3914  
    143143      unsigned int n = 0;
    144144      unsigned int total = 0;
    145       while (true) {
     145      do {
    146146        long int k = statistics::count(x.begin(), x.end(), y_.begin());
    147147        if (k>=upper || k<=lower)
    148148          ++n;
    149149        ++total;
    150         if (!std::next_permutation(x.begin(), x.end()))
    151           break;
    152       }
     150      }
     151      while (std::next_permutation(x.begin(), x.end()));
    153152      return static_cast<double>(n)/static_cast<double>(total);
    154153    }
Note: See TracChangeset for help on using the changeset viewer.