Changeset 10530 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs
- Timestamp:
- 03/04/14 11:30:58 (11 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10489-10491,10493
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 10489-10491,10493
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs
r9456 r10530 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 36 37 get { return (IValueParameter<DoubleValue>)Parameters["Scale"]; } 37 38 } 38 39 private bool HasFixedScaleParameter { 40 get { return ScaleParameter.Value != null; } 41 } 39 42 [StorableConstructor] 40 43 private CovarianceConst(bool deserializing) … … 59 62 60 63 public int GetNumberOfParameters(int numberOfVariables) { 61 return ScaleParameter.Value != null? 0 : 1;64 return HasFixedScaleParameter ? 0 : 1; 62 65 } 63 66 … … 71 74 int c = 0; 72 75 // gather parameter values 73 if ( ScaleParameter.Value != null) {76 if (HasFixedScaleParameter) { 74 77 scale = ScaleParameter.Value.Value; 75 78 } else { … … 87 90 cov.Covariance = (x, i, j) => scale; 88 91 cov.CrossCovariance = (x, xt, i, j) => scale; 89 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices); 92 if (HasFixedScaleParameter) { 93 cov.CovarianceGradient = (x, i, j) => Enumerable.Empty<double>(); 94 } else { 95 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices); 96 } 90 97 return cov; 91 98 }
Note: See TracChangeset
for help on using the changeset viewer.