Re: [eigen] [Sparse] InnerIterator not assignable

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

in the meantime you can use the placement new C++ syntax:

new (&innerIt) typename Sp::InnerIterator(sp, outerIdx);

gael

On Tue, Nov 16, 2010 at 10:19 AM,  <bernard.hugueney@xxxxxxxxxx> wrote:
>
> Hi,
> While wrapping Eigen::Sparse iterator into something like :
> "
>    NNZSparseIterator& operator++()
>    {
>        ++innerIt;
>        if(!innerIt)
>        {
>            if(++outerIdx >= sp.outerSize())
>            {
>                outerIdx= 0;
>            }
>            innerIt= typename Sp::InnerIterator(sp, outerIdx); // <- fail
>        }
>        return *this;
>    }
>
> I fail to compile the "// -<fail" line because template<typename Scalar, int
> _Options, typename _Index>
> class SparseMatrix<Scalar,_Options,_Index>::InnerIterator has some const
> members.[*]
>
> Would it be possible to remove this constness in order to have assignable
> InnerIterator ?
>
> Best regards,
>
> Bernard
>
> [*]
> https://bitbucket.org/eigen/eigen/src/04e0683a1547/Eigen/src/Sparse/SparseMatrix.h#cl-639
> m_outer and m_end.
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/