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


C# FunctionType类代码示例

本文整理汇总了C#中FunctionType的典型用法代码示例。如果您正苦于以下问题:C# FunctionType类的具体用法?C# FunctionType怎么用?C# FunctionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Token

 public Token(FunctionType functionType, int operandsCount)
 {
     this.Type = TokenType.Function;
     this.FunctionType = functionType;
     this.OperandsCount = operandsCount;
     this.Precedence = GetPrecedence();
 }
开发者ID:RuzmanovDev,项目名称:TelerikAcademy,代码行数:7,代码来源:Token.cs

示例2: KernelEntryPoint

 public KernelEntryPoint(Function kernelFunction, FunctionType entryPointType)
     : base(kernelFunction.GetModule())
 {
     SetFunctionType(entryPointType);
     this.flags = MemberFlags.Static;
     this.kernelFunction = kernelFunction;
 }
开发者ID:ronsaldo,项目名称:chela,代码行数:7,代码来源:KernelEntryPoint.cs

示例3: Function

 public Function(string prefix, string name, ArrayList argumentList)
 {
     this.functionType = FunctionType.FuncUserDefined;
     this.prefix = prefix;
     this.name = name;
     this.argumentList = new ArrayList(argumentList);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:Function.cs

示例4: Deserialize

        public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return new FunctionType();
            if (ss == null)
                return null;
            var argser = new ArgumentDeserializer(this, Architecture, frame, 0, Architecture.WordWidth.Size);
            Identifier ret = null;

            if (ss.ReturnValue != null)
            {
                ret = argser.DeserializeReturnValue(ss.ReturnValue);
            }

            var args = new List<Identifier>();
            this.gr = 0;
            if (ss.Arguments != null)
            {
                for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                {
                    var sArg = ss.Arguments[iArg];
                    Identifier arg = DeserializeArgument(argser, sArg);
                    args.Add(arg);
                }
            }

            var sig = new FunctionType(ret, args.ToArray());
            return sig;
        }
开发者ID:relaxar,项目名称:reko,代码行数:29,代码来源:Rt11ProcedureSerializer.cs

示例5: Neuron

        /// <summary>
        /// Инициализирует экземпляр класса Neuron с нулевыми значениями входных сигналов и случайными начальными весами.
        /// </summary>
        /// <param name="signalsCount">Число синапсов на входе нейрона.</param>
        /// <param name="ft">Тип активационной функции нейрона.</param>
        /// <param name="funcParam">Значение параметра активационной функции.</param>
        public Neuron(int signalsCount, FunctionType ft, double funcParam)
        {
            SignalsIn = new double[signalsCount];
            Weights = new double[signalsCount];
            _param = funcParam;
            var r = RandomProvider.GetThreadRandom();

            Offset = Convert.ToDouble(r.Next(-100, 100)) / 1000;
            for (int i = 0; i < SignalsIn.Length; ++i)
            {
                Weights[i] = Convert.ToDouble(r.Next(-100, 100)) / 1000; //инициализация весов
                SignalsIn[i] = 0;
            }
            _activationFunc = ft;
            switch (ft) //инициализация активационной функции нейрона
            {
                case FunctionType.Linear:
                    _afd = LinearFunc; //линейная
                break;
                case FunctionType.Sigmoid:
                    _afd = LogSigmoidFunc; //лог-сигмоидальная
                    break;
                case FunctionType.HyperbolicTangent:
                    _afd = HyperbolicTangentFunc; //гиперболический тангенс
                    break;
                case FunctionType.Threshold:
                    _afd = ThresholdFunc; //пороговая
                    break;
                default:
                    throw new Exception("Неизвестный тип активационной функции");
            }
        }
开发者ID:Corpseintube0,项目名称:NN,代码行数:38,代码来源:Neuron.cs

