Re: [QuantLib-svn] SF.net SVN: quantlib:[16477] trunk/QuantLib

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[16477] trunk/QuantLib

Luigi Ballabio
On Wed, 2009-09-16 at 14:14 +0000, [hidden email] wrote:
> Revision: 16477
>           http://quantlib.svn.sourceforge.net/quantlib/?rev=16477&view=rev
> Author:   nando
> Date:     2009-09-16 14:14:43 +0000 (Wed, 16 Sep 2009)
>
> Log Message:
> -----------
> switched from vector<InterestRate> to vector<shared_prt<InterestRate> >

Good grief. Why?

Luigi


--

Zawinski's Law:
Every program attempts to expand until it can read mail. Those
programs which cannot so expand are replaced by ones which can.



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[16477] trunk/QuantLib

Piter Dias-4
Luigi/Nando/Eric,

>> Author:   nando
>> Date:     2009-09-16 14:14:43 +0000 (Wed, 16 Sep 2009)
>>
>> Log Message:
>> -----------
>> switched from vector<InterestRate> to vector<shared_prt<InterestRate> >
>
> Good grief. Why?

I believe Nando made this change because QuantLibAddin auto-generated code
expects vector<shared_prt<InterestRate> > instead of vector<InterestRate>.
It was used to implement FixedRateLeg2 function.

Based on latest trunk code, I implemented the FixedRateBond2 function for
QuantLibXL that is able to handle a vector of InterestRate objects and
included also a spreadsheet that matches the QuantLib testsuite (seems to
be a good idea having the same test in both tools).

You can see in the patch that I kept the vector<InterestRate> once it made
mode sense for me making the conversion inside QuantLibAddin. The idea
behind it is making the QuantLib code more stable (change fewer times) than
QuantLibXL (pretty like a third party library).

I hope you find the patch and spreadsheet useful.

Regards,


-------------------------

Piter Dias
[hidden email]
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

ql.patch (29K) Download Attachment
Brazilian Onshore Treasuries.zip (29K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[16477] trunk/QuantLib

Ferdinando Ametrano-4
In reply to this post by Luigi Ballabio
On Wed, Sep 16, 2009 at 4:21 PM, Luigi Ballabio
<[hidden email]> wrote:
>> switched from vector<InterestRate> to vector<shared_prt<InterestRate> >
>
> Good grief. Why?

I was plannig to restore vector<InterestRate> along with
vector<shared_prt<InterestRate> >, but I've seen you already reverted
my changes.
Any objection if I add back vector<shared_prt<InterestRate> > ?

ciao -- Nando

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[16477] trunk/QuantLib

Luigi Ballabio
On Fri, 2009-09-18 at 11:46 +0200, Ferdinando Ametrano wrote:

> On Wed, Sep 16, 2009 at 4:21 PM, Luigi Ballabio
> <[hidden email]> wrote:
> >> switched from vector<InterestRate> to vector<shared_prt<InterestRate> >
> >
> > Good grief. Why?
>
> I was plannig to restore vector<InterestRate> along with
> vector<shared_prt<InterestRate> >, but I've seen you already reverted
> my changes.
> Any objection if I add back vector<shared_prt<InterestRate> > ?

Yes, InterestRate is not polymorphic. It would make as little sense as
vector<shared_ptr<Date> >. I'd rather fix QuantLibAddin so that the
generated code expects the correct type (or, as Piter did, modify the
qla-object constructor so that it performs the conversion.)

Luigi


--

It is better to know some of the questions than all of the answers.
-- James Thurber



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev