Esempio n. 1
0
        public IFunction ToInput(LExpression parameter, ICLRBoundaryMap rootTypeMap, CompilationContext context)
        {
            var arg = parameter;

            if (arg.Type != typeof(float))
            {
                if (arg.Type == typeof(bool))
                {
                    arg = LExpression.Condition(arg, LExpression.Constant(1f), LExpression.Constant(0f));
                }
                else
                {
                    arg = LExpression.Convert(arg, typeof(float));
                }
            }

            return(new SingleInputExpr(arg));
        }
Esempio n. 2
0
 public Input1DFunc(Expression parameter, Dictionary <string, string> map, ICLRBoundaryMap rootTypeMap)
 {
     _parameter   = parameter;
     _map         = map;
     _rootTypeMap = rootTypeMap;
 }
Esempio n. 3
0
 public static TDelegate Compile <TDelegate>(this IFunction function,
                                             ICLRBoundaryMap translator = null,
                                             CompilationContext info    = null) where TDelegate : Delegate?
 => (TDelegate)function.Compile(typeof(TDelegate), translator, info);
Esempio n. 4
0
 public IFunction ToInput(System.Linq.Expressions.Expression parameter, ICLRBoundaryMap rootTypeMap, CompilationContext info) =>
 new Array1DFunc(parameter);
Esempio n. 5
0
 public static TDelegate Compile <TDelegate>(this IFunction function,
                                             CompilationInput input,
                                             ICLRBoundaryMap boundaryMap = null) where TDelegate : Delegate? =>
 (TDelegate)function.Compile(typeof(TDelegate), input, boundaryMap);