Expose a QuantLib class method to QuantLibAddin

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

Expose a QuantLib class method to QuantLibAddin

g m-10
Hi,
What is the key stages to expose a quantLib class method to QuantlibAddin ?
Unfortunately in the Stock class used in the tutorial here => http://quantlib.org/quantlibaddin//extend_tutorial.html there is no class method.
Many thanks.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

Don Stewart-3
Hi there,
For the purpose of the discussion below I'm using Microsoft Visual C++
with the QuantLibXL__full_vc9 solution containing the QuantLibXLStatic
project. The overview of exposing a method is:-
 
1 - In qlgensrc, add a <Member> element to the objects .xml file.
2 - Rebuild qlgensrc project which auto generates/updates the necessary
files in QuantLibObjects and QuantLibXLStatic projects.
3 - Build the QuantLibObjects and QuantLibXLStatic (or rebuild the
solution).

As an example, lets say we wanted to expose the
QuantLib::CapFloor::capRates() method (its already exposed so take a
look at the files mentioned).

1 - Add to \QuantLibAddin\gensrc\metadata\functions\capfloor.xml the
element
 <Member name='qlCapFloorCapRates' type='QuantLib::CapFloor'>
   <description>Returns the cap rates for the given CapFloor
object.</description>
   <libraryFunction>capRates</libraryFunction>
   <SupportedPlatforms>
     <SupportedPlatform name='Excel'/>
    </SupportedPlatforms>
    <ParameterList>
      <Parameters/>
    </ParameterList>
    <ReturnValue>
      <type>QuantLib::Rate</type>
      <tensorRank>vector</tensorRank>
    </ReturnValue>
 </Member>

2 - Rebuild the qlgensrc project which updates
\QuantLibXL\qlxl/register/register_capfloor.cpp
\QuantLibXL\qlxl/functions/capfloor.cpp
\QuantLibXL\qlxl/functions/functioncount.hpp
\QuantLibAddin\Docs\auto.pages/volatility.docs
\QuantLibAddin\Docs\auto.pages/capfloor.doc

3 - Build QuantLibXLStatic
In this example no files were change in QuantLibObjects so there was no
need to build that project. If you are unsure then build the solution
and it will determine what projects need building.

Some things to keep in mind.
If your exposing activity results in qlgensrc creating files, make sure
you include those created files in their projects otherwise you will get
a link error.

If the method you are exposing requires any processing of what is
returned by the underlying QuantLib method call then add this processing
to \QuantLibAddin\qlo\xxx.cpp,hpp. For an example see qlBondDescription
in \QuantLibAddin\gensrc\metadata\functions\bond.xml and associated
description() method in \QuantLibAddin\qlo\bond.cpp,hpp

If you get compilation errors in QuantLibObjects/QuantLibXLStatic or
link errors in QuantLibXLStatic  which you can't explain then I've found
the cause usually to be missing <include></include> file(s) in
\QuantLibAddin\gensrc\metadata\functions\xxx.xml.



