Luigi,
I got this to work (I was doing something wrong), so that's great because I know going forward I can add missing interfaces! Predictably, I am now stuck at the next step... The CallableFixedRateBond C# constructor expects a SWIGTYPE_p_CallabilitySchedule type, but that seemed wrong, so I changed it to use a CallabilitySchedule which seems to work. To create a CallabilitySchedule I need to pass a Callability instance and that's where I get stuck. Although I can declare a Callability variable: Callability callability; //Works I don't have access to the constructor: Callability callability = new Callability(); //The type 'QuantLib.Callability' has no constructors defined Am I on the right track ? Can you shed some light, please ? Thank you, Simon |
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about the syntax for accessing static class members, so correct things like Callability.Call if I'm writing them wrong; but does something like the following work? CallabilityPrice price = new CallabilityPrice(100.0, CallabilityPrice.Type.Clean); Callability callability = new Callability(price, Callability.Call, Date(25, Month.December, 2016)); Also, it's strange that you should have to change the types in the bond constructor. But I guess that's a problem for another time. Later, Luigi On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote: > Luigi, > > I got this to work (I was doing something wrong), so that's great because I > know going forward I can add missing interfaces! > > Predictably, I am now stuck at the next step... The CallableFixedRateBond C# > constructor expects a SWIGTYPE_p_CallabilitySchedule type, but that seemed > wrong, so I changed it to use a CallabilitySchedule which seems to work. > > To create a CallabilitySchedule I need to pass a Callability instance and > that's where I get stuck. > > Although I can declare a Callability variable: > Callability callability; //Works > > I don't have access to the constructor: > Callability callability = new Callability(); //The type > 'QuantLib.Callability' has no constructors defined > > Am I on the right track ? Can you shed some light, please ? > > Thank you, > Simon > > > > -- > View this message in context: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14761.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users -- <https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib] [mailto:ml-node+[hidden email]]
The constructor should be defined (it is in my copy of the generated
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> Callability.cs (3K) Download Attachment |
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote:
<https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users Callability.cs (3K) Download Attachment |
Luigi, There was no attachment. I am using SWIG 2.0.11. Thank you, Simon
From: Luigi Ballabio [via QuantLib] [mailto:ml-node+[hidden email]]
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote: Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about
On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote:
>
[hidden email] ------------------------------------------------------------------------------
[hidden email]
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
Sent from the
quantlib-users mailing list archive at Nabble.com.
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14779.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> |
Strange, I see the attachment in my copy of the mail. Anyway, here it is again. On Fri, Dec 27, 2013 at 4:27 PM, smazzucca <[hidden email]> wrote:
<https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users Callability.cs (4K) Download Attachment |
I see what happened, I get two emails one from you and one from the forum. One had it and one didn’t. Thanks! I’ll let you know what I find. Simon From: Luigi Ballabio [via QuantLib] [mailto:ml-node+[hidden email]]
Strange, I see the attachment in my copy of the mail. Anyway, here it is again. On Fri, Dec 27, 2013 at 4:27 PM, smazzucca <[hidden email]> wrote: Luigi, There was no attachment. I am using SWIG 2.0.11. Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote: Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Tuesday, December 24, 2013 6:02 AM
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about
On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote:
>
[hidden email]
------------------------------------------------------------------------------
[hidden email]
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
Sent from the
quantlib-users mailing list archive at Nabble.com.
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14779.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14782.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> |
In reply to this post by Luigi Ballabio
Luigi, Sure enough you have this, that I don’t have:
public Callability(CallabilityPrice
price, _Callability.Type
type, Date date) :
this(NQuantLibcPINVOKE.new_Callability(CallabilityPrice.getCPtr(price),
(int)type,
Date.getCPtr(date)),
true) {
if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
throw
NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } Unfortunately it does not compile for me as I don’t have: NQuantLibcPINVOKE.new_Callability. Could I have your NQuantLibcPINVOKE file ? Thank you, Simon
From: Simon Mazzucca
I see what happened, I get two emails one from you and one from the forum. One had it and one didn’t. Thanks! I’ll let you know what I find. Simon From: Luigi Ballabio [via QuantLib] [[hidden email]]
Strange, I see the attachment in my copy of the mail. Anyway, here it is again. On Fri, Dec 27, 2013 at 4:27 PM, smazzucca <[hidden email]> wrote: Luigi, There was no attachment. I am using SWIG 2.0.11. Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote: Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Tuesday, December 24, 2013 6:02 AM
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about
On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote:
>
[hidden email]
------------------------------------------------------------------------------
[hidden email]
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
Sent from the
quantlib-users mailing list archive at Nabble.com.
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14779.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14782.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> |
The problem is that you should be able to generate the same file as me. How are you invoking SWIG exactly? On Mon, Dec 30, 2013 at 4:02 PM, smazzucca <[hidden email]> wrote:
<https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Luigi, The command I execute is: call "C:\Program Files\swigwin-2.0.11\swig.exe" -csharp -c++ -outdir csharp -namespace QuantLib -o cpp\quantlib_wrap.cpp ..\SWIG\quantlib.i I attached my interface files. I know I changed the bonds one. I don’t think I changed other ones, but that was a few weeks ago, I’m not 100% sure, sorry. Thank you, Simon
From: Luigi Ballabio [via QuantLib] [mailto:ml-node+[hidden email]]
The problem is that you should be able to generate the same file as me. How are you invoking SWIG exactly? On Mon, Dec 30, 2013 at 4:02 PM, smazzucca <[hidden email]> wrote: Luigi, Sure enough you have this, that I don’t have:
public Callability(CallabilityPrice price,
_Callability.Type type,
Date date)
:
this(NQuantLibcPINVOKE.new_Callability(CallabilityPrice.getCPtr(price), (int)type,
Date.getCPtr(date)),
true)
{
if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } Unfortunately it does not compile for me as I don’t have: NQuantLibcPINVOKE.new_Callability. Could
I have your NQuantLibcPINVOKE file ? Thank you, Simon
From: Simon Mazzucca
I see what happened, I get two emails one from you and one from the forum. One had it and one didn’t. Thanks! I’ll let you know what I find. Simon From: Luigi Ballabio [via QuantLib]
[[hidden email]]
Strange, I see the attachment in my copy of the mail. Anyway, here it is again. On Fri, Dec 27, 2013 at 4:27 PM, smazzucca <[hidden email]> wrote: Luigi, There was no attachment. I am using SWIG 2.0.11. Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Friday, December 27, 2013 4:38 AM
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote: Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Tuesday, December 24, 2013 6:02 AM
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about
On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote:
>
[hidden email]
------------------------------------------------------------------------------
[hidden email]
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
Sent from the
quantlib-users mailing list archive at Nabble.com.
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14779.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14782.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14786.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> SWIG interface files.zip (145K) Download Attachment |
Ok, I see. You need a fix for the latest SWIG that still hasn't made its way into a release. Use callability.i from <https://github.com/lballabio/quantlib/blob/master/QuantLib-SWIG/SWIG/callability.i> instead. Luigi On Mon, Dec 30, 2013 at 4:39 PM, smazzucca <[hidden email]> wrote:
<https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Awesome! That worked like a charm. When the analyst comes back, she will help me figure out which params to pass the constructor but it all builds beautifully now. Thanks so much and buon anno!
J Simon From: Luigi Ballabio [via QuantLib] [mailto:ml-node+[hidden email]]
Ok, I see. You need a fix for the latest SWIG that still hasn't made its way into a release. Use callability.i from <https://github.com/lballabio/quantlib/blob/master/QuantLib-SWIG/SWIG/callability.i>
instead. Luigi On Mon, Dec 30, 2013 at 4:39 PM, smazzucca <[hidden email]> wrote: Luigi, The command I execute is: call "C:\Program Files\swigwin-2.0.11\swig.exe" -csharp -c++ -outdir csharp -namespace QuantLib -o cpp\quantlib_wrap.cpp
..\SWIG\quantlib.i I attached my interface files. I know I changed the bonds one. I don’t think I changed other ones,
but that was a few weeks ago, I’m not 100% sure, sorry. Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
The problem is that you should be able to generate the same file as me. How are you invoking SWIG exactly? On Mon, Dec 30, 2013 at 4:02 PM, smazzucca <[hidden email]> wrote: Luigi, Sure enough you have this, that I don’t have:
public Callability(CallabilityPrice price,
_Callability.Type type,
Date date)
:
this(NQuantLibcPINVOKE.new_Callability(CallabilityPrice.getCPtr(price), (int)type,
Date.getCPtr(date)),
true)
{
if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } Unfortunately it does not compile for me as I don’t have: NQuantLibcPINVOKE.new_Callability. Could
I have your NQuantLibcPINVOKE file ? Thank you, Simon
From: Simon Mazzucca
I see what happened, I get two emails one from you and one from the forum. One had it and one didn’t. Thanks! I’ll let you know what I find. Simon From: Luigi Ballabio [via QuantLib]
[[hidden email]]
Strange, I see the attachment in my copy of the mail. Anyway, here it is again. On Fri, Dec 27, 2013 at 4:27 PM, smazzucca <[hidden email]> wrote: Luigi, There was no attachment. I am using SWIG 2.0.11. Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Friday, December 27, 2013 4:38 AM
Here it is. By the way, what version of SWIG are you using? Luigi On Tue, Dec 24, 2013 at 4:06 PM, smazzucca <[hidden email]> wrote: Luigi, I definitely don’t have a constructor (see attachment). Can I see your copy of Callability.cs ? Thank you, Simon
From: Luigi Ballabio [via QuantLib]
[mailto:[hidden email][hidden email]]
Sent: Tuesday, December 24, 2013 6:02 AM
The constructor should be defined (it is in my copy of the generated
Callability.cs), and should take three arguments. I'm not sure about
On Thu, Dec 19, 2013 at 8:38 PM, smazzucca <[hidden email]> wrote:
>
[hidden email]
------------------------------------------------------------------------------
[hidden email]
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14774.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
Sent from the
quantlib-users mailing list archive at Nabble.com.
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14779.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14782.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14786.html
To unsubscribe from Adding functions to QuantLib SWIG, click here.
View this message in context:
RE: Adding functions to QuantLib SWIG
--
If you reply to this email, your message will be added to the discussion below: http://quantlib.10058.n7.nabble.com/Adding-functions-to-QuantLib-SWIG-tp6140p14788.html
To unsubscribe from Adding functions to QuantLib SWIG,
click here. >>>>>>> |
Free forum by Nabble | Edit this page |