Changeset 14293 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs
- Timestamp:
- 09/20/16 15:51:04 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs
r14185 r14293 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineMeanErrorCalculator : IOnlineCalculator {27 public class OnlineMeanErrorCalculator : IOnlineCalculator, IDeepCloneable { 27 28 28 29 private readonly OnlineMeanAndVarianceCalculator meanAndVarianceCalculator; … … 34 35 meanAndVarianceCalculator = new OnlineMeanAndVarianceCalculator(); 35 36 Reset(); 37 } 38 39 private OnlineMeanErrorCalculator(OnlineMeanAndVarianceCalculator meanAndVarianceCalculator) { 40 this.meanAndVarianceCalculator = meanAndVarianceCalculator; 36 41 } 37 42 … … 74 79 } 75 80 } 81 82 // IDeepCloneable members 83 public object Clone() { 84 var meanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)meanAndVarianceCalculator.Clone(); 85 return new OnlineMeanErrorCalculator(meanAndVarianceCalculatorClone); 86 } 87 88 public IDeepCloneable Clone(Cloner cloner) { 89 var clone = cloner.GetClone(this); 90 if (clone == null) { 91 var meanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)meanAndVarianceCalculator.Clone(cloner); 92 clone = new OnlineMeanErrorCalculator(meanAndVarianceCalculatorClone); 93 cloner.RegisterClonedObject(this, clone); 94 } 95 return clone; 96 } 76 97 } 77 98 }
Note: See TracChangeset
for help on using the changeset viewer.