Boost logo

Ublas :

Subject: Re: [ublas] indirect_array cast
From: Ralf Denzer (Ralf.Denzer_at_[hidden])
Date: 2011-03-14 16:32:21


 Hi Phil,

> but I need the indirect_array<> and I have tried the

> std::copy( l_temp.begin(), l_temp.end(), l_idx.begin() );

> and get the error "assignment of read-only location"

you may try

std::copy( l_temp.begin(), l_temp.end(), &l_idx(0) );

There is a problem in the design of indirect_array:
l_idx.begin() is a const iterator, thus your compiler error.
&l_idx(0) gives a non-const reference, so you can use
it for writing data with std::copy()

Check Nasos comment in
http://answerpot.com/showthread.php?726979-submatrix+with+indexvector

 Ralf


 


 

  

NEU: FreePhone - kostenlos mobil telefonieren und surfen!    
Jetzt informieren: http://produkte.web.de/go/webdefreephone