Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinear.cs
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceLinear.cs
r12012 r14029 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; … … 52 50 } 53 51 54 public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, IEnumerable<int>columnIndices) {52 public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, int[] columnIndices) { 55 53 if (p.Length > 0) throw new ArgumentException("No parameters are allowed for the linear covariance function."); 56 54 // create functions 57 55 var cov = new ParameterizedCovarianceFunction(); 58 cov.Covariance = (x, i, j) => Util.ScalarProd(x, i, j, 1, columnIndices);59 cov.CrossCovariance = (x, xt, i, j) => Util.ScalarProd(x, i, xt, j, 1.0 , columnIndices);60 cov.CovarianceGradient = (x, i, j) => Enumerable.Empty<double>();56 cov.Covariance = (x, i, j) => Util.ScalarProd(x, i, j, columnIndices, 1.0); 57 cov.CrossCovariance = (x, xt, i, j) => Util.ScalarProd(x, i, xt, j, columnIndices, 1.0); 58 cov.CovarianceGradient = (x, i, j) => new double[0]; 61 59 return cov; 62 60 }
Note: See TracChangeset
for help on using the changeset viewer.