Changeset 13784 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSum.cs
 Timestamp:
 04/22/16 13:47:35 (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSum.cs
r13721 r13784 87 87 sum.Covariance = (x, i, j) => functions.Select(e => e.Covariance(x, i, j)).Sum(); 88 88 sum.CrossCovariance = (x, xt, i, j) => functions.Select(e => e.CrossCovariance(x, xt, i, j)).Sum(); 89 sum.CovarianceGradient = (x, i, j) => functions.Select(e => e.CovarianceGradient(x, i, j)).Aggregate(Enumerable.Concat); 89 sum.CovarianceGradient = (x, i, j) => { 90 var g = new List<double>(functions.Sum(e => e.CovarianceGradient(x, i, j).Count)); 91 foreach (var e in functions) 92 g.AddRange(e.CovarianceGradient(x, i, j)); 93 return g; 94 }; 90 95 return sum; 91 96 }
Note: See TracChangeset
for help on using the changeset viewer.