本文整理汇总了C#中G25.GetArgumentTypeName方法的典型用法代码示例。如果您正苦于以下问题:C# G25.GetArgumentTypeName方法的具体用法?C# G25.GetArgumentTypeName怎么用?C# G25.GetArgumentTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G25
的用法示例。
在下文中一共展示了G25.GetArgumentTypeName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: value
protected RefGA.Multivector m_returnValue; ///< returned value (symbolic multivector)
#endregion Fields
#region Methods
/// <summary>
/// Checks if this FunctionGenerator can implement a certain function.
/// </summary>
/// <param name="S">The specification of the algebra.</param>
/// <param name="F">The function to be implemented.</param>
/// <returns>true if 'F' can be implemented</returns>
public override bool CanImplement(Specification S, G25.fgs F)
{
String arg1Type = F.GetArgumentTypeName(0, S.m_GMV.Name);
return ((F.Name == "sas") && (F.MatchNbArguments(3) &&
(S.IsSpecializedMultivectorName(arg1Type) || (arg1Type == S.m_GMV.Name)) &&
S.IsFloatType(F.GetArgumentTypeName(1, S.m_GMV.Name)) &&
S.IsFloatType(F.GetArgumentTypeName(2, S.m_GMV.Name))));
}
示例2: CanImplement
/// <summary>
/// Checks if this FunctionGenerator can implement a certain function.
/// </summary>
/// <param name="S">The specification of the algebra.</param>
/// <param name="F">The function to be implemented.</param>
/// <returns>true if 'F' can be implemented</returns>
public override bool CanImplement(Specification S, G25.fgs F)
{
if (F.Name.Length < G25.CG.Shared.CANSparts.EXTRACT_GRADE.Length) return false;
try
{
int gradeIdx = GetGradeIdx(F.Name);
return (F.Name.StartsWith(G25.CG.Shared.CANSparts.EXTRACT_GRADE) && F.MatchNbArguments(1) && // get the name & number of arguments right
(((gradeIdx >= 0) && (gradeIdx <= S.m_dimension)) || // either specify the grade index
((gradeIdx < 0) && (F.GetArgumentTypeName(0, S.m_GMV.Name) == S.m_GMV.Name)))); // or be a function over general multivectors and leave out the grade
}
catch (Exception)
{
// we arrive there when F.Name is gradeX where X is not a number.
return false;
}
}
示例3: IsCoordBased
/// <returns>true when input to function is coordinates.</returns>
public bool IsCoordBased(Specification S, G25.fgs F, FloatType FT)
{
return F.MatchNbArguments(S.m_dimension - 2) &&
S.IsFloatType(F.GetArgumentTypeName(0, FT.type)) &&
(!IsRandom(S, F));
}
示例4: CanImplement
/// <summary>
/// Checks if this FunctionGenerator can implement a certain function.
/// </summary>
/// <param name="S">The specification of the algebra.</param>
/// <param name="F">The function to be implemented.</param>
/// <returns>true if 'F' can be implemented</returns>
public override bool CanImplement(Specification S, G25.fgs F)
{
string arg1Type = F.GetArgumentTypeName(0, S.m_GMV.Name);
return ((IsIncrement(F) || IsDecrement(F)) && (F.MatchNbArguments(1) &&
(S.IsSpecializedMultivectorName(arg1Type) || (arg1Type == S.m_GMV.Name))));
}
示例5: NotMixScalarGmv
/// <summary>
/// Return true if 'F' does not mix arguments of type scalar and GMV
/// </summary>
/// <param name="S">Specification of algebra</param>
/// <param name="F">Function specification</param>
/// <param name="defaultArgType">Default argument type for all arguments (todo: allow for per-argument type)</param>
/// <param name="nbArgs">Number of arguments.</param>
/// <returns>true if 'F' does not mix arguments of type scalar and GMV</returns>
public static bool NotMixScalarGmv(Specification S, G25.fgs F, int nbArgs, String defaultArgType)
{
bool useScalar = false;
bool useGMV = false;
for (int a = 0; a < nbArgs; a++)
{
String typeName = F.GetArgumentTypeName(a, defaultArgType);
useScalar |= S.IsFloatType(typeName);
useGMV |= S.m_GMV.Name == typeName;
}
return (!(useScalar && useGMV));
}
示例6: IsSom
/// <summary>
/// Return true if argument 'argIdx' in 'F' is a specialized outermorphism type.
/// </summary>
/// <param name="S">Specification of algebra</param>
/// <param name="F">Function specification</param>
/// <param name="argIdx">Index of argument. If out of range, false is returned.</param>
/// <returns>true if argument 'argIdx' in 'F' is an outermorphism type.</returns>
public static bool IsSom(Specification S, G25.fgs F, int argIdx)
{
if (argIdx >= F.NbArguments) return false;
return (S.IsSpecializedOutermorphismName(F.GetArgumentTypeName(argIdx, "")));
}
示例7: IsSmv
/// <summary>
/// Return true if argument 'argIdx' in 'F' is a multivector type.
/// </summary>
/// <param name="S">Specification of algebra</param>
/// <param name="F">Function specification</param>
/// <param name="argIdx">Index of argument. If out of range, false is returned.</param>
/// <returns>true if argument 'argIdx' in 'F' is an multivector type.</returns>
public static bool IsSmv(Specification S, G25.fgs F, int argIdx)
{
if (argIdx >= F.NbArguments) return false;
return (S.IsSpecializedMultivectorName(F.GetArgumentTypeName(argIdx, "")));
}
示例8: NotUseOm
/// <summary>
/// Return true if 'F' does not use outermorphism types
/// </summary>
/// <param name="S">Specification of algebra</param>
/// <param name="F">Function specification</param>
/// <param name="defaultArgType">Default argument type for all arguments (todo: allow for per-argument type)</param>
/// <param name="nbArgs">Number of arguments.</param>
/// <returns>true if 'F' does not mix arguments of type SMV and GMV</returns>
public static bool NotUseOm(Specification S, G25.fgs F, int nbArgs, String defaultArgType)
{
for (int a = 0; a < nbArgs; a++)
{
String typeName = F.GetArgumentTypeName(a, defaultArgType);
if ((S.IsSpecializedOutermorphismName(typeName)) ||
((S.m_GOM != null) && (S.m_GOM.Name == typeName))) return false;
}
return true;
}
示例9: NotMixSmvGmv
/// <summary>
/// Return true if 'F' does not mix arguments of type SMV and GMV
/// </summary>
/// <param name="S">Specification of algebra</param>
/// <param name="F">Function specification</param>
/// <param name="defaultArgType">Default argument type for all arguments (todo: allow for per-argument type)</param>
/// <param name="nbArgs">Number of arguments.</param>
/// <returns>true if 'F' does not mix arguments of type SMV and GMV</returns>
public static bool NotMixSmvGmv(Specification S, G25.fgs F, int nbArgs, String defaultArgType)
{
bool useSMV = false;
bool useGMV = false;
for (int a = 0; a < nbArgs; a++)
{
String typeName = F.GetArgumentTypeName(a, defaultArgType);
useSMV |= S.IsSpecializedMultivectorName(typeName);
useGMV |= S.m_GMV.Name == typeName;
}
return (!(useSMV && useGMV));
}
示例10: 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;
}
}
}