Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs	(revision 8678)
@@ -29,5 +29,5 @@
 
 namespace HeuristicLab.Algorithms.DataAnalysis.Views {
-  [View("Line Chart 2")]
+  [View("Line Chart (95% confidence interval)")]
   [Content(typeof(GaussianProcessRegressionSolution))]
   public partial class GaussianProcessRegressionSolutionLineChartView : DataAnalysisSolutionEvaluationView {
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs	(revision 8678)
@@ -91,13 +91,13 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       return scale;
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       yield return 2.0 * scale;
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
       return scale;
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs	(revision 8678)
@@ -51,13 +51,13 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      return Util.ScalarProd(x, i, j);
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, j, 1, columnIndices);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       yield break;
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
       return Util.ScalarProd(x, i, xt, j);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs	(revision 8678)
@@ -92,16 +92,18 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      return Util.ScalarProd(x, i, j, inverseLength);
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, j, inverseLength, columnIndices);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
-      for (int k = 0; k < inverseLength.Length; k++) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+
+      foreach (int k in columnIndices) {
         yield return -2.0 * x[i, k] * x[j, k] * inverseLength[k] * inverseLength[k];
       }
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      return Util.ScalarProd(x, i, xt, j, inverseLength);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return Util.ScalarProd(x, i, xt, j, inverseLength, columnIndices);
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs	(revision 8678)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs	(revision 8678)
@@ -0,0 +1,122 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableClass]
+  [Item(Name = "CovarianceMask",
+    Description = "Masking covariance function for dimension selection can be used to apply a covariance function only on certain input dimensions.")]
+  public sealed class CovarianceMask : ParameterizedNamedItem, ICovarianceFunction {
+    [Storable]
+    private int[] selectedDimensions;
+    [Storable]
+    private readonly ValueParameter<IntArray> selectedDimensionsParameter;
+    public IValueParameter<IntArray> SelectedDimensionsParameter {
+      get { return selectedDimensionsParameter; }
+    }
+
+    [Storable]
+    private ICovarianceFunction cov;
+    [Storable]
+    private readonly ValueParameter<ICovarianceFunction> covParameter;
+    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
+      get { return covParameter; }
+    }
+
+    [StorableConstructor]
+    private CovarianceMask(bool deserializing)
+      : base(deserializing) {
+    }
+
+    private CovarianceMask(CovarianceMask original, Cloner cloner)
+      : base(original, cloner) {
+      this.selectedDimensionsParameter = cloner.Clone(original.selectedDimensionsParameter);
+      this.selectedDimensions = (int[])original.selectedDimensions.Clone();
+
+      this.covParameter = cloner.Clone(original.covParameter);
+      this.cov = cloner.Clone(original.cov);
+      RegisterEvents();
+    }
+
+    public CovarianceMask()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+
+      this.selectedDimensionsParameter = new ValueParameter<IntArray>("SelectedDimensions", "The dimensions on which the specified covariance function should be applied to.");
+      this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
+      cov = covParameter.Value;
+
+      Parameters.Add(selectedDimensionsParameter);
+      Parameters.Add(covParameter);
+
+      RegisterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CovarianceMask(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+
+    private void RegisterEvents() {
+      Util.AttachArrayChangeHandler<IntArray, int>(selectedDimensionsParameter, () => {
+        selectedDimensions = selectedDimensionsParameter.Value
+          .OrderBy(x => x)
+          .Distinct()
+          .ToArray();
+        if (selectedDimensions.Length == 0) selectedDimensions = null;
+      });
+      covParameter.ValueChanged += (sender, args) => { cov = covParameter.Value; };
+    }
+
+    public int GetNumberOfParameters(int numberOfVariables) {
+      if (selectedDimensions == null) return cov.GetNumberOfParameters(numberOfVariables);
+      else return cov.GetNumberOfParameters(selectedDimensions.Length);
+    }
+
+    public void SetParameter(double[] hyp) {
+      cov.SetParameter(hyp);
+    }
+
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetCovariance(x, i, j, selectedDimensions);
+    }
+
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetGradient(x, i, j, selectedDimensions);
+    }
+
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return cov.GetCrossCovariance(x, xt, i, j, selectedDimensions);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs	(revision 8678)
@@ -154,15 +154,15 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double dist = i == j
                    ? 0.0
-                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength));
+                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
       return sf2 * m(dist);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double dist = i == j
                    ? 0.0
-                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength));
+                   : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices));
 
       yield return sf2 * dm(dist);
@@ -170,6 +170,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double dist = Math.Sqrt(Util.SqrDist(x, i, xt, j, Math.Sqrt(d) * inverseLength));
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double dist = Math.Sqrt(Util.SqrDist(x, i, xt, j, Math.Sqrt(d) * inverseLength, columnIndices));
       return sf2 * m(dist);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceNoise.cs	(revision 8678)
@@ -90,13 +90,13 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       return sf2;
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       yield return 2 * sf2;
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
       return 0.0;
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs	(revision 8678)
@@ -76,5 +76,5 @@
       Name = ItemName;
       Description = ItemDescription;
