[QuantLibAddin-cvs] QuantLibAddin/qlo index.cpp, 1.1, 1.2 index.hpp, 1.1, 1.2
Brought to you by:
ericehlers,
nando
|
From: Katiuscia M. <kma...@us...> - 2006-07-14 10:21:13
|
Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13976/qlo Modified Files: index.cpp index.hpp Log Message: replaced Index class member function addFixings with utility function Index: index.cpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/index.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.cpp 22 Jun 2006 10:18:49 -0000 1.1 --- index.cpp 14 Jul 2006 10:20:34 -0000 1.2 *************** *** 25,39 **** #include <qlo/typefactory.hpp> #include <ql/Indexes/indexmanager.hpp> - #include <ql/Indexes/xibor.hpp> namespace QuantLibAddin { ! void Index::addFixings(const std::vector<QuantLib::Date> dates, ! const std::vector<QuantLib::Rate> fixings) ! { QL_REQUIRE(fixings.size() == dates.size(), "Index::addFixings the nuber of given dates does not " "match the number of fixings!"); ! libraryObject_->addFixings(dates.begin(), dates.end(), fixings.begin()); } --- 25,50 ---- #include <qlo/typefactory.hpp> #include <ql/Indexes/indexmanager.hpp> namespace QuantLibAddin { ! //void Index::addFixings(const std::vector<QuantLib::Date> dates, ! // const std::vector<QuantLib::Rate> fixings) ! //{ ! // QL_REQUIRE(fixings.size() == dates.size(), ! // "Index::addFixings the nuber of given dates does not " ! // "match the number of fixings!"); ! // libraryObject_->addFixings(dates.begin(), dates.end(), ! // fixings.begin()); ! //} ! ! void addFixings(const boost::shared_ptr<QuantLib::Xibor>& xibor, ! const std::vector<QuantLib::Date> dates, ! const std::vector<QuantLib::Rate> fixings) { ! QL_REQUIRE(xibor, ! "Index::addFixings cannot be called on a null object"); QL_REQUIRE(fixings.size() == dates.size(), "Index::addFixings the nuber of given dates does not " "match the number of fixings!"); ! xibor->addFixings(dates.begin(), dates.end(), fixings.begin()); } Index: index.hpp =================================================================== RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/index.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.hpp 22 Jun 2006 10:18:49 -0000 1.1 --- index.hpp 14 Jul 2006 10:20:34 -0000 1.2 *************** *** 25,37 **** #include <ql/handle.hpp> #include <ql/yieldtermstructure.hpp> namespace QuantLibAddin { class Index : public ObjHandler::LibraryObject<QuantLib::Index> { ! public: ! void addFixings(const std::vector<QuantLib::Date> dates, ! const std::vector<QuantLib::Rate> fixings); }; class Xibor : public Index { --- 25,42 ---- #include <ql/handle.hpp> #include <ql/yieldtermstructure.hpp> + #include <ql/Indexes/xibor.hpp> namespace QuantLibAddin { class Index : public ObjHandler::LibraryObject<QuantLib::Index> { ! //public: ! // void addFixings(const std::vector<QuantLib::Date> dates, ! // const std::vector<QuantLib::Rate> fixings); }; + //this is a utility function, not an Index Class member function + void addFixings(const boost::shared_ptr<QuantLib::Xibor>&, + const std::vector<QuantLib::Date> dates, + const std::vector<QuantLib::Rate> fixings); class Xibor : public Index { |