Changeset 13721 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs
- Timestamp:
- 03/23/16 16:19:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialArd.cs
r12012 r13721 99 99 } 100 100 101 public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, IEnumerable<int>columnIndices) {101 public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, int[] columnIndices) { 102 102 double scale; 103 103 double[] inverseLength; … … 122 122 123 123 // order of returned gradients must match the order in GetParameterValues! 124 private static IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int>columnIndices, double scale, double[] inverseLength,124 private static IEnumerable<double> GetGradient(double[,] x, int i, int j, int[] columnIndices, double scale, double[] inverseLength, 125 125 bool fixedInverseLength, bool fixedScale) { 126 126 double d = i == j … … 130 130 int k = 0; 131 131 if (!fixedInverseLength) { 132 foreach (var columnIndex in columnIndices) { 132 for (int c = 0; c < columnIndices.Length; c++) { 133 var columnIndex = columnIndices[c]; 133 134 double sqrDist = Util.SqrDist(x[i, columnIndex] * inverseLength[k], x[j, columnIndex] * inverseLength[k]); 134 135 yield return scale * Math.Exp(-d / 2.0) * sqrDist;
Note: See TracChangeset
for help on using the changeset viewer.