-      
+
       scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the periodic covariance function.");
       inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter for the periodic covariance function.");
@@ -125,6 +125,8 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      double k = i == j ? 0.0 : GetDistance(x, x, i, j);
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      if (columnIndices == null || columnIndices.Count() != 1)
+        throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
+      double k = i == j ? 0.0 : GetDistance(x, x, i, j, columnIndices);
       k = Math.PI * k / period;
       k = Math.Sin(k) * inverseLength;
@@ -134,6 +136,8 @@
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
-      double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j) / period;
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      if (columnIndices == null || columnIndices.Count() != 1)
+        throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
+      double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period;
       double gradient = Math.Sin(v) * inverseLength;
       gradient *= gradient;
@@ -144,6 +148,8 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double k = GetDistance(x, xt, i, j);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      if (columnIndices == null || columnIndices.Count() != 1)
+        throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");
+      double k = GetDistance(x, xt, i, j, columnIndices);
       k = Math.PI * k / period;
       k = Math.Sin(k) * inverseLength;
@@ -153,6 +159,6 @@
     }
 
-    private double GetDistance(double[,] x, double[,] xt, int i, int j) {
-      return Math.Sqrt(Util.SqrDist(x, i, xt, j));
+    private double GetDistance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return Math.Sqrt(Util.SqrDist(x, i, xt, j, 1, columnIndices));
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs	(revision 8678)
@@ -76,12 +76,12 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      return factors.Select(f => f.GetCovariance(x, i, j)).Aggregate((a, b) => a * b);
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).Aggregate((a, b) => a * b);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
-      var covariances = factors.Select(f => f.GetCovariance(x, i, j)).ToArray();
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      var covariances = factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).ToArray();
       for (int ii = 0; ii < factors.Count; ii++) {
-        foreach (var g in factors[ii].GetGradient(x, i, j)) {
+        foreach (var g in factors[ii].GetGradient(x, i, j, columnIndices)) {
           double res = g;
           for (int jj = 0; jj < covariances.Length; jj++)
@@ -92,6 +92,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      return factors.Select(f => f.GetCrossCovariance(x, xt, i, j)).Aggregate((a, b) => a * b);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return factors.Select(f => f.GetCrossCovariance(x, xt, i, j, columnIndices)).Aggregate((a, b) => a * b);
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticArd.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticArd.cs	(revision 8678)
@@ -135,15 +135,15 @@
 
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       double b = 1 + 0.5 * d / shape;
       for (int k = 0; k < inverseLength.Length; k++) {
@@ -154,6 +154,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
       return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticIso.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticIso.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceRationalQuadraticIso.cs	(revision 8678)
@@ -125,15 +125,15 @@
 
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
 
       double b = 1 + 0.5 * d / shape;
@@ -143,6 +143,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
       return sf2 * Math.Pow(1 + 0.5 * d / shape, -shape);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceScale.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceScale.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceScale.cs	(revision 8678)
@@ -72,4 +72,5 @@
       this.scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter.");
       this.covParameter = new ValueParameter<ICovarianceFunction>("CovarianceFunction", "The covariance function that should be scaled.", new CovarianceSquaredExponentialIso());
+      cov = covParameter.Value;
 
       Parameters.Add(this.scaleParameter);
@@ -106,16 +107,16 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      return sf2 * cov.GetCovariance(x, i, j);
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return sf2 * cov.GetCovariance(x, i, j, columnIndices);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
-      yield return 2 * sf2 * cov.GetCovariance(x, i, j);
-      foreach (var g in cov.GetGradient(x, i, j))
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      yield return 2 * sf2 * cov.GetCovariance(x, i, j, columnIndices);
+      foreach (var g in cov.GetGradient(x, i, j, columnIndices))
         yield return sf2 * g;
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      return sf2 * cov.GetCrossCovariance(x, xt, i, j);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return sf2 * cov.GetCrossCovariance(x, xt, i, j, columnIndices);
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialArd.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialArd.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialArd.cs	(revision 8678)
@@ -110,15 +110,15 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       return sf2 * Math.Exp(-d / 2.0);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
 
       for (int ii = 0; ii < inverseLength.Length; ii++) {
@@ -129,6 +129,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
       return sf2 * Math.Exp(-d / 2.0);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialIso.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialIso.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSquaredExponentialIso.cs	(revision 8678)
@@ -108,15 +108,15 @@
 
 
-    public double GetCovariance(double[,] x, int i, int j) {
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       return sf2 * Math.Exp(-d / 2.0);
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
       double d = i == j
                    ? 0.0
-                   : Util.SqrDist(x, i, j, inverseLength);
+                   : Util.SqrDist(x, i, j, inverseLength, columnIndices);
       double g = Math.Exp(-d / 2.0);
       yield return sf2 * g * d;
@@ -124,6 +124,6 @@
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      double d = Util.SqrDist(x, i, xt, j, inverseLength);
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      double d = Util.SqrDist(x, i, xt, j, inverseLength, columnIndices);
       return sf2 * Math.Exp(-d / 2.0);
     }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSum.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSum.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSum.cs	(revision 8678)
@@ -76,14 +76,14 @@
     }
 
-    public double GetCovariance(double[,] x, int i, int j) {
-      return terms.Select(t => t.GetCovariance(x, i, j)).Sum();
+    public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetCovariance(x, i, j, columnIndices)).Sum();
     }
 
-    public IEnumerable<double> GetGradient(double[,] x, int i, int j) {
-      return terms.Select(t => t.GetGradient(x, i, j)).Aggregate(Enumerable.Concat);
+    public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetGradient(x, i, j, columnIndices)).Aggregate(Enumerable.Concat);
     }
 
-    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {
-      return terms.Select(t => t.GetCrossCovariance(x, xt, i, j)).Sum();
+    public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
+      return terms.Select(t => t.GetCrossCovariance(x, xt, i, j, columnIndices)).Sum();
     }
   }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/ICovarianceFunction.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/ICovarianceFunction.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/ICovarianceFunction.cs	(revision 8678)
@@ -27,7 +27,7 @@
     int GetNumberOfParameters(int numberOfVariables);
     void SetParameter(double[] hyp);
-    double GetCovariance(double[,] x, int i, int j);
-    IEnumerable<double> GetGradient(double[,] x, int i, int j);
-    double GetCrossCovariance(double[,] x, double[,] xt, int i, int j);
+    double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices = null);
+    IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices = null);
+    double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices = null);
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs	(revision 8677)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs	(revision 8678)
@@ -41,11 +41,12 @@
     }
 
