Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/17 09:28:34 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/VectorConcatExpressions.cs

    r14952 r15017  
    1616    protected VectorConcatExpression(bool deserializing) : base(deserializing) { }
    1717
    18     protected bool IsNoop(IInternalPushInterpreter interpreter, IPushStack<List<T>> vectorStack) {
     18    protected bool IsNoop(IInternalPushInterpreter interpreter, IPushStack<IReadOnlyList<T>> vectorStack) {
    1919      return vectorStack.Count < 2 ||
    2020             vectorStack.Top.Count + vectorStack[1].Count > interpreter.Configuration.MaxVectorLength;
    2121    }
    2222
    23     protected void Eval(IInternalPushInterpreter interpter, IPushStack<List<T>> vectorStack) {
     23    protected void Eval(IInternalPushInterpreter interpter, IPushStack<IReadOnlyList<T>> vectorStack) {
    2424      var first = vectorStack.Pop();
    2525      var second = vectorStack.Top;
    26       var result = new T[first.Count + second.Count];
     26      var result = new List<T>(second.Count + first.Count);
     27      result.AddRange(second);
     28      result.AddRange(first);
    2729
    28       first.CopyTo(result, 0);
    29       second.CopyTo(result, first.Count);
    30       vectorStack.SetTop(new List<T>(result));
     30      vectorStack.Top = result;
    3131    }
    3232  }
Note: See TracChangeset for help on using the changeset viewer.