Posted by
Henner Heck on
Nov 23, 2010; 5:57pm
URL: http://quantlib.414.s1.nabble.com/Accessing-the-FixedRateCoupons-and-IborCoupons-of-a-Swap-from-Java-tp6384.html
Hello all,
after evaluating a VanillaSwap i have access to
the contents of the legs in form of CashFlows.
Actually the fixed leg consists of FixedRateCoupons
and the floating leg consists of IborCoupons,
which both inherit from CashFlow.
I want to gain access to the functions available
in addition to CashFlow.
In C++ one would apply a
"boost::dynamic_pointer_cast<FixedRateCoupon>"
or
"boost::dynamic_pointer_cast<IborCoupon>"
to the CashFlows. Casting the Java object doesn't work,
and trying to abuse the Swig pointer of the CashFlow to
create e.g. an IborCoupon with
"IborCoupon ic = new IborCoupon(CashFlow.getCPtr(cashflow), true);"
actually works, but at some point the whole JVM crashes
with a fatal error:
"# The crash happened outside the Java Virtual Machine in native code."
I suspect that my dual use of the pointer out of Java leads to problems
when collecting the garbage.
Could someone point me in the right direction?
Best regards,
Henner Heck
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users