Changeset 14232 for branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
- Timestamp:
- 08/03/16 18:54:14 (8 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r14185 r14232 66 66 private static MethodInfo erf = thisType.GetMethod("Erf", new Type[] { typeof(double) }); 67 67 private static MethodInfo bessel = thisType.GetMethod("Bessel", new Type[] { typeof(double) }); 68 private static MethodInfo string_eq = typeof(string).GetMethod("Equals", new Type[] {typeof(string)}); 68 69 #endregion 69 70 … … 627 628 return; 628 629 } 630 case OpCodes.FactorVariable: { 631 FactorVariableTreeNode varNode = currentInstr.dynamicNode as FactorVariableTreeNode; 632 il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array 633 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.data); 634 // load correct column of the current variable 635 il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref); 636 il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex 637 if (!state.InLaggedContext) { 638 il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue); 639 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.VariableValue); 640 il.Emit(System.Reflection.Emit.OpCodes.Call, string_eq); 641 // TODO: convert bool to 1 / 0? 642 } else { 643 var nanResult = il.DefineLabel(); 644 var normalResult = il.DefineLabel(); 645 il.Emit(System.Reflection.Emit.OpCodes.Dup); 646 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); 647 il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult); 648 il.Emit(System.Reflection.Emit.OpCodes.Dup); 649 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows); 650 il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult); 651 il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue); 652 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.VariableValue); 653 il.Emit(System.Reflection.Emit.OpCodes.Call, string_eq); 654 // TODO: convert bool to 1 / 0? 655 il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult); 656 il.MarkLabel(nanResult); 657 il.Emit(System.Reflection.Emit.OpCodes.Pop); // rowIndex 658 il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference 659 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN); 660 il.MarkLabel(normalResult); 661 } 662 return; 663 } 629 664 case OpCodes.LagVariable: { 630 665 var nanResult = il.DefineLabel();
Note: See TracChangeset
for help on using the changeset viewer.