-    public static double SqrDist(double[,] x, int i, int j, double scale = 1.0) {
-      return SqrDist(x, i, x, j, scale);
+    public static double SqrDist(double[,] x, int i, int j, double scale = 1.0, IEnumerable<int> columnIndices = null) {
+      return SqrDist(x, i, x, j, scale, columnIndices);
     }
 
-    public static double SqrDist(double[,] x, int i, double[,] xt, int j, double scale = 1.0) {
+    public static double SqrDist(double[,] x, int i, double[,] xt, int j, double scale = 1.0, IEnumerable<int> columnIndices = null) {
       double ss = 0.0;
-      for (int k = 0; k < x.GetLength(1); k++) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+      foreach (int k in columnIndices) {
         double d = x[i, k] - xt[j, k];
         ss += d * d;
@@ -54,11 +55,12 @@
     }
 
-    public static double SqrDist(double[,] x, int i, int j, double[] scale) {
+    public static double SqrDist(double[,] x, int i, int j, double[] scale, IEnumerable<int> columnIndices = null) {
       return SqrDist(x, i, x, j, scale);
     }
 
-    public static double SqrDist(double[,] x, int i, double[,] xt, int j, double[] scale) {
+    public static double SqrDist(double[,] x, int i, double[,] xt, int j, double[] scale, IEnumerable<int> columnIndices = null) {
       double ss = 0.0;
-      for (int k = 0; k < x.GetLength(1); k++) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+      foreach (int k in columnIndices) {
         double d = x[i, k] - xt[j, k];
         ss += d * d * scale[k] * scale[k];
@@ -66,22 +68,24 @@
       return ss;
     }
-    public static double ScalarProd(double[,] x, int i, int j, double scale = 1.0) {
-      return ScalarProd(x, i, x, j, scale);
+    public static double ScalarProd(double[,] x, int i, int j, double scale = 1.0, IEnumerable<int> columnIndices = null) {
+      return ScalarProd(x, i, x, j, scale, columnIndices);
     }
 
-    public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double scale = 1.0) {
+    public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double scale = 1.0, IEnumerable<int> columnIndices = null) {
       double sum = 0.0;
-      for (int k = 0; k < x.GetLength(1); k++) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+      foreach (int k in columnIndices) {
         sum += x[i, k] * xt[j, k];
       }
       return scale * scale * sum;
     }
-    public static double ScalarProd(double[,] x, int i, int j, double[] scale) {
-      return ScalarProd(x, i, x, j, scale);
+    public static double ScalarProd(double[,] x, int i, int j, double[] scale, IEnumerable<int> columnIndices = null) {
+      return ScalarProd(x, i, x, j, scale, columnIndices);
     }
 
-    public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double[] scale) {
+    public static double ScalarProd(double[,] x, int i, double[,] xt, int j, double[] scale, IEnumerable<int> columnIndices = null) {
       double sum = 0.0;
-      for (int k = 0; k < x.GetLength(1); k++) {
+      if (columnIndices == null) columnIndices = Enumerable.Range(0, x.GetLength(1));
+      foreach (int k in columnIndices) {
         sum += x[i, k] * scale[k] * xt[j, k] * scale[k];
       }
