Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/07/16 17:44:04 (8 years ago)
Author:
mkommend
Message:

#2672: Corrected cloning of online calculators (added missing base ctor calls, moved clone method, renamed other to original, and used the cloner for cloning).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs

    r14376 r14465  
    3737    }
    3838
    39     protected OnlineMeanErrorCalculator(OnlineMeanErrorCalculator other, Cloner cloner) {
    40       meanAndVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.meanAndVarianceCalculator.Clone(cloner);
     39    protected OnlineMeanErrorCalculator(OnlineMeanErrorCalculator original, Cloner cloner)
     40      : base(original, cloner) {
     41      meanAndVarianceCalculator = cloner.Clone(original.meanAndVarianceCalculator);
     42    }
     43    public override IDeepCloneable Clone(Cloner cloner) {
     44      return new OnlineMeanErrorCalculator(this, cloner);
    4145    }
    4246
     
    7983      }
    8084    }
    81 
    82     public override IDeepCloneable Clone(Cloner cloner) {
    83       return new OnlineMeanErrorCalculator(this, cloner);
    84     }
    8585  }
    8686}
Note: See TracChangeset for help on using the changeset viewer.