Re: [eigen] Pass column by reference |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Pass column by reference
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Fri, 21 May 2010 12:45:56 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=TrHWI+H7MTEL3Rz8HyZasQ+1/WkxL0y1E5Q5lBu/8Vo=; b=yFnr5uCeuw7SDtnKss1GrKp6eOwKcpNA9tP20CtYotoxFcwGEGhT1LhljocR1j/Fmq gHNzEHGI9RldIf1hRw4xehBh8cmxmQtnJaQdV/ocaTIvtjXBjznjTiFrbL6kFiQ6Ua4a mEB9RPB0StyjL7BSaCge2sPUSkuIrDi3ARJiw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=S7bAYBLpza7xb1Msl+uQasAQlC4l2CKWojVXi3GCsua+JnxFWlms/Xv5G8lcLmf6gH UFJ1Dmo3hxB0pEhPaeIoWv0xGJqijB24Z8iMQpacVBKtqnnDrFyhYmpGZUNr5LcCH8cL UI7/+e/J1CnCYBg0STRAVW7dqWdl3wCI9kOx4=
On Fri, May 21, 2010 at 12:29 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:
> Thanks, I will try them. I am thinking that it would be good to put this
> information in the tutorial since it seems to be happening to everyone I am
> coding with that is using Eigen, since it would seem as if VectorXf should
> succeed, but does not.
> Do you think there would be a way to include such a change in the future so
> that columns could be taken as vectors? I am not aware of the internals for
> this in Eigen, maybe it is a complete rewrite or has important
> disadvantages.
We can add this for sure to the documentation. I've even made a
mistake by declaring the arguments as references. They need to be
either value objects or rvalue references.
We will never be able to add what you are asking for and I also think
that it is not really intuitive what you are asking for. A matrix is
not a list of vectors and a column expression is giving you just a
view on a column. In particular, in case you want to write to the
matrix column, what you ask for is not possible.
Something like this is a different scenario:
void foo(VectorXf v) {}
Here you can easily call foo(m.col(i)) though you will cause the
creation of a temporary object. The column-expression will be copied
into the VectorXf.
HTH,
Hauke