Changeset 8682
- Timestamp:
- 09/23/12 12:17:36 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMask.cs
r8678 r8682 57 57 : base(original, cloner) { 58 58 this.selectedDimensionsParameter = cloner.Clone(original.selectedDimensionsParameter); 59 this.selectedDimensions = (int[])original.selectedDimensions.Clone(); 59 if (original.selectedDimensions != null) { 60 this.selectedDimensions = (int[])original.selectedDimensions.Clone(); 61 } 60 62 61 63 this.covParameter = cloner.Clone(original.covParameter); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
r8678 r8682 126 126 127 127 public double GetCovariance(double[,] x, int i, int j, IEnumerable<int> columnIndices) { 128 if (columnIndices == null || columnIndices.Count() != 1)129 throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");130 128 double k = i == j ? 0.0 : GetDistance(x, x, i, j, columnIndices); 131 129 k = Math.PI * k / period; … … 137 135 138 136 public IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices) { 139 if (columnIndices == null || columnIndices.Count() != 1)140 throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");141 137 double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period; 142 138 double gradient = Math.Sin(v) * inverseLength; … … 149 145 150 146 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) { 151 if (columnIndices == null || columnIndices.Count() != 1)152 throw new ArgumentException("The periodic covariance function can only be used for one dimension.", "columnIndices");153 147 double k = GetDistance(x, xt, i, j, columnIndices); 154 148 k = Math.PI * k / period;
Note: See TracChangeset
for help on using the changeset viewer.