本文整理汇总了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);
}
示例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);
}
}