Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/08 00:39:50 (16 years ago)
Author:
gkronber
Message:

worked on #364 (Improve GP evaluation performance)

  • removed list of Instr
  • changes that didn't affect performance directly: reduced size of Instr class, added 'constant-folding' and pre-calculation of skip-lengths


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP/BakedFunctionTree.cs

    r656 r767  
    3232
    3333  public class LightWeightFunction {
    34     public int arity = 0;
     34    public byte arity = 0;
    3535    public IFunction functionType;
    3636    public List<double> data = new List<double>();
     
    116116    private void FlattenTrees() {
    117117      if(treesExpanded) {
    118         linearRepresentation[0].arity = subTrees.Count;
     118        linearRepresentation[0].arity = (byte)subTrees.Count;
    119119        foreach(BakedFunctionTree subTree in subTrees) {
    120120          subTree.FlattenVariables();
     
    295295      foreach(XmlNode entryNode in linearRepresentationNode.ChildNodes) {
    296296        LightWeightFunction f = new LightWeightFunction();
    297         f.arity = int.Parse(entryNode.Attributes["Arity"].Value, CultureInfo.InvariantCulture);
     297        f.arity = byte.Parse(entryNode.Attributes["Arity"].Value, CultureInfo.InvariantCulture);
    298298        if(entryNode.Attributes["Data"]!=null)
    299299          f.data = GetList<double>(entryNode.Attributes["Data"].Value, s => double.Parse(s, CultureInfo.InvariantCulture));
Note: See TracChangeset for help on using the changeset viewer.