Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/10/12 13:28:55 (12 years ago)
Author:
gkronber
Message:

#1902 implemented all mean and covariance functions with parameters as ParameterizedNamedItems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanZero.cs

    r8416 r8612  
    2828  [StorableClass]
    2929  [Item(Name = "MeanZero", Description = "Constant zero mean function for Gaussian processes.")]
    30   public class MeanZero : Item, IMeanFunction {
    31     public int GetNumberOfParameters(int numberOfVariables) {
    32       return 0;
    33     }
     30  public sealed class MeanZero : Item, IMeanFunction {
    3431    [StorableConstructor]
    35     protected MeanZero(bool deserializing) : base(deserializing) { }
    36     protected MeanZero(MeanZero original, Cloner cloner)
     32    private MeanZero(bool deserializing) : base(deserializing) { }
     33    private MeanZero(MeanZero original, Cloner cloner)
    3734      : base(original, cloner) {
    3835    }
     
    4037    }
    4138
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new MeanZero(this, cloner);
     41    }
     42
     43    public int GetNumberOfParameters(int numberOfVariables) {
     44      return 0;
     45    }
     46
    4247    public void SetParameter(double[] hyp) {
    4348      if (hyp.Length > 0) throw new ArgumentException("No hyper-parameters allowed for zero mean function.", "hyp");
    44     }
    45 
    46     public void SetData(double[,] x) {
    47       // do nothing
    4849    }
    4950
     
    5657      return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
    5758    }
    58     public override IDeepCloneable Clone(Cloner cloner) {
    59       return new MeanZero(this, cloner);
    60     }
    6159  }
    6260}
Note: See TracChangeset for help on using the changeset viewer.