Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8682


Ignore:
Timestamp:
09/23/12 12:17:36 (12 years ago)
Author:
gkronber
Message:

#1902

  • fixed bug in cloning constructor of CovarianceMask
  • removed throwing Exceptions in CovariancePeriodic (the behaviour of the periodic covariance function now matches the GPML implementation again.
Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs

    r8678 r8682  
    5757      : base(original, cloner) {
    5858      this.selectedDimensionsParameter = cloner.Clone(original.selectedDimensionsParameter);
    59       this.selectedDimensions = (int[])original.selectedDimensions.Clone();
     59      if (original.selectedDimensions != null) {
     60        this.selectedDimensions = (int[])original.selectedDimensions.Clone();
     61      }
    6062
    6163      this.covParameter = cloner.Clone(original.covParameter);
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs

    r8678 r8682  
    126126
    127127    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
    128       if (columnIndices == null || columnIndices.Count() != 1)
    129         throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
    130128      double k = i == j ? 0.0 : GetDistance(x, x, i, j, columnIndices);
    131129      k = Math.PI * k / period;
     
    137135
    138136    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
    139       if (columnIndices == null || columnIndices.Count() != 1)
    140         throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
    141137      double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period;
    142138      double gradient = Math.Sin(v) * inverseLength;
     
    149145
    150146    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
    151       if (columnIndices == null || columnIndices.Count() != 1)
    152         throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
    153147      double k = GetDistance(x, xt, i, j, columnIndices);
    154148      k = Math.PI * k / period;
Note: See TracChangeset for help on using the changeset viewer.