Пример #1
0
 public override void addTimesTo( List<double> times )
 {
     calculate();
     CapFloor.Arguments args = new CapFloor.Arguments();
     cap_.setupArguments( args );
     List<double> capTimes = new DiscretizedCapFloor( args,
                                     termStructure_.link.referenceDate(),
                                     termStructure_.link.dayCounter() ).mandatoryTimes();
     for ( int i = 0; i < capTimes.Count; i++ )
         times.Insert( times.Count, capTimes[i] );
 }
Пример #2
0
        public DiscretizedCapFloor(CapFloor.Arguments args,
            Date referenceDate,
            DayCounter dayCounter)
        {
            arguments_ = args;

              startTimes_= new InitializedList<double>(args.startDates.Count);
              for (int i = 0; i < startTimes_.Count; ++i)
              startTimes_[i] = dayCounter.yearFraction(referenceDate,
                                                       args.startDates[i]);

              endTimes_ = new InitializedList<double>(args.endDates.Count);
              for (int i = 0; i < endTimes_.Count; ++i)
              endTimes_[i] = dayCounter.yearFraction(referenceDate,
                                                     args.endDates[i]);
        }