Boost logo

Ublas :

Subject: [ublas] debugging in MSVC 2005
From: John McDonald (johnmcd_at_[hidden])
Date: 2009-10-06 08:07:54


I am new to ublas (and boost) and am currently trying to get my head
around the library. I am using MS Visual Studio 2005.

The question I would like to raise is with regard to debugging in the
above environment. To try an keep things simple I have created and built
a (Debug) project around the following code (#includes not shown):
int main () {
    using namespace boost::numeric::ublas;
    vector<std::complex<double> > v (3);
    for (unsigned i = 0; i < v.size (); ++ i)
        v (i) = std::complex<double> (i, i);

    std::cout << - v << std::endl;
    std::cout << conj (v) << std::endl;
    std::cout << real (v) << std::endl;
    std::cout << imag (v) << std::endl;
    std::cout << trans (v) << std::endl;
    std::cout << herm (v) << std::endl;

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
I get the following error
CXX0059: Error: left operand is class not a function name
If I try
CXX0058: Error: overloaded operator not found

Both of these operators should be available (as can be seen from the
code, the first one is used in the for loop).

Can anyone give me some advice on how to get around this issue in visual

Thanks and regards,
John McDonald.