26 const Date& referenceDate,
49 std::back_inserter(times));
69 Real strike = 1.0/accrual;
71 values_[j] += nominal*accrual*gearing*
72 std::max<Real>(strike - bond.
values()[j], 0.0);
78 Real strike = 1.0/accrual;
81 values_[j] += nominal*accrual*mult*gearing*
82 std::max<Real>(bond.
values()[j] - strike, 0.0);
100 Rate capletRate = std::max(fixing-cap, 0.0);
101 values_ += capletRate*accrual*nominal*gearing;
106 Rate floorletRate = std::max(floor-fixing, 0.0);
108 values_ += floorletRate*accrual*nominal*gearing;
110 values_ -= floorletRate*accrual*nominal*gearing;
1-D array used in linear algebra.
Size size() const
dimension of the array
Arguments for cap/floor calculation
std::vector< Time > accrualTimes
std::vector< Rate > forwards
std::vector< Date > startDates
std::vector< Real > gearings
std::vector< Rate > floorRates
std::vector< Real > nominals
std::vector< Date > endDates
std::vector< Rate > capRates
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
bool isOnTime(Time t) const
const Array & values() const
const ext::shared_ptr< Lattice > & method() const
void initialize(const ext::shared_ptr< Lattice > &, Time t)
void preAdjustValuesImpl() override
void postAdjustValuesImpl() override
std::vector< Time > endTimes_
std::vector< Time > mandatoryTimes() const override
DiscretizedCapFloor(const CapFloor::arguments &args, const Date &referenceDate, const DayCounter &dayCounter)
std::vector< Time > startTimes_
void reset(Size size) override
CapFloor::arguments arguments_
Useful discretized discount bond asset.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container