示例6: Deserialize

        public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return null;
            this.argDeser = new ArgumentDeserializer(this, Architecture, frame, 0, Architecture.WordWidth.Size);
            Identifier ret = null;
            int fpuDelta = FpuStackOffset;

            FpuStackOffset = 0;
            if (ss.ReturnValue != null)
            {
                ret = argDeser.DeserializeReturnValue(ss.ReturnValue);
                fpuDelta += FpuStackOffset;
            }

            FpuStackOffset = 0;
            var args = new List<Identifier>();
            if (ss.Arguments != null)
            {
                for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                {
                    var sArg = ss.Arguments[iArg];
                    var arg = DeserializeArgument(sArg, iArg, ss.Convention);
                    args.Add(arg);
                }
                fpuDelta -= FpuStackOffset;
            }
            FpuStackOffset = fpuDelta;

            var sig = new FunctionType(ret, args.ToArray());
            ApplyConvention(ss, sig);
            return sig;
        }
开发者ID:relaxar,项目名称:reko,代码行数:33,代码来源:MipsProcedureSerializer.cs

示例7: Building

 public Building(int id,int price,string name, FunctionType type)
 {
     ID = id;
     Price = price;
     Name = name;
     Type = type;
 }
开发者ID:div8ivb,项目名称:Citadels,代码行数:7,代码来源:Building.cs

示例8: NativeTableItem

        public NativeTableItem( UFunction function )
        {
            if( function.IsOperator() )
            {
                Type = FunctionType.Operator;
            }
            else if( function.IsPost() )
            {
                Type = FunctionType.PostOperator;
            }
            else if( function.IsPre() )
            {
                Type = FunctionType.PreOperator;
            }
            else
            {
                Type = FunctionType.Function;
            }

            OperPrecedence = function.OperPrecedence;
            ByteToken = function.NativeToken;
            Name = Type == FunctionType.Function
                ? function.Name
                : function.FriendlyName;
        }
开发者ID:jjbott,项目名称:Unreal-Library,代码行数:25,代码来源:NativesTablePackage.cs

示例9: CreateFunctionParameter

        public static FunctionParameter CreateFunctionParameter(IList<string> list, string reference, string matchCount)
        {
            FunctionType[] types = new FunctionType[list.Count];
            for (int i = 0; i < list.Count; i++) {
                string s = list[i];
                FunctionType funType;
                if (String.Compare(s, "any", true) == 0) {
                    funType = FunctionType.Any;
                } else if (String.Compare(s, "comparable", true) == 0) {
                    funType = FunctionType.Comparable;
                } else if (String.Compare(s, "table", true) == 0) {
                    funType = FunctionType.Table;
                } else {
                    funType = new FunctionType(SqlType.Parse(s));
                }

                types[i] = funType;
            }

            FunctionParameterMatch match;
            if (matchCount == "1") {
                match = FunctionParameterMatch.Exact;
            } else if (matchCount == "+") {
                match = FunctionParameterMatch.OneOrMore;
            } else if (matchCount == "*") {
                match = FunctionParameterMatch.ZeroOrMore;
            } else {
                match = FunctionParameterMatch.ZeroOrOne;
            }

            return new FunctionParameter(types, reference, match);
        }
开发者ID:ikvm,项目名称:deveelsql,代码行数:32,代码来源:Util.cs

示例10: FunctionInfo

 public FunctionInfo(ObjectName routineName, DataType returnType, FunctionType functionType)
     : base(routineName)
 {
     ReturnType = returnType;
     FunctionType = functionType;
     AssertUnboundAtEnd();
 }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:FunctionInfo.cs

示例11: Setup

 public void Setup()
 {
     this.sc = new ServiceContainer();
     this.x86 = new X86ArchitectureFlat32();
     this.ppc = new PowerPcArchitecture32();
     this.m = new ProcedureBuilder();
     this.printfChr = new ProcedureCharacteristics()
     {
         VarargsParserClass =
             "Reko.Libraries.Libc.PrintfFormatParser,Reko.Libraries.Libc"
     };
     this.x86PrintfSig = new FunctionType(
         null,
         StackId(null,   4, CStringType()),
         StackId("...",  8, new UnknownType()));
     this.x86SprintfSig = new FunctionType(
         null,
         StackId(null,   4, CStringType()),
         StackId(null,   8, CStringType()),
         StackId("...", 12, new UnknownType()));
     this.ppcPrintfSig = new FunctionType(
         null,
         RegId(null,  ppc, "r3", CStringType()),
         RegId("...", ppc, "r4", new UnknownType()));
     this.addrInstr = Address.Ptr32(0x123400);
 }
