Boost logo

Ublas :

Subject: Re: [ublas] Accessing the indices of non-zero elements in a UBLAS sparse vector
From: John Reid (j.reid_at_[hidden])
Date: 2011-09-23 07:34:32


On 23/09/11 11:53, Oswin Krause wrote:
> Hi,
>
> maybe i have to correct myself, my information seems to be outdated.
>
> the source code for mapped_vector::iterator states:
>
> BOOST_UBLAS_INLINE
> iterator&operator ++ () {
> ++ it_;
> return *this;
> }
> BOOST_UBLAS_INLINE
> reference operator * () const {
> BOOST_UBLAS_CHECK (index ()< (*this) ().size (), bad_index ());
> return (*it_).second;
> }
>
> So it should work out of the box without the index workaround. Sorry for
> the inconvenience caused...finally i can beatify some of my own code :)
> (after i have checked whether this is also true for the sparse matrices.
> unfortunately, THAT code is a mess).

What does "out of the box" mean here? Can you give a line of code?