>From a previous post (I didn't record which one) Andrew Downes sent the
attached documents which may be of some help when you get to a more
advance stage.

Regards Don Stewart
[hidden email]


________________________________

From: g m [mailto:[hidden email]]
Sent: 29 June 2011 12:51
To: [hidden email]
Subject: [Quantlib-users] Expose a QuantLib class method to
QuantLibAddin


Hi,
What is the key stages to expose a quantLib class method to
QuantlibAddin ?
Unfortunately in the Stock class used in the tutorial here =>
http://quantlib.org/quantlibaddin//extend_tutorial.html there is no
class method.
Many thanks.




This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify [hidden email] immediately and delete the email from your computer.

The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards.
This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from

The Financial Services Authority (FSA)
25 The North Colonnade,
Canary Wharf,
London
E14 5HS
United Kingdom

Registered as a Limited Company in England and Wales No.1920623.
Registered Office as above

Switchboard: 020 7066 1000
Web Site: http://www.fsa.gov.uk
*****************************************************************


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

AndrewDownesExposeAdditionalQuantLibEnumerationsToQuantLibXL20101208.pdf (40K) Download Attachment
AndrewDownesExposeAdditionalQuantLibTemplateClassesToQuantLibXL20101208.pdf (188K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

Luigi Ballabio

Don,
        thanks for the info, which are useful in their own right, but I think
gm was asking for static methods (at least, I think that's what he meant
by "class method").  The gist is the same, but for the details you can
have a look at <QuantLibAddin/gensrc/metadata/functions/date.xml> which
exposes a few static methods of class Date (e.g., maxDate or isLeap.)

Luigi


On Wed, 2011-06-29 at 14:05 +0100, Don Stewart wrote:

> Hi there,
> For the purpose of the discussion below I'm using Microsoft Visual C++
> with the QuantLibXL__full_vc9 solution containing the QuantLibXLStatic
> project. The overview of exposing a method is:-
>  
> 1 - In qlgensrc, add a <Member> element to the objects .xml file.
> 2 - Rebuild qlgensrc project which auto generates/updates the necessary
> files in QuantLibObjects and QuantLibXLStatic projects.
> 3 - Build the QuantLibObjects and QuantLibXLStatic (or rebuild the
> solution).
>
> As an example, lets say we wanted to expose the
> QuantLib::CapFloor::capRates() method (its already exposed so take a
> look at the files mentioned).
>
> 1 - Add to \QuantLibAddin\gensrc\metadata\functions\capfloor.xml the
> element
>  <Member name='qlCapFloorCapRates' type='QuantLib::CapFloor'>
>    <description>Returns the cap rates for the given CapFloor
> object.</description>
>    <libraryFunction>capRates</libraryFunction>
>    <SupportedPlatforms>
>      <SupportedPlatform name='Excel'/>
>     </SupportedPlatforms>
>     <ParameterList>
>       <Parameters/>
>     </ParameterList>
>     <ReturnValue>
>       <type>QuantLib::Rate</type>
>       <tensorRank>vector</tensorRank>
>     </ReturnValue>
>  </Member>
>
> 2 - Rebuild the qlgensrc project which updates
> \QuantLibXL\qlxl/register/register_capfloor.cpp
> \QuantLibXL\qlxl/functions/capfloor.cpp
> \QuantLibXL\qlxl/functions/functioncount.hpp
> \QuantLibAddin\Docs\auto.pages/volatility.docs
> \QuantLibAddin\Docs\auto.pages/capfloor.doc
>
> 3 - Build QuantLibXLStatic
> In this example no files were change in QuantLibObjects so there was no
> need to build that project. If you are unsure then build the solution
> and it will determine what projects need building.
>
> Some things to keep in mind.
> If your exposing activity results in qlgensrc creating files, make sure
> you include those created files in their projects otherwise you will get
> a link error.
>
> If the method you are exposing requires any processing of what is
> returned by the underlying QuantLib method call then add this processing
> to \QuantLibAddin\qlo\xxx.cpp,hpp. For an example see qlBondDescription
> in \QuantLibAddin\gensrc\metadata\functions\bond.xml and associated
> description() method in \QuantLibAddin\qlo\bond.cpp,hpp
>
> If you get compilation errors in QuantLibObjects/QuantLibXLStatic or
> link errors in QuantLibXLStatic  which you can't explain then I've found
> the cause usually to be missing <include></include> file(s) in
> \QuantLibAddin\gensrc\metadata\functions\xxx.xml.
>
>
>
> >From a previous post (I didn't record which one) Andrew Downes sent the
> attached documents which may be of some help when you get to a more
> advance stage.
>
> Regards Don Stewart
> [hidden email]
>
>
> ________________________________
>
> From: g m [mailto:[hidden email]]
> Sent: 29 June 2011 12:51
> To: [hidden email]
> Subject: [Quantlib-users] Expose a QuantLib class method to
> QuantLibAddin
>
>
> Hi,
> What is the key stages to expose a quantLib class method to
> QuantlibAddin ?
> Unfortunately in the Stock class used in the tutorial here =>
> http://quantlib.org/quantlibaddin//extend_tutorial.html there is no
> class method.
> Many thanks.
>
>
>
>
> This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify [hidden email] immediately and delete the email from your computer.
>
> The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards.
> This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from
>
> The Financial Services Authority (FSA)
> 25 The North Colonnade,
> Canary Wharf,
> London
> E14 5HS
> United Kingdom
>
> Registered as a Limited Company in England and Wales No.1920623.
> Registered Office as above
>
> Switchboard: 020 7066 1000
> Web Site: http://www.fsa.gov.uk
> *****************************************************************
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users

--

Just remember what ol' Jack Burton does when the earth quakes, the
poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
Jack Burton just looks that big old storm right in the eye and says,
"Give me your best shot. I can take it."
-- Jack Burton, "Big trouble in Little China"



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

g m-10
Hi,
Thank you Don and Luigi.
I'm Actually trying to expose the LocalVolSurface class, I need to use its localVolImpl(Time, Real) method.
my understanding is that I have to write Constructor and Method descriptions in a xml file (I chose volatilities.xml file),
compile the qlgensrc project, then, write a representation of QuantLib::LocalVolSurface class in the QuantLibObjects project
(in volatilities.hpp and volatilities.cpp) to have something like QuantLibAddin::LocalVolSurface. Is that right?
The other issue is that the LocalVolSurface::localVolImpl is a protected method and I've got compilation errors because of that.
How can I expose such method to Excel?
Thanks a lot for your help.
 
> Subject: Re: [Quantlib-users] Expose a QuantLib class method to QuantLibAddin

> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]; [hidden email]
> Date: Wed, 29 Jun 2011 16:40:28 +0200
>
>
> Don,
> thanks for the info, which are useful in their own right, but I think
> gm was asking for static methods (at least, I think that's what he meant
> by "class method"). The gist is the same, but for the details you can
> have a look at <QuantLibAddin/gensrc/metadata/functions/date.xml> which
> exposes a few static methods of class Date (e.g., maxDate or isLeap.)
>
> Luigi
>
>
> On Wed, 2011-06-29 at 14:05 +0100, Don Stewart wrote:
> > Hi there,
> > For the purpose of the discussion below I'm using Microsoft Visual C++
> > with the QuantLibXL__full_vc9 solution containing the QuantLibXLStatic
> > project. The overview of exposing a method is:-
> >
> > 1 - In qlgensrc, add a <Member> element to the objects .xml file.
> > 2 - Rebuild qlgensrc project which auto generates/updates the necessary
> > files in QuantLibObjects and QuantLibXLStatic projects.
> > 3 - Build the QuantLibObjects and QuantLibXLStatic (or rebuild the
> > solution).
> >
> > As an example, lets say we wanted to expose the
> > QuantLib::CapFloor::capRates() method (its already exposed so take a
> > look at the files mentioned).
> >
> > 1 - Add to \QuantLibAddin\gensrc\metadata\functions\capfloor.xml the
> > element
> > <Member name='qlCapFloorCapRates' type='QuantLib::CapFloor'>
> > <description>Returns the cap rates for the given CapFloor
> > object.</description>
> > <libraryFunction>capRates</libraryFunction>
> > <SupportedPlatforms>
> > <SupportedPlatform name='Excel'/>
> > </SupportedPlatforms>
> > <ParameterList>
> > <Parameters/>
> > </ParameterList>
> > <ReturnValue>
> > <type>QuantLib::Rate</type>
> > <tensorRank>vector</tensorRank>
> > </ReturnValue>
> > </Member>
> >
> > 2 - Rebuild the qlgensrc project which updates
> > \QuantLibXL\qlxl/register/register_capfloor.cpp
> > \QuantLibXL\qlxl/functions/capfloor.cpp
> > \QuantLibXL\qlxl/functions/functioncount.hpp
> > \QuantLibAddin\Docs\auto.pages/volatility.docs
> > \QuantLibAddin\Docs\auto.pages/capfloor.doc
> >
> > 3 - Build QuantLibXLStatic
> > In this example no files were change in QuantLibObjects so there was no
> > need to build that project. If you are unsure then build the solution
> > and it will determine what projects need building.
> >
> > Some things to keep in mind.
> > If your exposing activity results in qlgensrc creating files, make sure
> > you include those created files in their projects otherwise you will get
> > a link error.
> >
> > If the method you are exposing requires any processing of what is
> > returned by the underlying QuantLib method call then add this processing
> > to \QuantLibAddin\qlo\xxx.cpp,hpp. For an example see qlBondDescription
> > in \QuantLibAddin\gensrc\metadata\functions\bond.xml and associated
> > description() method in \QuantLibAddin\qlo\bond.cpp,hpp
> >
> > If you get compilation errors in QuantLibObjects/QuantLibXLStatic or
> > link errors in QuantLibXLStatic which you can't explain then I've found
> > the cause usually to be missing <include></include> file(s) in
> > \QuantLibAddin\gensrc\metadata\functions\xxx.xml.
> >
> >
> >
> > >From a previous post (I didn't record which one) Andrew Downes sent the
> > attached documents which may be of some help when you get to a more
> > advance stage.
> >
> > Regards Don Stewart
> > [hidden email]
> >
> >
> > ________________________________
> >
> > From: g m [mailto:[hidden email]]
> > Sent: 29 June 2011 12:51
> > To: [hidden email]
> > Subject: [Quantlib-users] Expose a QuantLib class method to
> > QuantLibAddin
> >
> >
> > Hi,
> > What is the key stages to expose a quantLib class method to
> > QuantlibAddin ?
> > Unfortunately in the Stock class used in the tutorial here =>
> > http://quantlib.org/quantlibaddin//extend_tutorial.html there is no
> > class method.
> > Many thanks.
> >
> >
> >
> >
> > This communication and any attachments contains information which is confidential and may be subject to legal privilege. It is for intended recipients only. If you are not the intended recipient you must not copy, distribute, publish, rely on or otherwise use it without our consent. Some of our communications may contain confidential information which it could be a criminal offence for you to disclose or use without authority. If you have received this email in error please notify [hidden email] immediately and delete the email from your computer.
> >
> > The FSA reserves the right to monitor all email communications for compliance with legal, regulatory and professional standards.
> > This email is not intended to nor should it be taken to create any legal relations or contractual relationships. This email has originated from
> >
> > The Financial Services Authority (FSA)
> > 25 The North Colonnade,
> > Canary Wharf,
> > London
> > E14 5HS
> > United Kingdom
> >
> > Registered as a Limited Company in England and Wales No.1920623.
> > Registered Office as above
> >
> > Switchboard: 020 7066 1000
> > Web Site: http://www.fsa.gov.uk
> > *****************************************************************
> >
> > ------------------------------------------------------------------------------
> > All of the data generated in your IT infrastructure is seriously valuable.
> > Why? It contains a definitive record of application performance, security
> > threats, fraudulent activity, and more. Splunk takes this data and makes
> > sense of it. IT sense. And common sense.
> > http://p.sf.net/sfu/splunk-d2d-c2
> > _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
> --
>
> Just remember what ol' Jack Burton does when the earth quakes, the
> poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
> Jack Burton just looks that big old storm right in the eye and says,
> "Give me your best shot. I can take it."
> -- Jack Burton, "Big trouble in Little China"
>
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

Luigi Ballabio

On Thu, 2011-06-30 at 11:54 +0200, g m wrote:
> I'm Actually trying to expose the LocalVolSurface class, I need to use
> its localVolImpl(Time, Real) method.
> my understanding is that I have to write Constructor and Method
> descriptions in a xml file (I chose volatilities.xml file),
> compile the qlgensrc project, then, write a representation of
> QuantLib::LocalVolSurface class in the QuantLibObjects project
> (in volatilities.hpp and volatilities.cpp) to have something like
> QuantLibAddin::LocalVolSurface. Is that right?

Correct.  Also look at termstructures.hpp, which defines the base
classes.

> The other issue is that the LocalVolSurface::localVolImpl is a
> protected method and I've got compilation errors because of that.
> How can I expose such method to Excel?

Export the public LocalVolSurface::localVol(Time, Real, bool) instead.

Luigi


--

Vin: It's like this fellow I knew in El Paso. One day, he just took
all his clothes off and jumped in a mess of cactus. I asked him that
same question, "Why?"
Calvera: And?
Vin: He said, "It seemed like a good idea at the time."
-- The Magnificent Seven



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

g m-10
Hi,
Luigi, I didn't find the localVol public method (I'm working on the latest release (May 23d 2011))
 
Don said that if the return of a function defined in a xml needs some processing one must write a "equivalent" method in QuantLibAddin,
I checked the example he gave of qlBondDescription but I didnt see the trick.
 
I turned QuantLib::LocalVolSurface::localVolImp to public in order to validate my understanding and it worked fine in Excel (my modifications below) :
 
Conceptually however, I don't see where QuantLib::LocalVolSurface connects to QuantLibAddin::LocalVolSurface?
 
In volatilities.xml:
    <Constructor name='qlLocalVolSurface'>
      <libraryFunction>LocalVolSurfaceImp</libraryFunction>
      <SupportedPlatforms>
        <!--SupportedPlatform name='Excel' calcInWizard='false'/-->
        <SupportedPlatform name='Excel'/>
        <!--SupportedPlatform name='Cpp'/-->
      </SupportedPlatforms>
      <ParameterList>
        <Parameters>
          <Parameter name='BlackVolTermStructure'>
            <type>QuantLib::BlackVolTermStructure</type>
            <superType>libToHandle</superType>
            <tensorRank>scalar</tensorRank>
            <description>BlackVolTS.</description>
          </Parameter>
          <Parameter name='RiskFreeTermStructure'>
            <type>QuantLib::YieldTermStructure</type>
            <superType>libToHandle</superType>
            <tensorRank>scalar</tensorRank>
            <description>RiskFreeTS.</description>
          </Parameter>
          <Parameter name='DividendYieldTermStructure'>
            <type>QuantLib::YieldTermStructure</type>
            <superType>libToHandle</superType>
            <tensorRank>scalar</tensorRank>
            <description>DivYieldTS.</description>
          </Parameter>
          <Parameter name='Underlying'>
            <type>QuantLib::Quote</type>
            <superType>libToHandle</superType>
            <tensorRank>scalar</tensorRank>
            <description>underlying</description>
          </Parameter>
        </Parameters>
      </ParameterList>
    </Constructor>
   
<Member name='qlLocalVolSurfaceValue' type='QuantLib::LocalVolSurface' superType='libraryClass'>
      <description>Returns the local vol surface value at (time,strike).</description>
      <libraryFunction>localVolImpl</libraryFunction>
      <SupportedPlatforms>
        <SupportedPlatform name='Excel' calcInWizard='false' />
      </SupportedPlatforms>
      <ParameterList>
        <Parameters>
          <Parameter name='Time' exampleValue = '0.5'>
            <type>QuantLib::Time</type>
            <tensorRank>scalar</tensorRank>
            <description>time in year fraction</description>
          </Parameter>
          <Parameter name='Strike' exampleValue = '100'>
            <type>QuantLib::Real</type>
            <tensorRank>scalar</tensorRank>
            <description>strike</description>
          </Parameter>
        </Parameters>
      </ParameterList>
      <ReturnValue>
        <type>QuantLib::Real</type>
        <tensorRank>scalar</tensorRank>
      </ReturnValue>
    </Member>
 
In qlo\volatilities.hpp:
 
class LocalVolSurfaceImp : public LocalVolSurface {
      public:
        LocalVolSurfaceImp(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
      const QuantLib::Handle<QuantLib::BlackVolTermStructure>& blackTS,
      const QuantLib::Handle<QuantLib::YieldTermStructure>& riskFreeTS,
      const QuantLib::Handle<QuantLib::YieldTermStructure>& dividendTS,
      const QuantLib::Handle<QuantLib::Quote> underlying,
      bool permanent);
 };
 
In qlo\termstructures.hpp :
 
OH_OBJ_CLASS(LocalVolSurface, VolatilityTermStructure);
 
In qlo\volatilities.cpp:
 LocalVolSurfaceImp::LocalVolSurfaceImp(
   const boost::shared_ptr<ObjectHandler::ValueObject> &properties,
   const QuantLib::Handle<QuantLib::BlackVolTermStructure>& blackTS,
   const QuantLib::Handle<QuantLib::YieldTermStructure>& riskFreeTS,
   const QuantLib::Handle<QuantLib::YieldTermStructure>& dividendTS,
   const QuantLib::Handle<QuantLib::Quote> underlying,
   bool permanent) : LocalVolSurface(properties, permanent) {
   
   libraryObject_ = boost::shared_ptr<QuantLib::LocalVolSurface>(new
   QuantLib::LocalVolSurface(blackTS, riskFreeTS, dividendTS, underlying));
 }

Thanks!
 
 
> Subject: Re: [Quantlib-users] Expose a QuantLib class method to QuantLibAddin

> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Date: Thu, 30 Jun 2011 12:20:38 +0200
>
>
> On Thu, 2011-06-30 at 11:54 +0200, g m wrote:
> > I'm Actually trying to expose the LocalVolSurface class, I need to use
> > its localVolImpl(Time, Real) method.
> > my understanding is that I have to write Constructor and Method
> > descriptions in a xml file (I chose volatilities.xml file),
> > compile the qlgensrc project, then, write a representation of
> > QuantLib::LocalVolSurface class in the QuantLibObjects project
> > (in volatilities.hpp and volatilities.cpp) to have something like
> > QuantLibAddin::LocalVolSurface. Is that right?
>
> Correct. Also look at termstructures.hpp, which defines the base
> classes.
>
> > The other issue is that the LocalVolSurface::localVolImpl is a
> > protected method and I've got compilation errors because of that.
> > How can I expose such method to Excel?
>
> Export the public LocalVolSurface::localVol(Time, Real, bool) instead.
>
> Luigi
>
>
> --
>
> Vin: It's like this fellow I knew in El Paso. One day, he just took
> all his clothes off and jumped in a mess of cactus. I asked him that
> same question, "Why?"
> Calvera: And?
> Vin: He said, "It seemed like a good idea at the time."
> -- The Magnificent Seven
>
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Expose a QuantLib class method to QuantLibAddin

Luigi Ballabio
On Fri, 2011-07-01 at 11:53 +0200, g m wrote:
> Hi,
> Luigi, I didn't find the localVol public method (I'm working on the
> latest release (May 23d 2011))

It's inherited from LocalVolTermStructure, which is the base class
defining the interface.

Your code can pretty much parallel what's already there, with
LocalVolSurface taking the place of BlackVolSurface and
LocalVolTermStructure in place of BlackVolTermStructure.  I don't think
you need a LocalVolSurfaceImp class.

Luigi


--

There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the
other way is to make it so complicated that there are no obvious
deficiencies.
-- C. A. R. Hoare



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users