Boost logo

Ublas :

Subject: Re: [ublas] Element-wise operations are really slow
From: xiss burg (xissburg_at_[hidden])
Date: 2010-05-12 10:21:27


Gunter,

Now I am really confused. I tried compiling the code below in the command
line in VC++ 2008 Express and VC++ 2010 Express and it goes fine. Inside a
project in VC++ 2008 Express it also goes fine. But inside a project in
VC++2010 Express it results in that error whenever I use the += operator.

#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_of_vector.hpp>

namespace ublas = boost::numeric::ublas;

int main(int argc, char** argv)
{
    ublas::generalized_vector_of_vector<float, ublas::row_major,
ublas::vector<ublas::vector<float> > > K(3, 3);

    K(0,0) += 1.f;

    return 0;
}

I get:

e:\boost\boost_1_42_0\boost\numeric\ublas\vector_of_vector.hpp(301): error
C2668: 'boost::numeric::ublas::ref' : ambiguous call to overloaded function
1>
e:\boost\boost_1_42_0\boost\numeric\ublas\vector_sparse.hpp(174): could be
'boost::numeric::ublas::vector<T>
&boost::numeric::ublas::ref<boost::numeric::ublas::vector<T>>(VER &)'
1> with
1> [
1> T=float,
1> VER=boost::numeric::ublas::vector<float>
1> ]
1> c:\program files (x86)\microsoft visual studio
10.0\vc\include\xrefwrap(439): or 'std::tr1::reference_wrapper<_Ty>
std::tr1::ref<T>(_Ty &)' [found using argument-dependent lookup]
1> with
1> [
1> _Ty=boost::numeric::ublas::vector<float>,
1> T=boost::numeric::ublas::vector<float>
1> ]
1> while trying to match the argument list
'(boost::numeric::ublas::vector<T>)'
1> with
1> [
1> T=float
1> ]
1>
e:\boost\boost_1_42_0\boost\numeric\ublas\vector_of_vector.hpp(298) : while
compiling class template member function 'float
&boost::numeric::ublas::generalized_vector_of_vector<T,L,A>::insert_element(unsigned
int,unsigned int,const float &)'
1> with
1> [
1> T=float,
1> L=boost::numeric::ublas::row_major,
1>
A=boost::numeric::ublas::vector<boost::numeric::ublas::vector<float>>
1> ]

Seems to be a problem with VC++ 2010 Express then?? . . . This program is
already driving me angry anyway.

x