本文整理汇总了C#中G25.MatchNbArguments方法的典型用法代码示例。如果您正苦于以下问题:C# G25.MatchNbArguments方法的具体用法?C# G25.MatchNbArguments怎么用?C# G25.MatchNbArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G25
的用法示例。
在下文中一共展示了G25.MatchNbArguments方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanImplement
protected G25.SMV m_smv2 = null; ///< if function over SMV, type goes here
#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 type F.GetArgumentTypeName(0, S.m_GMV.Name);
return ((F.Name == "equals") && (F.MatchNbArguments(NB_ARGS)) &&
G25.CG.Shared.Functions.NotMixSmvGmv(S, F, NB_ARGS, S.m_GMV.Name) &&
G25.CG.Shared.Functions.NotUseOm(S, F, NB_ARGS, 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)
{
return (((F.Name == "hp") || (F.Name == "ihp")) && (F.MatchNbArguments(NB_ARGS)) &&
G25.CG.Shared.Functions.NotMixScalarGmv(S, F, NB_ARGS, S.m_GMV.Name) &&
G25.CG.Shared.Functions.NotMixSmvGmv(S, F, NB_ARGS, S.m_GMV.Name) &&
G25.CG.Shared.Functions.NotUseOm(S, F, NB_ARGS, S.m_GMV.Name));
}
示例3: 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))));
}
示例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)
{
int NB_ARGS = 2;
return ((IsAdd(F) || IsSubtract(F)) && (F.MatchNbArguments(NB_ARGS)) &&
G25.CG.Shared.Functions.NotMixSmvGmv(S, F, NB_ARGS, S.m_GMV.Name) &&
G25.CG.Shared.Functions.NotMixScalarGmv(S, F, NB_ARGS, S.m_GMV.Name) &&
G25.CG.Shared.Functions.NotUseOm(S, F, NB_ARGS, S.m_GMV.Name));
}
示例5: 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 == "log") && (F.MatchNbArguments(1)))) return false;
string type = F.GetOption("type");
if (type == null) return false;
return type.ToLower().Equals("euclidean");
}
示例6: 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)
{
int NB_ARGS = 2;
// do a basic check first:
bool OK1 = ((F.Name == "applyOM") &&
(F.MatchNbArguments(NB_ARGS)) &&
G25.CG.Shared.Functions.IsOm(S, F, 0) && // argument 0 must be an outermorphism
G25.CG.Shared.Functions.IsMv(S, F, 1)); // argument 1 must be an multivector
if (!OK1) return false;
// specialized outermorphisms can only be applied to specialized multivectors
if (G25.CG.Shared.Functions.IsSom(S, F, 0) &&
(!G25.CG.Shared.Functions.IsSmv(S, F, 1))) return false;
return true;
}
示例7: 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;
}
}
示例8: 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));
}
示例9: 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))));
}
示例10: 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 (!(IsApplyVersor(F) || IsApplyVersorWI(F) || IsApplyUnitVersor(F))) return false;
int nbArgs = GetNbArgs(F);
// don't allow mixing of GMV/SMV or Scalar/SMV
if (!G25.CG.Shared.Functions.NotMixSmvGmv(S, F, nbArgs, S.m_GMV.Name)) return false;
if (!G25.CG.Shared.Functions.NotMixScalarGmv(S, F, nbArgs, S.m_GMV.Name)) return false;
return (((IsApplyVersor(F) || IsApplyUnitVersor(F)) && F.MatchNbArguments(2)) ||
(IsApplyVersorWI(F) && F.MatchNbArguments(3)));
}
示例11: 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)
{
return ((IsReverse(F) || IsNegate(F) || IsCliffordConjugate(F) || IsGradeInvolution(F)) &&
(F.MatchNbArguments(1)));
}
示例12: 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)
{
return ((F.Name == "op") && (F.MatchNbArguments(2)));
}
示例13: CanImplement
protected G25.SMV m_smv = null; ///< if function over SMV, type goes here
#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)
{
return ((F.Name == "versorInverse") && F.MatchNbArguments(1));
}
示例14: 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)
{
return (IsGradeBitmap(F) && (F.MatchNbArguments(2)));
}
示例15: 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)
{
return ((IsExp(F) || IsCos(F) || IsSin(F) || IsCosh(F) || IsSinh(F)) && (F.MatchNbArguments(1)));
}