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


C# Frequency类代码示例

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


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

示例1: ImpliedRate

        public static InterestRate ImpliedRate(IDayCounter dc, double compoundFactor, Compounding c, Frequency f, double time)
        {
            double r;
            if (Helper.Equals(compoundFactor, 1.0))
            {
                r = 0.0;
            }
            else
            {
                switch (c)
                {
                    case Compounding.Simple:
                        r = (compoundFactor - 1.0)/time;
                        break;
                    case Compounding.Compounded:
                        r = (Math.Pow(compoundFactor, 1.0 / ((double)f * time)) - 1.0) * (double)f;
                        break;
                    case Compounding.Continuous:
                        r = Math.Log(compoundFactor)/time;
                        break;
                    default:
                        throw new NotImplementedException($"Unknown Compounding {c}");
                }
            }

            return new InterestRate(dc, r, c, f);
        }
开发者ID:agryb,项目名称:XBTQ,代码行数:27,代码来源:InterestRate.cs

示例2: FetchConfigurationForCustomCommand

 public FetchConfigurationForCustomCommand(IntegrationAction action, IntegrationType type, Frequency frequency, string customDay)
 {
     Type = type;
     Action = action;
     Frequency = frequency;
     CustomDay = customDay;
 }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:FetchConfiguration.cs

示例3: inflationPeriod

        //! utility function giving the inflation period for a given date
        public static KeyValuePair<Date, Date> inflationPeriod(Date d, Frequency frequency) {
            Month month = (Month)d.Month;
            int year = d.Year;

            Month startMonth;
            Month endMonth;
            switch (frequency) {
                case Frequency.Annual:
                    startMonth = Month.January;
                    endMonth = Month.December;
                    break;
                case Frequency.Semiannual:
                    startMonth = (Month)(6 * ((int)month - 1) / 6 + 1);
                    endMonth = (Month)(startMonth + 5);
                    break;
                case Frequency.Quarterly:
                    startMonth = (Month)(3 * ((int)month - 1) / 3 + 1);
                    endMonth = (Month)(startMonth + 2);
                    break;
                case Frequency.Monthly:
                    startMonth = endMonth = month;
                    break;
                default:
                    throw new ApplicationException("Frequency not handled: " + frequency);
            }

            Date startDate = new Date(1, startMonth, year);
            Date endDate = Date.endOfMonth(new Date(1, endMonth, year));

            return new KeyValuePair<Date, Date>(startDate, endDate);
        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:32,代码来源:InflationTermStructure.cs

示例4: FlatForward

 public FlatForward(Date referenceDate, double forward, DayCounter dayCounter, Compounding compounding, Frequency frequency)
     : base(referenceDate, new Calendar(), dayCounter)
 {
     forward_ = new SimpleQuote(forward);
     compounding_ = compounding;
     frequency_ = frequency;
 }
开发者ID:akasolace,项目名称:qlnet,代码行数:7,代码来源:Flatforward.cs

示例5: EquivalentRate

 public InterestRate EquivalentRate(IDayCounter dc, Compounding c, Frequency f, DateTimeOffset d1, DateTimeOffset d2)
 {
     var t1 = _dc.YearFraction(d1, d2);
     var t2 = dc.YearFraction(d1, d2);
     var compoundFactor = CompoundFactor(t1);
     return ImpliedRate(dc, compoundFactor, c, f, t2);
 }
开发者ID:agryb,项目名称:XBTQ,代码行数:7,代码来源:InterestRate.cs

示例6: SwapRateHelper

        public SwapRateHelper(double rate, Period tenor, Calendar calendar,
            Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount,
            IborIndex iborIndex)
            : this(rate, tenor, calendar, fixedFrequency, fixedConvention, fixedDayCount, iborIndex,
		                      	     new Handle<Quote>(), new Period(0, TimeUnit.Days))
        {
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:SwapRateHelper.cs

示例7: InterestRate

 public InterestRate(IDayCounter dc, double r, Compounding c, Frequency f)
 {
     _dc = dc;
     _r = r;
     _c = c;
     _f = f;
 }
开发者ID:agryb,项目名称:XBTQ,代码行数:7,代码来源:InterestRate.cs

示例8: UserPreferenceBuilder

 internal UserPreferenceBuilder()
 {
     userId = Constants.USER_InValidId;
     portalId = Constants.PORTAL_ValidPortalId;
     messagesEmailFrequency = Frequency.Instant;
     notificationsEmailFrequency = Frequency.Hourly;
 }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:7,代码来源:UserPreferenceBuilder.cs

示例9: VerifyAllEnums

 public void VerifyAllEnums()
 {
     var acceleration = new Acceleration(1, AccelerationUnit.BaseUnit);
     var angle = new Angle(1, AngleUnit.BaseUnit);
     var angularAcceleration = new AngularAcceleration(1, AngularAccelerationUnit.BaseUnit);
     var area = new Area(1, AreaUnit.BaseUnit);
     var density = new MassDensity(1, MassDensityUnit.BaseUnit);
     var electricCurrent = new ElectricCurrent(1, ElectricCurrentUnit.BaseUnit);
     var electricResistance = new ElectricResistance(1, ElectricResistanceUnit.BaseUnit);
     var electricVoltage = new ElectricPotential(1, ElectricPotentialUnit.BaseUnit);
     var energy = new Energy(1, EnergyUnit.BaseUnit);
     var force = new Force(1, ForceUnit.BaseUnit);
     var frequency = new Frequency(1, FrequencyUnit.BaseUnit);
     var jerk = new Jerk(1, JerkUnit.BaseUnit);
     var length = new Length(1, LengthUnit.BaseUnit);
     var mass = new Mass(1, MassUnit.BaseUnit);
     var massFlowRate = new MassFlowRate(1, MassFlowRateUnit.BaseUnit);
     var momentum = new Momentum(1, MomentumUnit.BaseUnit);
     var numeric = new Numeric(1, NumericUnit.BaseUnit);
     var power = new Power(1, PowerUnit.BaseUnit);
     var pressure = new Pressure(1, PressureUnit.BaseUnit);
     var speed = new Speed(1, SpeedUnit.BaseUnit);
     var temperature = new Temperature(1, TemperatureUnit.BaseUnit);
     var time = new Time(1, TimeUnit.BaseUnit);
     var torque = new Torque(1, TorqueUnit.BaseUnit);
     var volume = new Volume(1, VolumeUnit.BaseUnit);
     var volumetricFlowRate = new VolumetricFlowRate(1, VolumetricFlowRateUnit.BaseUnit);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:28,代码来源:EnumerationVerification.cs

示例10: Result

        public Result(Age a, Sex s, Profession p, Education e, YesNo cit, 
		               List<Technology> tech, Frequency pub, Frequency home,
		               NumPass single, List<PassType> passType, Frequency pChange,
		               YesNo sharePass,YesNo pSecure, YesNo passHome,YesNo pMobile, 
		               YesNo hWifiPass, YesNo hWifiFire, YesNo hVirusSoftware, YesNo softUpdate, 
		               SecureLevel sLevel, SharePersonalInfo postPersonal, Frequency pWifi)
        {
            m_age = a;
            m_sex = s;
            m_profession = p;
            m_education = e;
            m_usCitizen = cit;
            m_technologyList = tech;
            m_publicComputer = pub;
            m_homeComputer = home;
            m_singlePass = single;
            m_passType = passType;
            m_passChangeFreq = pChange;
            m_sharePassword = sharePass;
            m_passSecure = pSecure;
            m_passHomePC = passHome;
            m_passForMobile = pMobile;
            m_homeWifiPass = hWifiPass;
            m_homeWifiFirewall = hWifiFire;
            m_homeVirusSoftware = hVirusSoftware;
            m_softwareUpdates = softUpdate;
            m_securityLevel = sLevel;
            m_postPersonalInfo = postPersonal;
            m_publicWifi = pWifi;
        }
开发者ID:pdg6868,项目名称:SecurityTool,代码行数:30,代码来源:Result.cs

示例11: GetRealDevice

        private IPwmDevice GetRealDevice()
        {
            PwmFrequency = new Frequency(60);
            DeviceAddress = 0x40;

            try
            {
                Log.Info("Creating pins");
                var sdaPin = SdaPin.ToProcessor();
                var sclPin = SclPin.ToProcessor();

                Log.Info("Creating i2cDriver");
                _i2cDriver = new I2cDriver(sdaPin, sclPin);
            }
            catch (Exception e)
            {
                Log.Error("Failed to initialise i2c driver. Did you forget sudo?", e);
            }

            Log.Info("Creating real device...");
            var device = new Pca9685Connection(_i2cDriver.Connect(DeviceAddress));
            Log.Info("Setting frequency...");
            device.SetPwmUpdateRate(PwmFrequency); //                        # Set frequency to 60 Hz


            IsConnected = true;
            return device;
        }
开发者ID:neutmute,项目名称:RPi.Demo,代码行数:28,代码来源:Pca9685DeviceFactory.cs

示例12: Magazine

 public Magazine(string name, Frequency issueFrequency, DateTime issueDate, int circulation)
 {
     _name = name;
     _issueFrequency = issueFrequency;
     _issueDate = issueDate;
     _circulation = circulation;
     _articles = new List<Article>();
 }
开发者ID:university-projects-se-6050103,项目名称:course02lab04oop,代码行数:8,代码来源:Magazine.cs

示例13: FetchConfigurationForClientCommand

 public FetchConfigurationForClientCommand(IntegrationAction action, IntegrationType type, Frequency frequency, Guid contractId, Guid packageId)
 {
     Type = type;
     Action = action;
     Frequency = frequency;
     ContractId = contractId;
     PackageId = packageId;
 }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:8,代码来源:FetchConfiguration.cs

示例14: OpAddition

 public void OpAddition()
 {
     var frequency1 = new Frequency(1, FrequencyUnit.Hertz);
     var frequency2 = new Frequency(1, FrequencyUnit.CyclePerSecond);
     var expected = new Frequency(2, FrequencyUnit.Hertz);
     (frequency1 + frequency2).ShouldEqual(expected);
     (frequency2 + frequency1).ShouldEqual(expected);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:8,代码来源:FrequencyOperators.cs

示例15: Frequency_ToUnit_Then_ResultShouldBeExpected

        public void Frequency_ToUnit_Then_ResultShouldBeExpected(double value, double expected)
        {
            var testee = new Frequency(4, x => x.Mega.Hertz);

            var result = testee.ToUnit(x => x.Hertz);

            result.Should().Be(4000000, "Hz", UnitFormat.Default);
        }
开发者ID:hugener,项目名称:Sundew.Quantities,代码行数:8,代码来源:FrequencyTests.cs


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