Free cookie consent management tool by TermsFeed Policy Generator

Changeset 206


Ignore:
Timestamp:
04/29/08 13:19:45 (17 years ago)
Author:
gkronber
Message:

minor changes

Location:
branches/ExperimentalFunctionsBaking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ExperimentalFunctionsBaking/BakedFunctionTree.cs

    r203 r206  
    4545    }
    4646
    47     internal BakedFunctionTree(IFunction function) : this() {
     47    internal BakedFunctionTree(IFunction function)
     48      : this() {
    4849      code.Add(0);
    4950      code.Add(MapFunction(function));
     
    6061    }
    6162
    62     internal BakedFunctionTree(IFunctionTree tree) : this() {
     63    internal BakedFunctionTree(IFunctionTree tree)
     64      : this() {
    6365      code.Add(0);
    6466      code.Add(MapFunction(tree.Function));
     
    130132        }
    131133        treesExpanded = false;
    132         subTrees.Clear();
     134        subTrees = null;
    133135      }
    134136    }
     
    143145        }
    144146        variablesExpanded = false;
    145         variables.Clear();
     147        variables = null;
    146148      }
    147149    }
     
    198200          variablesExpanded = true;
    199201          code[2] = 0;
    200           code.RemoveRange(3, variables.Count); 
     202          code.RemoveRange(3, variables.Count);
    201203        }
    202204        return variables;
     
    241243        //  currentBranchIndex += branchLength;
    242244        //}
    243        
     245
    244246        //code.InsertRange(currentBranchIndex, ((BakedFunctionTree)tree).code);
    245247        //code[0] = code[0] + 1;
     
    268270
    269271    private int PC;
     272    private double[] codeArr;
    270273    public double Evaluate(Dataset dataset, int sampleIndex) {
    271274      PC = 0;
    272275      FlattenVariables();
    273276      FlattenTrees();
     277      if(codeArr == null) {
     278        codeArr = new double[code.Count];
     279        code.CopyTo(codeArr);
     280      }
    274281      return EvaluateBakedCode(dataset, sampleIndex);
    275282    }
  • branches/ExperimentalFunctionsBaking/HeuristicLab.Functions.csproj

    r203 r206  
    4949  <ItemGroup>
    5050    <Compile Include="Addition.cs" />
    51     <Compile Include="And.cs" />
     51    <Compile Include="And.cs">
     52      <SubType>Code</SubType>
     53    </Compile>
    5254    <Compile Include="Average.cs" />
    5355    <Compile Include="BakedFunctionTree.cs" />
     
    5557    <Compile Include="GreaterThan.cs" />
    5658    <Compile Include="FunctionTree.cs" />
     59    <Compile Include="IfThenElse.cs">
     60      <SubType>Code</SubType>
     61    </Compile>
    5762    <Compile Include="IFunctionTree.cs" />
    5863    <Compile Include="ModelAnalyzerExporter.cs" />
     64    <Compile Include="Or.cs">
     65      <SubType>Code</SubType>
     66    </Compile>
    5967    <Compile Include="ProgrammableFunction.cs" />
    6068    <Compile Include="Equal.cs" />
     
    6573      <DependentUpon>FunctionView.cs</DependentUpon>
    6674    </Compile>
    67     <Compile Include="IfThenElse.cs" />
    6875    <Compile Include="IFunctionVisitor.cs" />
    6976    <Compile Include="LessThan.cs" />
    7077    <Compile Include="Not.cs" />
    71     <Compile Include="Or.cs" />
    7278    <Compile Include="Signum.cs" />
    7379    <Compile Include="Logarithm.cs" />
Note: See TracChangeset for help on using the changeset viewer.