Beispiel #1
0
        /// <summary>
        /// If this FunctionGenerator can implement 'm_fgs', then this function should complete the (possible)
        /// blanks in 'm_fgs'. This means:
        ///  - Fill in m_fgs.m_returnTypeName if it is empty
        ///  - Fill in m_fgs.m_argumentTypeNames (and m_argumentVariableNames) if it is empty.
        /// </summary>
        public override void CompleteFGS()
        {
            m_functionNameFloatType = m_fgs.Name.Substring(RANDOM.Length);

            if (m_fgs.m_returnTypeName.Length == 0)
            {
                m_fgs.m_returnTypeName = m_functionNameFloatType;
            }

            string genTypeStr = m_fgs.GetOption("Gen");

            if ((genTypeStr == null) || (genTypeStr == "libc"))
            {
                m_generatorType = PRGtype.LIBC;
            }
            else if (genTypeStr == "mt")
            {
                m_generatorType = PRGtype.MT;
            }
            else
            {
                throw new G25.UserException("Invalid random number generator type (optionGen) '" + genTypeStr + "'");
            }

            /// tell code generator we are going to need MT
            if (m_generatorType == PRGtype.MT)
            {
                m_cgd.SetFeedback(Main.MERSENNE_TWISTER, "true");
            }
            m_cgd.SetFeedback(Main.NEED_TIME, "true");
        }
Beispiel #2
0
        /// <summary>
        /// If this FunctionGenerator can implement 'm_fgs', then this function should complete the (possible)
        /// blanks in 'm_fgs'. This means:
        ///  - Fill in m_fgs.m_returnTypeName if it is empty
        ///  - Fill in m_fgs.m_argumentTypeNames (and m_argumentVariableNames) if it is empty.
        /// </summary>
        public override void CompleteFGS()
        {
            m_functionNameFloatType = m_fgs.Name.Substring(RANDOM.Length);

            if (m_fgs.m_returnTypeName.Length == 0)
                m_fgs.m_returnTypeName = m_functionNameFloatType;

            string genTypeStr = m_fgs.GetOption("Gen");
            if ((genTypeStr == null) || (genTypeStr == "libc"))
                m_generatorType = PRGtype.LIBC;
            else if (genTypeStr == "mt")
                m_generatorType = PRGtype.MT;
            else throw new G25.UserException("Invalid random number generator type (optionGen) '" + genTypeStr + "'");

            /// tell code generator we are going to need MT
            if (m_generatorType == PRGtype.MT)
                m_cgd.SetFeedback(Main.MERSENNE_TWISTER, "true");
            m_cgd.SetFeedback(Main.NEED_TIME, "true");
        }