On Tue, Oct 6, 2009 at 8:07 AM, John McDonald <johnmcd@cs.nuim.ie> wrote:
Hi,
The code compiles and executes without a problem. However if I step into
this code, and for example stop at the sixth line, and then try to
inspect a variable I can only get limited information on its state.
Specifically if I open an "immediate" window and try
v(0)
I get the following error
CXX0059: Error: left operand is class not a function name
If I try
v[0]
CXX0058: Error: overloaded operator not found

A few things:
1) I haven't tried to do what you are trying exactly but: Make sure you have made the debugging extensions described at the bottom of: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_UBLAS

2) Also, don't forget that ublas is using expression templates, so things like "-v" are going to be complicated to step through.  It will generate a strange intermediate object without actually changing the sign of anything or executing any code.  Only when the cout << serialization begins would it start going through the vector and doing the negation.  If you want to look at intermediates, you should assign expressions to temporary classes of type ublas::vector<> etc.

3) Last, I have often thought that the "debug" build doesn't necessarily change all of the preprocessor definitions that change debugging, see the bottom of: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_UBLAS  and if there was any inlining in a build, etc. you would definetely be confused when stepping through.