Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/13/16 19:47:41 (8 years ago)
Author:
gkronber
Message:

#2650 Merged r14282:14322 from trunk to branch (fixing conflicts)

Location:
branches/symbreg-factors-2650
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.cs

    r14185 r14330  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425
    2526namespace HeuristicLab.Problems.DataAnalysis {
    26   public class OnlineBoundedMeanSquaredErrorCalculator : IOnlineCalculator {
     27  public class OnlineBoundedMeanSquaredErrorCalculator : IOnlineCalculator, IDeepCloneable {
    2728
    2829    private double errorSum;
     
    3839
    3940
    40     public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upperbound) {
     41    public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upperBound) {
    4142      LowerBound = lowerBound;
    42       UpperBound = upperbound;
     43      UpperBound = upperBound;
    4344      Reset();
     45    }
     46
     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;
    4453    }
    4554
     
    96105      }
    97106    }
     107
     108    // IDeepCloneable interface members
     109    public object Clone() {
     110      return new OnlineBoundedMeanSquaredErrorCalculator(this);
     111    }
     112
     113    public IDeepCloneable Clone(Cloner cloner) {
     114      var clone = cloner.GetClone(this);
     115      if (clone == null) {
     116        clone = new OnlineBoundedMeanSquaredErrorCalculator(this);
     117        cloner.RegisterClonedObject(this, clone);
     118      }
     119      return clone;
     120    }
    98121  }
    99122}
Note: See TracChangeset for help on using the changeset viewer.