- Timestamp:
- 04/08/11 16:02:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r5925 r5987 36 36 #region private classes 37 37 private class InterpreterState { 38 private const int ARGUMENT_STACK_SIZE = 1024;39 38 private double[] argumentStack; 40 39 private int argumentStackPointer; … … 45 44 set { pc = value; } 46 45 } 47 internal InterpreterState(Instruction[] code ) {46 internal InterpreterState(Instruction[] code, int argumentStackSize) { 48 47 this.code = code; 49 48 this.pc = 0; 50 this.argumentStack = new double[ARGUMENT_STACK_SIZE]; 49 if (argumentStackSize > 0) { 50 this.argumentStack = new double[argumentStackSize]; 51 } 51 52 this.argumentStackPointer = 0; 52 53 } … … 202 203 var compiler = new SymbolicExpressionTreeCompiler(); 203 204 Instruction[] code = compiler.Compile(tree, MapSymbolToOpCode); 204 205 int necessaryArgStackSize = 0; 205 206 for (int i = 0; i < code.Length; i++) { 206 207 Instruction instr = code[i]; … … 216 217 var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode; 217 218 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName); 219 } else if (instr.opCode == OpCodes.Call) { 220 necessaryArgStackSize += instr.nArguments + 1; 218 221 } 219 222 } 220 var state = new InterpreterState(code );223 var state = new InterpreterState(code, necessaryArgStackSize); 221 224 222 225 foreach (var rowEnum in rows) { … … 370 373 double f_3 = Evaluate(dataset, ref row, state); row--; 371 374 state.ProgramCounter = savedPc; 372 double f_4 = Evaluate(dataset, ref row, state); 375 double f_4 = Evaluate(dataset, ref row, state); 373 376 row += 4; 374 377
Note: See TracChangeset
for help on using the changeset viewer.