Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/09/16 15:34:33 (8 years ago)
Author:
gkronber
Message:

#2650 added new symbol FactorVariable (renamed previous symbol to BinaryFactorVariable)
Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r14243 r14249  
    6666    private static MethodInfo erf = thisType.GetMethod("Erf", new Type[] { typeof(double) });
    6767    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    private static MethodInfo string_eq = typeof(string).GetMethod("Equals", new Type[] { typeof(string) });
    6969    #endregion
    7070
     
    628628            return;
    629629          }
    630         case OpCodes.FactorVariable: {
    631             BinaryFactorVariableTreeNode varNode = currentInstr.dynamicNode as BinaryFactorVariableTreeNode;
    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               throw new NotSupportedException();
    642               // TODO: convert bool to 1 / 0?
    643             } else {
    644               var nanResult = il.DefineLabel();
    645               var normalResult = il.DefineLabel();
    646               il.Emit(System.Reflection.Emit.OpCodes.Dup);
    647               il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
    648               il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
    649               il.Emit(System.Reflection.Emit.OpCodes.Dup);
    650               il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
    651               il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
    652               il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
    653               il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.VariableValue);
    654               il.Emit(System.Reflection.Emit.OpCodes.Call, string_eq);
    655               throw new NotSupportedException();
    656               // TODO: convert bool to 1 / 0?
    657               il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
    658               il.MarkLabel(nanResult);
    659               il.Emit(System.Reflection.Emit.OpCodes.Pop); // rowIndex
    660               il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
    661               il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
    662               il.MarkLabel(normalResult);
    663             }
    664             return;
     630        case OpCodes.FactorVariable:
     631        case OpCodes.BinaryFactorVariable: {
     632            throw new NotSupportedException();
    665633          }
    666634        case OpCodes.LagVariable: {
Note: See TracChangeset for help on using the changeset viewer.