Re: [eigen] Matrix assignment |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Matrix assignment
- From: "Cristóvão Sousa" <crisjss@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 12:07:25 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=lgNm0JBloiMlPz/t7WO9VAS3DiUttU34w1LhauC3Abc=; b=RiqKULoKLUJPMJZwlElRfyMJ2vRuBVectV1OpgsrXAleAbvr53N4w+HmOz10IiiEIb VryASjRckB7SaitgOpayxWCMLvM4AEkEjRn1xEW3MJEJtSsFLu1mAXB0n3OMQ3hyPd9g P2nfR6TcM8lmBKXOgcPueVqJCgKn5A+LUzkU4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JfiTWEnvRW0xN7FwZT50KwpKJcznyRQNYk4nrThUsuyHb5sAEUgmi7O7RbDsMYCQs3 7VonLU9M/HsWJt8uSCofdbhKVr8/d5JY2fIqX1gdPpm/oBhiDh5qEM9EjTLb3pzXMncw fa58It1fUYp9i3DKbeTkxT/AHxVfq770Hba7g=
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.
>
>
---