Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/12 14:04:29 (12 years ago)
Author:
gkronber
Message:

#1902 corrected handling of length-parameter arrays in ARD functions and prevented stacking of mask covariance functions to make sure that the length-parameter and the enumerable of selected column indexes are equally long.

File:
1 edited

Legend:

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

    r8929 r8933  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    111112
    112113    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
     114      // cov mask overwrites the previously selected columnIndices
     115      // -> stacking of CovarianceMask is not supported
     116      if (columnIndices != null && columnIndices.Count() != x.GetLength(1))
     117        throw new InvalidOperationException("Stacking of masking covariance functions is not supported.");
     118
    113119      return cov.GetCovariance(x, i, j, selectedDimensions);
    114120    }
    115121
    116122    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
     123      if (columnIndices != null && columnIndices.Count() != x.GetLength(1))
     124        throw new InvalidOperationException("Stacking of masking covariance functions is not supported.");
     125
    117126      return cov.GetGradient(x, i, j, selectedDimensions);
    118127    }
    119128
    120129    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
     130      if (columnIndices != null && columnIndices.Count() != x.GetLength(1))
     131        throw new InvalidOperationException("Stacking of masking covariance functions is not supported.");
     132
    121133      return cov.GetCrossCovariance(x, xt, i, j, selectedDimensions);
    122134    }
Note: See TracChangeset for help on using the changeset viewer.