Changeset 206
- Timestamp:
- 04/29/08 13:19:45 (17 years ago)
- Location:
- branches/ExperimentalFunctionsBaking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ExperimentalFunctionsBaking/BakedFunctionTree.cs
r203 r206 45 45 } 46 46 47 internal BakedFunctionTree(IFunction function) : this() { 47 internal BakedFunctionTree(IFunction function) 48 : this() { 48 49 code.Add(0); 49 50 code.Add(MapFunction(function)); … … 60 61 } 61 62 62 internal BakedFunctionTree(IFunctionTree tree) : this() { 63 internal BakedFunctionTree(IFunctionTree tree) 64 : this() { 63 65 code.Add(0); 64 66 code.Add(MapFunction(tree.Function)); … … 130 132 } 131 133 treesExpanded = false; 132 subTrees .Clear();134 subTrees = null; 133 135 } 134 136 } … … 143 145 } 144 146 variablesExpanded = false; 145 variables .Clear();147 variables = null; 146 148 } 147 149 } … … 198 200 variablesExpanded = true; 199 201 code[2] = 0; 200 code.RemoveRange(3, variables.Count); 202 code.RemoveRange(3, variables.Count); 201 203 } 202 204 return variables; … … 241 243 // currentBranchIndex += branchLength; 242 244 //} 243 245 244 246 //code.InsertRange(currentBranchIndex, ((BakedFunctionTree)tree).code); 245 247 //code[0] = code[0] + 1; … … 268 270 269 271 private int PC; 272 private double[] codeArr; 270 273 public double Evaluate(Dataset dataset, int sampleIndex) { 271 274 PC = 0; 272 275 FlattenVariables(); 273 276 FlattenTrees(); 277 if(codeArr == null) { 278 codeArr = new double[code.Count]; 279 code.CopyTo(codeArr); 280 } 274 281 return EvaluateBakedCode(dataset, sampleIndex); 275 282 } -
branches/ExperimentalFunctionsBaking/HeuristicLab.Functions.csproj
r203 r206 49 49 <ItemGroup> 50 50 <Compile Include="Addition.cs" /> 51 <Compile Include="And.cs" /> 51 <Compile Include="And.cs"> 52 <SubType>Code</SubType> 53 </Compile> 52 54 <Compile Include="Average.cs" /> 53 55 <Compile Include="BakedFunctionTree.cs" /> … … 55 57 <Compile Include="GreaterThan.cs" /> 56 58 <Compile Include="FunctionTree.cs" /> 59 <Compile Include="IfThenElse.cs"> 60 <SubType>Code</SubType> 61 </Compile> 57 62 <Compile Include="IFunctionTree.cs" /> 58 63 <Compile Include="ModelAnalyzerExporter.cs" /> 64 <Compile Include="Or.cs"> 65 <SubType>Code</SubType> 66 </Compile> 59 67 <Compile Include="ProgrammableFunction.cs" /> 60 68 <Compile Include="Equal.cs" /> … … 65 73 <DependentUpon>FunctionView.cs</DependentUpon> 66 74 </Compile> 67 <Compile Include="IfThenElse.cs" />68 75 <Compile Include="IFunctionVisitor.cs" /> 69 76 <Compile Include="LessThan.cs" /> 70 77 <Compile Include="Not.cs" /> 71 <Compile Include="Or.cs" />72 78 <Compile Include="Signum.cs" /> 73 79 <Compile Include="Logarithm.cs" />
Note: See TracChangeset
for help on using the changeset viewer.