Ignore:
Timestamp:
04/04/11 18:09:49 (11 years ago)
Author:
mkommend
Message:

#1453: Stopped iterating over the enumerables in the static calculate method in OnlineCalculators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalcualtor.cs

    r5943 r5945  
    8282        double original = firstEnumerator.Current;
    8383        covarianceCalculator.Add(original, estimated);
     84        if (covarianceCalculator.ErrorState != OnlineCalculatorError.None) break;
    8485      }
    8586
    8687      // check if both enumerators are at the end to make sure both enumerations have the same length
    87       if (secondEnumerator.MoveNext() || firstEnumerator.MoveNext()) {
     88      if (covarianceCalculator.ErrorState == OnlineCalculatorError.None &&
     89          (secondEnumerator.MoveNext() || firstEnumerator.MoveNext())) {
    8890        throw new ArgumentException("Number of elements in first and second enumeration doesn't match.");
    8991      } else {
Note: See TracChangeset for help on using the changeset viewer.