/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2007 Ferdinando Ametrano Copyright (C) 2006, 2007 Cristina Duminuco Copyright (C) 2006, 2007 Giorgio Facchinetti Copyright (C) 2006 Mario Pucci Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2003, 2004 StatPro Italia srl This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email . The license is also available online at . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /*! \file cashflowvectors.hpp \brief Cash flow vector builders */ #ifndef quantlib_cash_flow_vectors_hpp #define quantlib_cash_flow_vectors_hpp #include #include #include #include #include namespace QuantLib { //! helper function building a sequence of fixed rate coupons Leg FixedRateLeg(const std::vector& nominals, const Schedule& schedule, const std::vector& couponRates, const DayCounter& paymentDayCounter, BusinessDayConvention paymentAdjustment = Following, const DayCounter& firstPeriodDayCounter = DayCounter()); //! helper function building a sequence of par coupons /*! Either UpFrontIndexedCoupons or ParCoupons are used depending on the library configuration. \todo A suitable algorithm should be implemented for the calculation of the interpolated index fixing for a short/long first coupon. */ //! helper function building a sequence of capped/floored ibor rate coupons Leg IborLeg(const std::vector& nominals, const Schedule& schedule, const boost::shared_ptr& index, const DayCounter& paymentDayCounter = DayCounter(), const BusinessDayConvention paymentConvention = Following, Natural fixingDays = Null(), const std::vector& gearings = std::vector(), const std::vector& spreads = std::vector(), const std::vector& caps = std::vector(), const std::vector& floors = std::vector(), bool isInArrears = false); //! helper function building a sequence of capped/floored cms rate coupons Leg CmsLeg(const std::vector& nominals, const Schedule& schedule, const boost::shared_ptr& index, const DayCounter& paymentDayCounter = DayCounter(), BusinessDayConvention paymentConvention = Following, Natural fixingDays = Null(), const std::vector& gearings = std::vector(), const std::vector& spreads = std::vector(), const std::vector& caps = std::vector(), const std::vector& floors = std::vector(), bool isInArrears = false); //! helper function building a sequence of capped/floored cms zero rate coupons Leg CmsZeroLeg(const std::vector& nominals, const Schedule& schedule, const boost::shared_ptr& index, const DayCounter& paymentDayCounter = DayCounter(), BusinessDayConvention paymentConvention = Following, Natural fixingDays = Null(), const std::vector& gearings = std::vector(), const std::vector& spreads =std::vector(), const std::vector& caps = std::vector(), const std::vector& floors = std::vector()); //! helper function building a sequence of range accrual floaters coupons Leg RangeAccrualLeg(const std::vector& nominals, const Schedule& schedule, const boost::shared_ptr& index, const DayCounter& paymentDayCounter = DayCounter(), BusinessDayConvention paymentConvention = Following, Natural fixingDays = Null(), const std::vector& gearings = std::vector(), const std::vector& spreads =std::vector(), const std::vector& lowerTriggers = std::vector(), const std::vector& upperTriggers = std::vector(), const Period& observationTenor = 1*Days, BusinessDayConvention observationConvention = ModifiedFollowing); } #endif