Dear members,
I'm trying to include in quantlibXL a kind of StochasticProcessArray (as a first step to price basket options). My idea is to create a function accepting a vector of references to cells containing each one a GeneralizedBlackScholesProcess and a correlation matrix. I get the following error in VC++ raised into source Processes.cpp 'QuantLib::StochasticProcessArray::StochasticProcessArray(const std::vector<_Ty> &,const QuantLib::Matrix &)' : cannot convert parameter 1 from 'const std::vector<_Ty>' to 'const std::vector<_Ty> &' Below is my code. Could anyone give me an insight to fix the error, or if there is already a way to price basket options in qlXL? Many thanks for any help! Paolo // ======================== processes.xml ================================ <Constructor name='qlStochasticProcessArray'> <libraryFunction>StochasticProcessArray</libraryFunction> <SupportedPlatforms> <SupportedPlatform name='Excel'/> </SupportedPlatforms> <ParameterList> <Parameters> <Parameter name='Processes'> <superType>underlyingClass</superType> <type>QuantLib::GeneralizedBlackScholesProcess</type> <tensorRank>vector</tensorRank> <description>Set of Stochastic Processes</description> </Parameter> <Parameter name='CorrelMatrix'> <type>QuantLib::Matrix</type> <tensorRank>matrix</tensorRank> <description>Correlation matrix</description> </Parameter> </Parameters> </ParameterList> </Constructor> // ======================== Processes.hpp ================================ class StochasticProcessArray : public ObjectHandler::LibraryObject<QuantLib::StochasticProcessArray> { public: StochasticProcessArray( const boost::shared_ptr<ObjectHandler::ValueObject>& properties, const std::vector<boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess> >& processes, const QuantLib::Matrix& correlation, bool permanent); }; // ======================== Processes.cpp ================================ StochasticProcessArray::StochasticProcessArray( const boost::shared_ptr<ObjectHandler::ValueObject>& properties, const std::vector<boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess> >& processes, const QuantLib::Matrix& correlation, bool permanent) : ObjectHandler::LibraryObject<QuantLib::StochasticProcessArray>(properties, permanent) { //Error here libraryObject_ = boost::shared_ptr<QuantLib::StochasticProcessArray> ( new QuantLib::StochasticProcessArray( processes, correlation )); } ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |