Re: [eigen] Matrix assignment

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


Well, I found a drawback of operator= not making implicit resize:

a class with Eigen matrices as members does not have a well working
implicit operator= function...

For me is ok, I'll just have to implement an explicit operator= or forbid it.


Cristóvão Sousa


On Tue, Oct 21, 2008 at 2:02 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> hm... resizeAssign sounds a bit weird to me. Perhaps with only one
> additional letter:
>
> m0.resizedAssign(m1);
>
> that can be interpreted as a shortcut for m0.resized().assign(m1);.
> Or, something much shorter and almost as explicit (IMO):
>
> m0.set(m1);
>
> I think it is quite clear that a "set" operation is allowed to resize
> the destination, isn't it ? another argument: when we allow the
> destination to be resized, that mean we are re-initializing the
> matrix, so "set" makes sense.
>
> gael.
>
>

---


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