Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Debugging-QuantLib-Array-in-msvc-tp7565p7566.html
Kim,
thanks for the tip---I've been missing that.
Later,
Luigi
P.S. A caveat for those interested: the code below works with Boost 1.39
only. For earlier versions, replace .px with .ptr to make it work.
On Sat, 2009-07-18 at 23:04 +0200, Kim Kuen Tang wrote:
> as we know debugging QuantLib::Array is not supported in msvc (2008 and
> 2009). The debugger just displays the name, the scoped_array and the size:
> v {data_={...} n_=5 } QuantLib::Array
> + data_ {px=0x00295830 } boost::scoped_array<double>
> n_ 5 unsigned int
>
> This is of course not human-friendly. And you can get around this
> limitation by modifying the autoexp.dat file which can be found in
>
> You just need to add these lines
>
> ;-------------------------------------
> ; QuantLib::Array
> ;------------------------------------
>
> QuantLib::Array {
> preview
> (
> #(
> "[",
> $e.n_ ,
> "](",
>
> #array
> (
> expr: ((($c).data_).px)[$i],
> size : $c.n_
> ),
> ")"
> )
> )
>
> children (
> #(
> [raw members]: [$c,!],
> [size]: [$c.n_, i],
> #array (
> expr: ((($c).data_).px)[$i],
> size: $c.n_
> )
> )
> )
> }
> .. Then you are able to get the information, the same as from std::vector:
>
> +m[5](100.00000000000000,100.00000000000000,100.00000000000000,100.00000000000000,100.00000000000000)QuantLib::Array.
>
> Back up autoesp.dat before proceeding.
--
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
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users