It is nice to meet you.

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

It is nice to meet you.

sunao furukawa
Hello,Everyone!
It is nice to meet you.
My name is Sunao Furukawa.
I am Japanese.
I can understand English a little.
I am beginner of QuantLib.
I use Visual C++ 2008 Express edition.
I try writing QuantLib program,below.

-------------------------------------------------------
#include "stdafx.h"
#include <ql/pricingengines/blackscholescalculator.hpp>
#include <ql/quantlib.hpp>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
 QuantLib::BlackScholesCalculator BS;
 std::cout << BS.delta();
 return 0;
}
------------------------------------------------------
This program emit error C2512: No default constructor is available for the
specified class, structure, or union.
I don't know what to do.
Please tell me how to fix this program, not to emit error.

Thanks.


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: It is nice to meet you.

Jón Gísli Egilsson
Hello Sunao Furukawa.

I believe the C++ compiler is telling you that there is no default constructor for the object BlackScholesCalculator. If you check out:


then you will see that you need to initialize the object with a few parameters. The constructor should look like this:

BlackScholesCalculator (const boost::shared_ptr< StrikedTypePayoff > &payoff, Real spot, DiscountFactor growth, Real stdDev, DiscountFactor discount)

I hope this helps. 

Regards.
Jón Gísli

PS I hope I'm replying correctly to the post list.

On Thu, Feb 10, 2011 at 11:17 AM, sunao furukawa <[hidden email]> wrote:
Hello,Everyone!
It is nice to meet you.
My name is Sunao Furukawa.
I am Japanese.
I can understand English a little.
I am beginner of QuantLib.
I use Visual C++ 2008 Express edition.
I try writing QuantLib program,below.

-------------------------------------------------------
#include "stdafx.h"
#include <ql/pricingengines/blackscholescalculator.hpp>
#include <ql/quantlib.hpp>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
 QuantLib::BlackScholesCalculator BS;
 std::cout << BS.delta();
 return 0;
}
------------------------------------------------------
This program emit error C2512: No default constructor is available for the
specified class, structure, or union.
I don't know what to do.
Please tell me how to fix this program, not to emit error.

Thanks.


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: It is nice to meet you.

aincze
In reply to this post by sunao furukawa
Hi,

 I suggest to have a look at Examples that are provided with QuantLib,
Examples\EquityOption folder.

  bye, bye
A.


Quoting sunao furukawa <[hidden email]>:

> Hello,Everyone!
> It is nice to meet you.
> My name is Sunao Furukawa.
> I am Japanese.
> I can understand English a little.
> I am beginner of QuantLib.
> I use Visual C++ 2008 Express edition.
> I try writing QuantLib program,below.
>
> -------------------------------------------------------
> #include "stdafx.h"
> #include <ql/pricingengines/blackscholescalculator.hpp>
> #include <ql/quantlib.hpp>
> #include <iostream>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
>  QuantLib::BlackScholesCalculator BS;
>  std::cout << BS.delta();
>  return 0;
> }
> ------------------------------------------------------
> This program emit error C2512: No default constructor is available for the
> specified class, structure, or union.
> I don't know what to do.
> Please tell me how to fix this program, not to emit error.
>
> Thanks.
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: It is nice to meet you.

sunao furukawa
In reply to this post by sunao furukawa
Hello.
Thank you for your reply.
I don't know how to use smart pointer.
I refer to your advise very much.

Thank you very much!!

----- Original Message -----
From: "李丞" <[hidden email]>
To: "sunao furukawa" <[hidden email]>
Sent: Thursday, February 10, 2011 9:38 PM
Subject: Re: [Quantlib-users] It is nice to meet you.


