Re: [eigen] Matrix assignment

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


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.


On Tue, Oct 21, 2008 at 2:35 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> On Tuesday 21 October 2008 14:26:34 Benoît Jacob wrote:
>> On Tuesday 21 October 2008 14:07:47 Cristóvão Sousa wrote:
>> > Another solution that may be nice is to deny any resizing unless
>> > you call some function, like:
>> >
>> >     m0.copy(m1);
>> > or
>> >     m0.assign() = m1;
>>
>> This could be called m0.resize() = m1;
>
> Another idea:
>
> note that here we don't need op-assign operators such as += -= *= /= because
> these would never require a resizing.
>
> So in fact, aside from some syntax candy, a Resize proxy doesn't bring any
> advantage. So perhaps it's just simpler to do:
>
> m0.resizeAssign(m1);
>
> (need confirmation from a native English speaker that it sounds OK. Need
> an "And" in the middle?)
>
> Cheers,
> Benoit
>
> ---
>
>


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