Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/20/16 17:14:41 (8 years ago)
Author:
bburlacu
Message:

#2672: Add cloning constructors.

File:
1 edited

Legend:

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

    r14293 r14294  
    4545    }
    4646
    47     // private constructor used internally by the Clone() method
    48     private OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator other) {
    49       LowerBound = other.LowerBound;
    50       UpperBound = other.UpperBound;
    51       n = other.n;
    52       errorSum = other.errorSum;
    53       errorState = other.ErrorState;
     47    protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner = null) {
     48      LowerBound = original.LowerBound;
     49      UpperBound = original.UpperBound;
     50      n = original.n;
     51      errorSum = original.errorSum;
     52      errorState = original.ErrorState;
    5453    }
    5554
     
    115114      var clone = cloner.GetClone(this);
    116115      if (clone == null) {
    117         clone = (IDeepCloneable)this.Clone();
     116        clone = new OnlineBoundedMeanSquaredErrorCalculator(this);
    118117        cloner.RegisterClonedObject(this, clone);
    119118      }
Note: See TracChangeset for help on using the changeset viewer.