Posted by
Kim Kuen Tang on
URL: http://quantlib.414.s1.nabble.com/Debugging-QuantLib-Matrix-with-msvc-tp7956p7959.html
Hi all,
the bug is fixed by doing some division and modulus on the index.
Here is the code:
;------------------------------------------------------------------------------
; QuantLib::Matrix
;------------------------------------------------------------------------------
QuantLib::Matrix{
children
(
#(
[shared_ptr]: [$c.data_,!],
rows: $c.rows_,
columns: $c.columns_,
#array(
rank: 2,
base: 0,
expr: ($c.data_.px)[($i % $c.rows_)*$c.columns_+ (($i- $i %
$c.rows_)/$c.rows_) ],
size: ($r==1)*$c.rows_+($r==0)*$c.columns_
)
)
)
preview
(
#(
"[",
$c.rows_ ,
",",
$c.columns_,
"](",
#array
(
expr : [($c.data_.px)[$i],g],
size : $c.rows_ * $c.columns_
) ,
")"
)
)
}
Best regards,
Kim
Kim Kuen Tang schrieb:
> Hi Luigi,
>
> sorry for the delay. I was on vacancy.
>
> Luigi Ballabio schrieb:
>
>> On Sun, 2009-08-16 at 22:47 +0200, Kim Kuen Tang wrote:
>>
>>
>>> debugging QuantLib::Matrix with msvc is not possible. The debugger just
>>> shows the raw pointer to that matrix.
>>> And you can get around this limitation by modifying the autoexp.dat file
>>>
>>>
>> Kim,
>> it seems that the indices are flipped when the values are displayed:
>>
>>
> Yes, this is true. The problem is somewhat related in the way how the
> debugger works in visual studio.
> In MSVC the first entry in a matrix represents the columns, whereas in
> QuantLib it represents the rows. This is the reason why the values are
> flipped.
>
> Best reagrds,
> Kim
>
>> see the attached screenshot, where I just set M[0][0], M[0][1] and
>> M[0][2] and the debugger displays the values for M[0][0], M[1][0] and
>> M[2][0].
>>
>> Luigi
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>
>
>
>
------------------------------------------------------------------------------
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