Login  Register

G2Process in QuantLib-Swig

Posted by André de Boer on Nov 17, 2015; 3:02pm
URL: http://quantlib.414.s1.nabble.com/G2Process-in-QuantLib-Swig-tp17096.html

Hello All,

In the header file  StochasticProcess.hpp  in the class
StochasticProcess there is an method:

virtual Disposable<Array> evolve(Time t0, const Array& x0, Time dt,
const Array& dw)

that I need in python, so I can do:

ir = g2Process->evolve(t, ir, dt, dz).

But in the file  stochasticprocess.i  I only see:

%{
using QuantLib::StochasticProcess;
%}
%ignore StochasticProcess;
class StochasticProcess {};
%template(StochasticProcess) boost::shared_ptr<StochasticProcess>;
IsObservable(boost::shared_ptr<StochasticProcess>);

How can I add this method  'evolve'   to this class StochasticProcess?
I have already added G2Process to the file stochasticprocess.i :

%{
using QuantLib::G2Process;
typedef boost::shared_ptr<StochasticProcess> G2ProcessPtr;
%}

%rename(G2Process) G2ProcessPtr;
class G2ProcessPtr : public boost::shared_ptr<StochasticProcess> {
  public:
    %extend {
       G2ProcessPtr(Real a, Real sigma, Real b, Real eta, Real rho) {
            return new G2ProcessPtr(new G2Process(a, sigma, b, eta, rho));
       }
    }
};


Kind regards,
André de Boer

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users