> hello Furukawa:
>
> Nice to meet you too.  I think the debug information clearly state the
> problem.
>
> As you can see in the "BlackScholesCalculator.hpp" file,  There is only
> one constructor declared for the class BlackScholesCalculator.
>
> There is no default constructor for BlackScholesCalculator. So you should
> pass the apporiate parameters to the constructor when you define a
>
> BlackScholesCalculator object.
>
> e.g.
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> boost::shared_ptr<QuantLib::StrikedTypePayoff> ptr =
>        boost::shared_ptr<QuantLib::StrikedTypePayoff>(new
> QuantLib::PlainVanillaPayoff(QuantLib::Option::Call,100));
>
> QuantLib::BlackScholesCalculator BS(ptr,100.0,1.0,0.2,1.0);
> std::cout << BS.delta();
> return 0;
> }
>
> such code should work for your problem.
>
> Best regards
> Li Cheng
>
> -----原始邮件-----
> From: sunao furukawa
> Sent: Thursday, February 10, 2011 7:17 PM
> To: [hidden email]
> Subject: [Quantlib-users] It is nice to meet you.
>
> Hello,Everyone!
> It is nice to meet you.
> My name is Sunao Furukawa.
> I am Japanese.
> I can understand English a little.
> I am beginner of QuantLib.
> I use Visual C++ 2008 Express edition.
> I try writing QuantLib program,below.
>
> -------------------------------------------------------
> #include "stdafx.h"
> #include <ql/pricingengines/blackscholescalculator.hpp>
> #include <ql/quantlib.hpp>
> #include <iostream>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> QuantLib::BlackScholesCalculator BS;
> std::cout << BS.delta();
> return 0;
> }
> ------------------------------------------------------
> This program emit error C2512: No default constructor is available for the
> specified class, structure, or union.
> I don't know what to do.
> Please tell me how to fix this program, not to emit error.
>
> Thanks.
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users 


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: It is nice to meet you.

Luigi Ballabio
On Fri, 2011-02-11 at 13:54 +0900, sunao furukawa wrote:
> Hello.
> Thank you for your reply.
> I don't know how to use smart pointer.
> I refer to your advise very much.

Documentation is at
<http://www.boost.org/doc/libs/1_45_0/libs/smart_ptr/shared_ptr.htm>.

Luigi



>
> Thank you very much!!
>
> ----- Original Message -----
> From: "李丞" <[hidden email]>
> To: "sunao furukawa" <[hidden email]>
> Sent: Thursday, February 10, 2011 9:38 PM
> Subject: Re: [Quantlib-users] It is nice to meet you.
>
>
> > hello Furukawa:
> >
> > Nice to meet you too.  I think the debug information clearly state the
> > problem.
> >
> > As you can see in the "BlackScholesCalculator.hpp" file,  There is only
> > one constructor declared for the class BlackScholesCalculator.
> >
> > There is no default constructor for BlackScholesCalculator. So you should
> > pass the apporiate parameters to the constructor when you define a
> >
> > BlackScholesCalculator object.
> >
> > e.g.
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > boost::shared_ptr<QuantLib::StrikedTypePayoff> ptr =
> >        boost::shared_ptr<QuantLib::StrikedTypePayoff>(new
> > QuantLib::PlainVanillaPayoff(QuantLib::Option::Call,100));
> >
> > QuantLib::BlackScholesCalculator BS(ptr,100.0,1.0,0.2,1.0);
> > std::cout << BS.delta();
> > return 0;
> > }
> >
> > such code should work for your problem.
> >
> > Best regards
> > Li Cheng
> >
> > -----原始邮件-----
> > From: sunao furukawa
> > Sent: Thursday, February 10, 2011 7:17 PM
> > To: [hidden email]
> > Subject: [Quantlib-users] It is nice to meet you.
> >
> > Hello,Everyone!
> > It is nice to meet you.
> > My name is Sunao Furukawa.
> > I am Japanese.
> > I can understand English a little.
> > I am beginner of QuantLib.
> > I use Visual C++ 2008 Express edition.
> > I try writing QuantLib program,below.
> >
> > -------------------------------------------------------
> > #include "stdafx.h"
> > #include <ql/pricingengines/blackscholescalculator.hpp>
> > #include <ql/quantlib.hpp>
> > #include <iostream>
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > QuantLib::BlackScholesCalculator BS;
> > std::cout << BS.delta();
> > return 0;
> > }
> > ------------------------------------------------------
> > This program emit error C2512: No default constructor is available for the
> > specified class, structure, or union.
> > I don't know what to do.
> > Please tell me how to fix this program, not to emit error.
> >
> > Thanks.
> >
> >
> > ------------------------------------------------------------------------------
> > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> > Pinpoint memory and threading errors before they happen.
> > Find and fix more than 250 security defects in the development cycle.
> > Locate bottlenecks in serial and parallel code that limit performance.
> > http://p.sf.net/sfu/intel-dev2devfeb
> > _______________________________________________
> > QuantLib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users 
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

--

This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context.
-- David Moser



------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users