Free cookie consent management tool by TermsFeed Policy Generator

Changeset 201


Ignore:
Timestamp:
04/28/08 09:18:13 (16 years ago)
Author:
gkronber
Message:

created a branch for experiments with the functions plugin regarding performance and efficiency

Location:
branches/ExperimentalFunctionsBaking
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/ExperimentalFunctionsBaking/Constant.cs

    r192 r201  
    5252    }
    5353
    54     public override IFunctionTree GetTreeNode() {
    55       return new ConstantFunctionTree(this);
    56     }
     54    //public override IFunctionTree GetTreeNode() {
     55    //  return new ConstantFunctionTree(this);
     56    //}
    5757
    5858    // can't apply a constant
  • branches/ExperimentalFunctionsBaking/FunctionTree.cs

    r192 r201  
    9494
    9595    double[] evaluationResults;
     96    BakedFunctionTree bakedTree = null;
    9697    public virtual double Evaluate(Dataset dataset, int sampleIndex) {
    97       // lazy creation of evaluationResults to unburden the GC
    98       if(evaluationResults == null) {
    99         evaluationResults = new double[SubTrees.Count];
    100       }
    101       for(int i = 0; i < evaluationResults.Length; i++) {
    102         evaluationResults[i] = SubTrees[i].Evaluate(dataset, sampleIndex);
    103       }
    104       return function.Apply(dataset, sampleIndex, evaluationResults);
     98      //// lazy creation of evaluationResults to unburden the GC
     99      //if(evaluationResults == null) {
     100      //  evaluationResults = new double[SubTrees.Count];
     101      //}
     102      //for(int i = 0; i < evaluationResults.Length; i++) {
     103      //  evaluationResults[i] = SubTrees[i].Evaluate(dataset, sampleIndex);
     104      //}
     105      //return function.Apply(dataset, sampleIndex, evaluationResults);
     106      if(bakedTree==null)
     107        bakedTree = new BakedFunctionTree(this);
     108      return bakedTree.Evaluate(dataset, sampleIndex);
    105109    }
    106110    #endregion
  • branches/ExperimentalFunctionsBaking/HeuristicLab.Functions.csproj

    r185 r201  
    5252    <Compile Include="Average.cs" />
    5353    <Compile Include="Constant.cs" />
     54    <Compile Include="BakedFunctionTree.cs" />
    5455    <Compile Include="GreaterThan.cs" />
    5556    <Compile Include="FunctionTree.cs" />
  • branches/ExperimentalFunctionsBaking/Variable.cs

    r193 r201  
    6868    }
    6969
    70     public override IFunctionTree GetTreeNode() {
    71       return new VariableFunctionTree(this);
    72     }
     70    //public override IFunctionTree GetTreeNode() {
     71    //  return new VariableFunctionTree(this);
     72    //}
    7373
    7474    // can't apply a variable
Note: See TracChangeset for help on using the changeset viewer.