Re: [eigen] [Sparse] InnerIterator not assignable |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] [Sparse] InnerIterator not assignable
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 16 Nov 2010 12:45:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=teiYKgHazD5qUu33N3Uw8mhUl0A85hsGgdAyHLfC5WI=; b=KBIdffblf4e14Vd5PiBzIVlgeySNQHp9ooMbtUcm58LZdpyv7OKp/AbAfJPNmhfxCg mX3WsjlgaOcMxo6EeekcbdwZhkN77fDDqMzWRIem3b+xS9wsdQs9QURJYvCm7YfgJBMx pHsOiuKDBYtKna3wjLByZQQQKziMF4o6JgMa4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=drU1OAy/Pt5ZEgSVq4sjw5UZfVa//qMLIrx4gI6GKvEx1XxBVq+odTy2bRR5TyXF00 jDa11tFYT4bYxjFREbuU4i81NQQWvfu42WFIbz0MmyTNlSMQIvNVIRUgru205e+Kx8PC wZUPhd/sNzESLzb5+W5A2+WpjkYINZN0x1wGI=
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.
>
>
>