当前位置: 首页>>代码示例>>C#>>正文


C# G25.GetFloatType方法代码示例

本文整理汇总了C#中G25.GetFloatType方法的典型用法代码示例。如果您正苦于以下问题:C# G25.GetFloatType方法的具体用法?C# G25.GetFloatType怎么用?C# G25.GetFloatType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在G25的用法示例。


在下文中一共展示了G25.GetFloatType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FuncArgInfo

        /// <summary>
        /// Constructs a new FuncArgInfo class for a specific argument 'argIdx' of function 'F'.
        /// </summary>
        /// <param name="S">Used for retrieving the G25.VariableType of 'm_typeName'.</param>
        /// <param name="F">Function for which this FuncArgInfo describes an argument.</param>
        /// <param name="argIdx">Index of argument. Use -1 for artificial 'return argument' used for the C language.</param>
        /// <param name="FT">Floating point type of the type of the argument.</param>
        /// <param name="defaultTypeName">Name of the type of the argument.</param>
        /// <param name="computeMultivectorValue">Set to true to convert the type into symbolic code. Uses 'F' to obtain the actual name of the variable to use inside the symbolic multivector.</param>
        public FuncArgInfo(G25.Specification S, G25.fgs F, int argIdx, G25.FloatType FT, string defaultTypeName, bool computeMultivectorValue)
        {
            m_mvInterface = true;
            m_name = F.GetArgumentName(argIdx);
            m_typeName = F.GetArgumentTypeName(argIdx, defaultTypeName);
            m_type = S.GetType(m_typeName);
            m_varType = m_type.GetVariableType();
            if (m_varType != VARIABLE_TYPE.FLOAT) m_floatType = FT;
            else m_floatType = S.GetFloatType(m_typeName);

            // set mangled type name (depends on whether type is scalar or not)
            if ((m_varType == VARIABLE_TYPE.FLOAT) || (m_varType == VARIABLE_TYPE.ENUM))
            {
                m_mangledTypeName = m_typeName;
            }
            else {
                m_mangledTypeName = FT.GetMangledName(S, m_typeName);

                // temp (currently disabled) test for C# and Java
                // if (S.OutputCSharpOrJava() && (m_varType == VARIABLE_TYPE.GMV))
                // m_mangledTypeName = m_mangledTypeName + G25.CG.Shared.Main.IF_SUFFIX;
            }

            // set pointer / non pointer flag
            m_pointer = F.GetArgumentPtr(S, argIdx);

            // set array  flag
            m_array = F.GetArgumentArr(S, argIdx);

            m_constant = (argIdx >= 0);

            if (computeMultivectorValue) {
                if (m_varType == VARIABLE_TYPE.SMV)
                {
                    m_multivectorValue = new RefGA.Multivector[1] { Symbolic.SMVtoSymbolicMultivector(S, (G25.SMV)m_type, m_name, m_pointer) };
                }
                else if (m_varType == VARIABLE_TYPE.GMV)
                    m_multivectorValue = Symbolic.GMVtoSymbolicMultivector(S, (G25.GMV)m_type, m_name, m_pointer, -1); // -1 = sym mv for all groups
                else if (m_varType == VARIABLE_TYPE.FLOAT)
                    m_multivectorValue = new RefGA.Multivector[1] { Symbolic.ScalarToSymbolicMultivector(S, (G25.FloatType)m_type, m_name) };
                else
                {
                    // OM: do nothing?
                    m_multivectorValue = null;
                }
            }
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:56,代码来源:funcarginfo.cs


注:本文中的G25.GetFloatType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。