This .natvis
XML code works fine in visual studio 2013. I added @Claes Rolen XML in visual studio 2013 and that dose not work fine for me.
The trick is to use <IndexListItems>
to visualize armadillo matrix
declare and initialize code
mat tMat(3, 3);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
tMat(i, j) = i + j;
}
.Natvis File
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="arma::Col<*>">
<DisplayString>{{ Size = {n_elem} }}</DisplayString>
<Expand>
<Item Name="[size]">n_elem</Item>
<ArrayItems>
<Size>n_elem </Size>
<ValuePointer>mem</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="arma::Mat<*>">
<DisplayString>{{ {n_rows} x {n_cols} = {n_elem} }}</DisplayString>
<Expand>
<IndexListItems>
<Size>n_cols</Size>
<ValueNode >
mem+($i*n_rows),[n_rows]
</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="arma::subview_col<*>">
<DisplayString>{{ {n_rows} }}</DisplayString>
<Expand>
<ArrayItems>
<Size>n_rows</Size>
<ValuePointer>colmem</ValuePointer>
</ArrayItems>
</Expand>
</Type>
</AutoVisualizer>
And Result image in debugger:
