Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinearArd.cs	(revision 9357)
@@ -90,6 +90,4 @@
 
     private static IEnumerable<double> GetGradient(double[,] x, int i, int j, double[] inverseLength, IEnumerable<int> columnIndices) {
-      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
-
       int k = 0;
       foreach (int columnIndex in columnIndices) {
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMask.cs	(revision 9357)
@@ -74,10 +74,8 @@
 
     public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, IEnumerable<int> columnIndices) {
-      if (columnIndices != null)
-        throw new InvalidOperationException("Stacking of masking covariance functions is not supported.");
       var cov = CovarianceFunctionParameter.Value;
       var selectedDimensions = SelectedDimensionsParameter.Value;
 
-      return cov.GetParameterizedCovarianceFunction(p, selectedDimensions);
+      return cov.GetParameterizedCovarianceFunction(p, selectedDimensions.Intersect(columnIndices));
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePeriodic.cs	(revision 9357)
@@ -141,27 +141,5 @@
       yield return 2.0 * k * scale * Math.Exp(-2 * r * r) *Math.Sin(2*k) * inverseLength * inverseLength;
       yield return 2.0 * scale * Math.Exp(-2 * gradient); 
-      /*
-       *  double s = Math.Log(scale) / 2.0;
-      double l = Math.Log(1.0 / inverseLength);
-      double p = Math.Log(period);
 
-      double v;
-      {
-        v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) * Math.Exp(-p);
-        double sin = Math.Sin(v);
-        double sin2 = sin * sin;
-        yield return 4.0 * sin2 * Math.Exp(-2.0 * Math.Exp(-2 * l) * sin2 - 2 * l + 2 * s);
-      }
-      {
-        double pi_d = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices);
-        double sin = Math.Sin(Math.Exp(-p)*pi_d);
-        double sin2 = Math.Sin(2*Math.Exp(-p)*pi_d);
-        yield return 2*pi_d*sin2*Math.Exp(-2*Math.Exp(-2*l)*sin*sin - 2*l - p + 2*s);
-      }
-      {
-        double pi_d = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices);
-        double sin = Math.Sin(Math.Exp(-p) * pi_d);
-        yield return 2 * Math.Exp(2 * scale - 2 * Math.Exp(-2 * l) * sin * sin);
-      }*/
     }
 
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceRationalQuadraticArd.cs	(revision 9357)
@@ -133,5 +133,4 @@
 
     private static IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices, double scale, double shape, double[] inverseLength) {
-      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
       double d = i == j
                    ? 0.0
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs	(revision 9357)
@@ -115,5 +115,4 @@
     // order of returned gradients must match the order in GetParameterValues!
     private static IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices, double scale, double[] inverseLength) {
-      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
       double d = i == j
                    ? 0.0
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs	(revision 9211)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs	(revision 9357)
@@ -155,5 +155,5 @@
         .ToArray();
 
-      var cov = covarianceFunction.GetParameterizedCovarianceFunction(covarianceParameter, null);
+      var cov = covarianceFunction.GetParameterizedCovarianceFunction(covarianceParameter, Enumerable.Range(0, x.GetLength(1)));
       for (int i = 0; i < n; i++) {
         for (int j = i; j < n; j++) {
@@ -284,5 +284,5 @@
       var kss = new double[newN];
       double[,] sWKs = new double[n, newN];
-      var cov = covarianceFunction.GetParameterizedCovarianceFunction(covarianceParameter, null);
+      var cov = covarianceFunction.GetParameterizedCovarianceFunction(covarianceParameter, Enumerable.Range(0, x.GetLength(1)));
 
       // for stddev 
