Boost logo

Ublas :

From: Wenming Yu (xuebuyu_at_[hidden])
Date: 2006-01-13 09:20:35


Hi,

I copy your code into my vc2003. But there is no error. Maybe there is set
wrong with your IDE.

 

Wenming Yu

 

  _____

·¢¼þÈË: ublas-bounces_at_[hidden] [mailto:ublas-bounces_at_[hidden]]
´ú±í Francisco J. Gonz¨¢lez
·¢ËÍʱ¼ä: 2006Äê1ÔÂ13ÈÕ 1:42
ÊÕ¼þÈË: ublas_at_[hidden]
Ö÷Ìâ: [ublas] Coordinate matrix compile error

 

Hi,

 

I'm using Boost beta 1.33.1 with Microsoft Visual C++ 2003. I'm having
problems with the coordinate_matrix: the following code

 

#include <boost/numeric/ublas/matrix_sparse.hpp>
int main () {
    boost::numeric::ublas::coordinate_matrix<double> m (3, 3, 3*3);
 m(0,0) = 1.0;
}

 

generates an error in line #3 (see the attached file with the complete build
log):

 

c:\Archivos de programa\Microsoft Visual Studio .NET
2003\Vc7\include\algorithm(368) :
error C2664:
'void
std::swap<boost::numeric::ublas::indexed_iterator<C,IC>::reference>(_Ty
&,_Ty &)' :
cannot convert parameter 1
from 'boost::numeric::ublas::indexed_iterator<C,IC>::reference'
  to 'boost::numeric::ublas::indexed_iterator<C,IC>::reference &'
A reference that is not to 'const' cannot be bound to a non-lvalue

 

Do anybody knows the cause/workarround?
Thanks

 

Fran J. Gonz¨¢lez