开发者ID:relaxar,项目名称:reko,代码行数:26,代码来源:VarargsFormatScannerTests.cs

示例12: Function

 public Function(string prefix, string name, List<AstNode> argumentList)
 {
     _functionType = FunctionType.FuncUserDefined;
     _prefix = prefix;
     _name = name;
     _argumentList = new List<AstNode>(argumentList);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:7,代码来源:Function.cs

示例13: DetermineCallingConvention

 public override string DetermineCallingConvention(FunctionType signature)
 {
     if (!signature.HasVoidReturn)
     {
         var reg = signature.ReturnValue.Storage as RegisterStorage;
         if (reg != null)
         {
             if (reg != Registers.al && reg != Registers.ax)
                 return null;
         }
         var seq = signature.ReturnValue.Storage as SequenceStorage;
         if (seq != null)
         {
             if (seq.Head != Registers.dx || seq.Tail != Registers.ax)
                 return null;
         }
     }
     if (signature.Parameters.Any(p => !(p.Storage is StackArgumentStorage)))
         return null;
     if (signature.FpuStackDelta != 0 || signature.FpuStackArgumentMax >= 0)
         return null;
     if (signature.StackDelta == 0)
         return "__cdecl";
     else
         return "__pascal";
 }
开发者ID:relaxar,项目名称:reko,代码行数:26,代码来源:MsdosPlatform.cs

示例14: SetFunctionType_Group2Message

        /// <summary>
        /// Sets whether functions 5 to 8 of the locomotive are momentaty or on/off
        /// </summary>
        /// <remarks>
        /// The type of each function is stored in a database maintained by the command station.
        /// </remarks>
        /// <param name="address">The address of the locomotive (0 - 9999)</param>
        /// <param name="f5">Function 5</param>
        /// <param name="f6">Function 6</param>
        /// <param name="f7">Function 7</param>
        /// <param name="f8">Function 8</param>
        public SetFunctionType_Group2Message(int address, FunctionType f5, FunctionType f6, FunctionType f7, FunctionType f8)
            : base(PacketHeaderType.LocomotiveFunction)
        {
            Payload.Add(Convert.ToByte(PacketIdentifier.LocomotiveFunctionRequest.SetFunctionState_Group2));

            byte[] data = new byte[3];

            if (address >= XpressNetConstants.MIN_LOCO_ADDRESS && address <= XpressNetConstants.MAX_LOCO_ADDRESS)
                ValueConverter.LocoAddress(address, out data[0], out data[1]);
            else
                throw new XpressNetProtocolViolationException("Number out of bounds");

            data[2] = 0x00;
            //TODO: check if & operator speeds up this function
            if (f8 == FunctionType.OnOff)
                data[2] += 8;

            if (f7 == FunctionType.OnOff)
                data[2] += 4;

            if (f6 == FunctionType.OnOff)
                data[2] += 2;

            if (f5 == FunctionType.OnOff)
                data[2] += 1;

            Payload.AddRange(data);
        }
开发者ID:networkfusion,项目名称:XpressNetSharp,代码行数:39,代码来源:SetFunctionType_Group2Message.cs

示例15: FunctionDescriptor

        public FunctionDescriptor(
            string assembly, string className, string name, string summary,
            IEnumerable<TypedParameter> parameters, string returnType, FunctionType type,
            bool isVisibleInLibrary = true, IEnumerable<string> returnKeys = null, bool isVarArg = false)
        {
            this.summary = summary;
            Assembly = assembly;
            ClassName = className;
            Name = name;

            if (parameters == null)
                Parameters = new List<TypedParameter>();
            else
            {
                Parameters = parameters.Select(
                    x =>
                    {
                        x.Function = this;
                        return x;
                    });
            }

            ReturnType = returnType == null ? "var[]..[]" : returnType.Split('.').Last();
            Type = type;
            ReturnKeys = returnKeys ?? new List<string>();
            IsVarArg = isVarArg;
            IsVisibleInLibrary = isVisibleInLibrary;
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:28,代码来源:FunctionDescriptor.cs


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