Free cookie consent management tool by TermsFeed Policy Generator

Changeset 235


Ignore:
Timestamp:
05/12/08 15:33:21 (16 years ago)
Author:
gkronber
Message:

fixed bug in function evaluation.
if a tree had the same size as the tree that was evaluated just before the evaluator evaluated the last tree again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Functions/BakedTreeEvaluator.cs

    r229 r235  
    8686    private static int PC;
    8787    private static int DP;
    88     private static int[] codeArr;
    89     private static double[] dataArr;
     88    private static int MAX_CODE_LENGTH = 4096;
     89    private static int MAX_DATA_LENGTH = 4096;
     90    private static int[] codeArr = new int[MAX_CODE_LENGTH];
     91    private static double[] dataArr = new double[MAX_DATA_LENGTH];
    9092    private static Dataset dataset;
    9193    private static int sampleIndex;
     
    9496      PC = 0;
    9597      DP = 0;
    96       if(codeArr == null || codeArr.Length!=code.Count) {
    97         codeArr = new int[code.Count];
    98         dataArr = new double[data.Count];
    99         code.CopyTo(codeArr);
    100         data.CopyTo(dataArr);
    101       }
     98      code.CopyTo(codeArr);
     99      data.CopyTo(dataArr);
    102100      sampleIndex = _sampleIndex;
    103101      dataset = _dataset;
Note: See TracChangeset for help on using the changeset viewer.