Changeset 13784 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePolynomial.cs
- Timestamp:
- 04/22/16 13:47:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePolynomial.cs
r13721 r13784 121 121 } 122 122 123 private static I Enumerable<double> GetGradient(double[,] x, int i, int j, double c, double scale, int degree, int[] columnIndices,123 private static IList<double> GetGradient(double[,] x, int i, int j, double c, double scale, int degree, int[] columnIndices, 124 124 bool fixedConst, bool fixedScale) { 125 125 double s = Util.ScalarProd(x, i, j, columnIndices, 1.0); 126 if (!fixedConst) yield return c * degree * scale * Math.Pow(c + s, degree - 1); 127 if (!fixedScale) yield return 2 * scale * Math.Pow(c + s, degree); 126 var g = new List<double>(2); 127 if (!fixedConst) g.Add(c * degree * scale * Math.Pow(c + s, degree - 1)); 128 if (!fixedScale) g.Add(2 * scale * Math.Pow(c + s, degree)); 129 return g; 128 130 } 129 131 }
Note: See TracChangeset
for help on using the changeset viewer.