Changeset 14293 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalculator.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/OnlineCovarianceCalculator.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 OnlineCovarianceCalculator : IOnlineCalculator {27 public class OnlineCovarianceCalculator : IOnlineCalculator, IDeepCloneable { 27 28 28 29 private double xMean, yMean, Cn; … … 36 37 public OnlineCovarianceCalculator() { 37 38 Reset(); 39 } 40 41 // private constructor used internally by the Clone() method 42 private OnlineCovarianceCalculator(OnlineCovarianceCalculator other) : this() { 43 Cn = other.Cn; 44 xMean = other.xMean; 45 yMean = other.yMean; 46 n = other.n; 47 errorState = other.errorState; 38 48 } 39 49 … … 94 104 } 95 105 } 106 107 // IDeepCloneable interface members 108 public object Clone() { 109 return new OnlineCovarianceCalculator(this); 110 } 111 112 public IDeepCloneable Clone(Cloner cloner) { 113 var clone = cloner.GetClone(this); 114 if (clone == null) { 115 clone = (IDeepCloneable)this.Clone(); 116 cloner.RegisterClonedObject(this, clone); 117 } 118 return clone; 119 } 96 120 } 97 121 }
Note: See TracChangeset
for help on using the changeset viewer.