Changeset 8678 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs
- Timestamp:
- 09/21/12 18:45:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceProduct.cs
r8620 r8678 76 76 } 77 77 78 public double GetCovariance(double[,] x, int i, int j ) {79 return factors.Select(f => f.GetCovariance(x, i, j )).Aggregate((a, b) => a * b);78 public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) { 79 return factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).Aggregate((a, b) => a * b); 80 80 } 81 81 82 public IEnumerable<double> GetGradient(double[,] x, int i, int j ) {83 var covariances = factors.Select(f => f.GetCovariance(x, i, j )).ToArray();82 public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) { 83 var covariances = factors.Select(f => f.GetCovariance(x, i, j, columnIndices)).ToArray(); 84 84 for (int ii = 0; ii < factors.Count; ii++) { 85 foreach (var g in factors[ii].GetGradient(x, i, j )) {85 foreach (var g in factors[ii].GetGradient(x, i, j, columnIndices)) { 86 86 double res = g; 87 87 for (int jj = 0; jj < covariances.Length; jj++) … … 92 92 } 93 93 94 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j ) {95 return factors.Select(f => f.GetCrossCovariance(x, xt, i, j )).Aggregate((a, b) => a * b);94 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) { 95 return factors.Select(f => f.GetCrossCovariance(x, xt, i, j, columnIndices)).Aggregate((a, b) => a * b); 96 96 } 97 97 }
Note: See TracChangeset
for help on using the changeset viewer.