Changeset 201 for branches/ExperimentalFunctionsBaking
- Timestamp:
- 04/28/08 09:18:13 (17 years ago)
- Location:
- branches/ExperimentalFunctionsBaking
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ExperimentalFunctionsBaking/Constant.cs
r192 r201 52 52 } 53 53 54 public override IFunctionTree GetTreeNode() {55 return new ConstantFunctionTree(this);56 }54 //public override IFunctionTree GetTreeNode() { 55 // return new ConstantFunctionTree(this); 56 //} 57 57 58 58 // can't apply a constant -
branches/ExperimentalFunctionsBaking/FunctionTree.cs
r192 r201 94 94 95 95 double[] evaluationResults; 96 BakedFunctionTree bakedTree = null; 96 97 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); 105 109 } 106 110 #endregion -
branches/ExperimentalFunctionsBaking/HeuristicLab.Functions.csproj
r185 r201 52 52 <Compile Include="Average.cs" /> 53 53 <Compile Include="Constant.cs" /> 54 <Compile Include="BakedFunctionTree.cs" /> 54 55 <Compile Include="GreaterThan.cs" /> 55 56 <Compile Include="FunctionTree.cs" /> -
branches/ExperimentalFunctionsBaking/Variable.cs
r193 r201 68 68 } 69 69 70 public override IFunctionTree GetTreeNode() {71 return new VariableFunctionTree(this);72 }70 //public override IFunctionTree GetTreeNode() { 71 // return new VariableFunctionTree(this); 72 //} 73 73 74 74 // can't apply a variable
Note: See TracChangeset
for help on using the changeset viewer.