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


C# G25.MatchNbArguments方法代码示例

本文整理汇总了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));
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:19,代码来源:equals.cs

示例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));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:13,代码来源:hp.cs

示例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))));
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:20,代码来源:sas.cs

示例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));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:14,代码来源:addsubtract.cs

示例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");
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:15,代码来源:log_euclidean.cs

示例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;
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:22,代码来源:applyom.cs

示例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;
            }
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:23,代码来源:extractgrade.cs

示例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));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:7,代码来源:cgapoint.cs

示例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))));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:12,代码来源:increment.cs

示例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)));
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:19,代码来源:applyversor.cs

示例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)));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:11,代码来源:togglesign.cs

示例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)));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:10,代码来源:op.cs

示例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));
        }
开发者ID:Sciumo,项目名称:gaigen,代码行数:16,代码来源:versorinverse.cs

示例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)));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:10,代码来源:gradebitmap.cs

示例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)));
 }
开发者ID:Sciumo,项目名称:gaigen,代码行数:10,代码来源:sincosexp.cs


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