Trying to add SWIG for PieceWiseHeston

Posted by Kiwiabove on
URL: http://quantlib.414.s1.nabble.com/Trying-to-add-SWIG-for-PieceWiseHeston-tp402.html

I am trying to add the Piecewise heston model and have the following SWIG code. But the Parameter type isn't currently working can someone give me a hand on this?

%{
using QuantLib::CalibratedModel;
using QuantLib::TimeGrid;
using QuantLib::Parameter;
using QuantLib::PiecewiseTimeDependentHestonModel;
typedef boost::shared_ptr<CalibratedModel> PiecewiseTimeDependentHestonModelPtr;
%}
%rename(PiecewiseTimeDependentHestonModel) PiecewiseTimeDependentHestonModelPtr;
class PiecewiseTimeDependentHestonModelPtr : public boost::shared_ptr<CalibratedModel> {
  public:
    %extend {
        PiecewiseTimeDependentHestonModelPtr(const Handle<YieldTermStructure>& riskFreeTS,
                                           const Handle<YieldTermStructure>& dividendTS,
                                           const Handle<Quote>& s0,
                                           Real v0, const Parameter& theta,
                       const Parameter& kappa, const Parameter& sigma, const Parameter&  rho, const TimeGrid& timeGrid)
                                           {
                                           return new PiecewiseTimeDependentHestonModelPtr(
                        new PiecewiseTimeDependentHestonModel(riskFreeTS, dividendTS, s0, v0,
                                                      theta, kappa, sigma, rho, timeGrid));
                                           }

        }
};