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/OnlineNormalizedMeanSquaredErrorCalculator.cs

    r14226 r14330  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425
    2526namespace HeuristicLab.Problems.DataAnalysis {
    26   public class OnlineNormalizedMeanSquaredErrorCalculator : IOnlineCalculator {
     27  public class OnlineNormalizedMeanSquaredErrorCalculator : IOnlineCalculator, IDeepCloneable {
    2728    private OnlineMeanAndVarianceCalculator meanSquaredErrorCalculator;
    2829    private OnlineMeanAndVarianceCalculator originalVarianceCalculator;
     
    4041      originalVarianceCalculator = new OnlineMeanAndVarianceCalculator();
    4142      Reset();
     43    }
     44
     45    protected OnlineNormalizedMeanSquaredErrorCalculator(OnlineNormalizedMeanSquaredErrorCalculator other, Cloner cloner) {
     46      meanSquaredErrorCalculator = (OnlineMeanAndVarianceCalculator)other.meanSquaredErrorCalculator.Clone(cloner);
     47      originalVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.originalVarianceCalculator.Clone(cloner);
    4248    }
    4349
     
    9298      }
    9399    }
     100
     101    // IDeepCloneable members
     102    public object Clone() {
     103      var cloner = new Cloner();
     104      return new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner);
     105    }
     106
     107    public IDeepCloneable Clone(Cloner cloner) {
     108      var clone = cloner.GetClone(this);
     109      if (clone == null) {
     110        clone = new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner);
     111        cloner.RegisterClonedObject(this, clone);
     112      }
     113      return clone;
     114    }
    94115  }
    95116}
Note: See TracChangeset for help on using the changeset viewer.