/// <summary>
        ///     Add the opcodes for string operations to a context.
        /// </summary>
        /// <param name="context">
        ///     <The context to add the opcodes to./ param>
        public static void CreateStringFunctions(EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_LENGTH);
            factory.AddExtension(EXTENSION_FORMAT);
            factory.AddExtension(EXTENSION_LEFT);
            factory.AddExtension(EXTENSION_RIGHT);
        }
        /// <summary>
        ///     Add the opcodes for type conversion operations to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        public static void CreateConversionFunctions(
            EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_CINT);
            factory.AddExtension(EXTENSION_CFLOAT);
            factory.AddExtension(EXTENSION_CSTR);
            factory.AddExtension(EXTENSION_CBOOL);
        }
        /// <summary>
        ///     Add all known opcodes to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        public static void CreateAll(EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            foreach (IProgramExtensionTemplate temp in EncogOpcodeRegistry.Instance
                     .FindAllOpcodes())
            {
                factory.AddExtension(temp);
            }
        }
        /// <summary>
        ///     Add the opcodes for trig functions operations to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        public static void CreateTrigFunctions(EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_ACOS);
            factory.AddExtension(EXTENSION_ASIN);
            factory.AddExtension(EXTENSION_ATAN);
            factory.AddExtension(EXTENSION_ATAN2);
            factory.AddExtension(EXTENSION_COS);
            factory.AddExtension(EXTENSION_COSH);
            factory.AddExtension(EXTENSION_SIN);
            factory.AddExtension(EXTENSION_SINH);
            factory.AddExtension(EXTENSION_TAN);
            factory.AddExtension(EXTENSION_TANH);
        }
        /// <summary>
        ///     Add the opcodes for boolean operations to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        public static void CreateBooleanOperators(EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_AND);
            factory.AddExtension(EXTENSION_OR);
            factory.AddExtension(EXTENSION_EQUAL);
            factory.AddExtension(EXTENSION_LT);
            factory.AddExtension(EXTENSION_GT);
            factory.AddExtension(EXTENSION_LTE);
            factory.AddExtension(EXTENSION_GTE);
            factory.AddExtension(EXTENSION_IFF);
            factory.AddExtension(EXTENSION_NOT_EQUAL);
            factory.AddExtension(EXTENSION_NOT);
        }
        /// <summary>
        ///     Add the opcodes for basic operations to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        public static void CreateBasicFunctions(EncogProgramContext context)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_ABS);
            factory.AddExtension(EXTENSION_CEIL);
            factory.AddExtension(EXTENSION_EXP);
            factory.AddExtension(EXTENSION_FLOOR);
            factory.AddExtension(EXTENSION_LOG);
            factory.AddExtension(EXTENSION_LOG10);
            factory.AddExtension(EXTENSION_MAX);
            factory.AddExtension(EXTENSION_MIN);
            factory.AddExtension(EXTENSION_POWFN);
            factory.AddExtension(EXTENSION_RANDOM);
            factory.AddExtension(EXTENSION_ROUND);
            factory.AddExtension(EXTENSION_SQRT);
            factory.AddExtension(EXTENSION_CLAMP);
        }
        /// <summary>
        ///     Add the opcodes for numeric operations to a context.
        /// </summary>
        /// <param name="context">The context to add the opcodes to.</param>
        /// <param name="protectedDiv">Should protected division be used.</param>
        public static void CreateNumericOperators(
            EncogProgramContext context, bool protectedDiv)
        {
            FunctionFactory factory = context.Functions;

            factory.AddExtension(EXTENSION_VAR_SUPPORT);
            factory.AddExtension(EXTENSION_CONST_SUPPORT);
            factory.AddExtension(EXTENSION_NEG);
            factory.AddExtension(EXTENSION_ADD);
            factory.AddExtension(EXTENSION_SUB);
            factory.AddExtension(EXTENSION_MUL);
            if (protectedDiv)
            {
                factory.AddExtension(EXTENSION_PDIV);
            }
            else
            {
                factory.AddExtension(EXTENSION_DIV);
            }
            factory.AddExtension(EXTENSION_POWER);
        }
 /// <summary>
 ///     Construct the context with the specified format and function factory.
 /// </summary>
 /// <param name="theFormat">The format.</param>
 /// <param name="theFunctions">The function factory.</param>
 public EncogProgramContext(CSVFormat theFormat,
                            FunctionFactory theFunctions)
 {
     _format = theFormat;
     _functions = theFunctions;
 }
 public void register(FunctionFactory functions)
 {
     functions.AddExtension(OPCODE_FIELD);
     functions.AddExtension(OPCODE_FIELDMAX);
     functions.AddExtension(OPCODE_FIELDMAXPIP);
 }