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


C# Specification.GetSMV方法代码示例

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


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

示例1: IsVectorBased

 /// <returns>true when input to function has one argument which is a SMV of grade 1.</returns>
 public bool IsVectorBased(Specification S, G25.fgs F, FloatType FT)
 {
     if (!(F.ArgumentTypeNames.Length == 1) && (!IsCoordBased(S, F, FT))) return false;
     G25.SMV smv = S.GetSMV(F.ArgumentTypeNames[0]);
     if (smv == null) return false;
     return (smv.LowestGrade() == 1) && (smv.HighestGrade() == 1);
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:8,代码来源:cgapoint.cs

示例2: GetReturnType

        /// <summary>
        /// The user may have requested a return type (F.ReturnTypeName). 
        /// In that case, the type with the same name is found, or an exception 
        /// is thrown if it does not exists.
        /// 
        /// Otherwise, finds the (tightest, best) return type for a function 'F' which 
        /// returning the (symbolic) value 'value'. 
        /// This  may or may not result in an SMV being found. If no 
        /// type is found and the return type is a scalar, then a floating
        /// point type may be returned.
        /// 
        /// If no SMV type is found, then a new type is created, and an exception
        /// is thrown which described the missing type.
        /// </summary>
        /// <param name="S">The specification (used to find SMVs)</param>
        /// <param name="cgd">Not used currently.</param>
        /// <param name="F">Function description (used for user-specified return type).</param>
        /// <param name="FT">Floating point type used in function.</param>
        /// <param name="value">The symbolic return value.</param>
        /// <returns>The SMV, FloatType or null if none found.</returns>
        public static G25.VariableType GetReturnType(Specification S, CGdata cgd, G25.fgs F, FloatType FT, RefGA.Multivector value)
        {
            if ((F.ReturnTypeName != null) && (F.ReturnTypeName.Length > 0))
            {
                // The user specified a return type
                G25.SMV returnSmv = S.GetSMV(F.ReturnTypeName); // is it a SMV?
                if (returnSmv != null) return returnSmv;
                G25.FloatType returnFT = S.GetFloatType(F.ReturnTypeName); // is it a specific float?
                if (returnFT != null) return FT; //returnFT;
                else if (F.ReturnTypeName == G25.XML.XML_SCALAR) // is it a unspecified float?
                    return FT;

                // type does not exist: abort (TODO: error message)
                else throw new G25.UserException("Non-existant user-specified return type: " + F.ReturnTypeName,
                    XML.FunctionToXmlString(S, F)); // non-existant return type
            }
            else
            {
                G25.VariableType RT = FindTightestMatch(S, value, FT);
                if (RT != null) return RT;
                else return CreateSyntheticSMVtype(S, cgd, FT, value);
            }
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:43,代码来源:specializedreturntype.cs


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