Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16967/qlo
Modified Files:
couponvectors.cpp couponvectors.hpp
Added Files:
simplecashflow.hpp
Log Message:
Added classes SimpleCashFlow and SimpleCashFlowVector.
Index: couponvectors.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/couponvectors.hpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** couponvectors.hpp 11 Oct 2006 17:09:17 -0000 1.25
--- couponvectors.hpp 12 Oct 2006 10:51:30 -0000 1.26
***************
*** 53,56 ****
--- 53,62 ----
SimpleCashFlow(double amount, const QuantLib::Date& date);
};
+
+ class SimpleCashFlowVector : public LegWrapper {
+ public:
+ SimpleCashFlowVector(const std::vector<double> amounts,
+ const std::vector<QuantLib::Date>& dates);
+ };
class FixedRateCouponVector : public LegWrapper {
Index: couponvectors.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/couponvectors.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** couponvectors.cpp 11 Oct 2006 17:09:17 -0000 1.35
--- couponvectors.cpp 12 Oct 2006 10:51:30 -0000 1.36
***************
*** 157,160 ****
--- 157,169 ----
}
+ SimpleCashFlowVector::SimpleCashFlowVector(const std::vector<double> amounts,
+ const std::vector<QuantLib::Date>& dates)
+ {
+ for (QuantLib::Size i=0; i < amounts.size(); i++) {
+ cashFlowVector_.push_back(boost::shared_ptr<QuantLib::CashFlow>(
+ new QuantLib::SimpleCashFlow(amounts[i],dates[i])));
+ }
+ }
+
FixedRateCouponVector::FixedRateCouponVector(
const boost::shared_ptr<QuantLib::Schedule>& schedule,
--- NEW FILE: simplecashflow.hpp ---
/*
Copyright (C) 2006 Cristina Duminuco
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 qua...@li...
The license is also available online at http://quantlib.org/html/license.html
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.
*/
#ifndef qla_simplecashflow_hpp
#define qla_simplecashflow_hpp
#include <qlo/couponvectors.hpp>
#endif
|