Changeset 14293 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.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/OnlineBoundedMeanSquaredErrorCalculator.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 OnlineBoundedMeanSquaredErrorCalculator : IOnlineCalculator {27 public class OnlineBoundedMeanSquaredErrorCalculator : IOnlineCalculator, IDeepCloneable { 27 28 28 29 private double errorSum; … … 38 39 39 40 40 public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upper bound) {41 public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upperBound) { 41 42 LowerBound = lowerBound; 42 UpperBound = upper bound;43 UpperBound = upperBound; 43 44 Reset(); 45 } 46 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; 44 54 } 45 55 … … 96 106 } 97 107 } 108 109 // IDeepCloneable interface members 110 public object Clone() { 111 return new OnlineBoundedMeanSquaredErrorCalculator(this); 112 } 113 114 public IDeepCloneable Clone(Cloner cloner) { 115 var clone = cloner.GetClone(this); 116 if (clone == null) { 117 clone = (IDeepCloneable)this.Clone(); 118 cloner.RegisterClonedObject(this, clone); 119 } 120 return clone; 121 } 98 122 } 99 123 }
Note: See TracChangeset
for help on using the changeset viewer.