Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/08 00:02:43 (16 years ago)
Author:
gkronber
Message:

worked on #139:

  • fixed display of trees in the gui
  • split list representation of tree into two lists code and data
  • implemented static evaluation for all predefined functions (except ProgrammableFunction)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ExperimentalFunctionsBaking/Addition.cs

    r203 r220  
    3030
    3131namespace HeuristicLab.Functions {
    32   public class Addition : FunctionBase {
     32  public sealed class Addition : FunctionBase {
    3333    public override string Description {
    3434      get {
     
    4646    }
    4747
    48     public static double Add(double[] args) {
    49       // (+ 3) => 3
    50       // (+ 2 3) => 5
    51       // (+ 3 4 5) => 12
    52       double sum = 0.0;
    53       for (int i = 0; i < args.Length; i++) {
    54         sum += args[i];
    55       }
    56       return sum;
    57     }
    58 
    59     public override double Apply(Dataset dataset, int sampleIndex, double[] args) {
    60       return Addition.Add(args);
    61     }
    62 
    6348    public override void Accept(IFunctionVisitor visitor) {
    6449      visitor.Visit(this);
Note: See TracChangeset for help on using the changeset viewer.