R: Re: QuantLib 1.2 error at memory location

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

R: Re: QuantLib 1.2 error at memory location

tarpanelli@libero.it

Thanks Mike, now it works

ciao

P

----Messaggio originale----
Da: [hidden email]
Data: 04/10/2012 2.30
A: "[hidden email]"<[hidden email]>
Cc: <[hidden email]>
Ogg: Re: [Quantlib-dev] QuantLib 1.2 error at memory location

Hi,

you are running a debug version of this quant lib module but do not have the debug symbols present on your machine.
You'll need to get hold of a release version of the 1.2 (no debug symbols) or build 1.2 yourself on the machine that you are running your code on.

Cheers,

Mike

On Thu, Oct 4, 2012 at 12:54 AM, [hidden email] <[hidden email]> wrote:

Hello,

I have update QuantLib from 1.1 to 1.2 and I got a strange error.

QLSBTesting.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open
the PDB file
'QLSBTesting.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or
open the PDB file
'QLSBTesting.exe': Loaded 'C:\WINDOWS\system32\msvcp100.dll', Cannot find or
open the PDB file
'QLSBTesting.exe': Loaded 'C:\WINDOWS\system32\msvcr100.dll', Cannot find or
open the PDB file
First-chance exception at 0x7c812afb in QLSBTesting.exe: Microsoft C++
exception: QuantLib::Error at memory location 0x0012fc68..
The program '[4108] QLSBTesting.exe: Native' has exited with code 0 (0x0).

Here is the piece of code which worked on 1.1 but return me the above error
after moved to 1.2. The pronlem is when I call the InterpolatedDiscountCurve (
see at the end of the code)
Have you any clue?

Thanks in advance
Paolo

                                           std::vector<std::string> sb_dates;
                sb_dates.push_back("2012-10-03");
                sb_dates.push_back("2012-11-05");
                sb_dates.push_back("2012-11-05");
                sb_dates.push_back("2012-12-05");
                sb_dates.push_back("2013-10-07");
                sb_dates.push_back("2014-10-06");
                sb_dates.push_back("2017-10-05");
                sb_dates.push_back("2024-10-07");
                sb_dates.push_back("2032-10-05");

                std::vector<double> sb_values;
                sb_values.push_back(1.0);
                sb_values.push_back(0.999981);
                sb_values.push_back( 0.99997);
                sb_values.push_back( 0.999878);
                sb_values.push_back( 0.996254);
                sb_values.push_back( 0.991456);
                sb_values.push_back(0.95465);
                sb_values.push_back( 0.785955);
                sb_values.push_back(0.623019);

                std::string sb_datatype("discountfactor");
                std::string sb_dcf("act360");
                std::string sb_interpolation("Linear");
                std::vector<std::string> sb_dates2interp;

                std::vector<QuantLib::Date> dates;
                if (dates.size() < sb_dates.size()) { dates.resize(sb_dates.size()); }
                std::vector<QuantLib::Date> dates2interp;
                if (dates2interp.size() < sb_dates2interp.size()) { dates2interp.resize
(sb_dates2interp.size()); }

                // Converting the dates string into QuantLib Date
                for (size_t i=0; i<sb_dates.size(); ++i) {
                        dates[i] = QuantLib::DateParser::parseISO(sb_dates[i]);
                }
                for (size_t i=0; i<sb_dates2interp.size(); ++i) {
                        dates2interp[i] = QuantLib::DateParser::parseISO(sb_dates2interp[i]);
                }

                // Day counter
                QuantLib::DayCounter basis = QuantLib::Actual360();
                if (sb_dcf.compare("actact") == 0) { basis = QuantLib::ActualActual(); }
                if (sb_dcf.compare("act365") == 0) { basis = QuantLib::Actual365Fixed(); }
                if (sb_dcf.compare("30360") == 0) { basis = QuantLib::Thirty360(); }
                if (sb_dcf.compare("act360") == 0) { basis = QuantLib::Actual360(); }
                if (sb_dcf.compare("bus252") == 0) { basis = QuantLib::Business252(); }

                // Yield term structure
                QuantLib::RelinkableHandle<YieldTermStructure> yc;

                if (sb_datatype.compare("discountfactor") == 0) {

                        std::vector<QuantLib::DiscountFactor> dfs;
                        if (dfs.size() < sb_values.size()) { dfs.resize(sb_values.size()); }
                        for (size_t i=0; i<sb_values.size(); ++i) {
                                dfs[i] = sb_values[i];
                                std::cout << dfs[i] << std::endl;
                        }

                        if (sb_interpolation.compare("Linear") == 0) {
                                std::cout << "START: " << std::endl;
                                boost::shared_ptr<YieldTermStructure> dfcurve(new QuantLib::
InterpolatedDiscountCurve<Linear>(dates, dfs, basis));
                                yc.linkTo(dfcurve);
                                std::cout << "VALUE DF: " << dfcurve->(dates2interp[1]) << std::endl;
                        }
                                            }

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev




------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev