Re: [eigen] Map questions |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Map questions
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 22:51:34 +0100
- 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=IZxomAXmjcfLgjlA474uwFrXoljmR2C+ZPvN4F8GwOc=; b=sSzlc2N94XpIzzGlZrLB6YfYrJqkgB/agKxon9f8zC/PDFifC/bdoyyabwR33WzW4/ 3vmBTd8awWF+RUBmhocq6POMfD4fVe6Dn6HdjyYlv+0D0wufQYyusM+bxFlXe0RGP1xd lY5EXDkHcTWT+qbwBoCvTyFk9hDUXlN25QkaY=
- 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=Gl21sH8DrQPSSbbn1+dijTAVDFgIcbCaWLSdSRrcLDzfRjMfRE/bTFv58x9YbjkbuN IBhrQL7vLyB8RxZGbQmBHpawT8KavyjWFAzh7OvnygF9zMXAZTU756XV6jaHgZjFgNoR sNs9+6We0pccPV6zgYqLhVZt9jy44homzitMA=
Hi,
On Wed, Oct 29, 2008 at 9:01 PM, Cristóvão Sousa <crisjss@xxxxxxxxx> wrote:
> Hi,
>
> I would like to do something like
>
> Vector3d v;
> // v = something;
> double a[3];
> Map<Vector3d>(a) = v;
indeed, "Map<Vector3d>(a) = v;" seems to be equivalent to
"Map<Vector3d> a = v;" that is very unfortunate...
Actually the following variants works:
Map<Vector3d>(a,3) = v;
(Map<Vector3d>(a)) = v;
Map<Vector3d>(a).operator=(v);
Map<Vector3d>(a).lazyAssign(v);
Map<Vector3d> _a(a); _a = v;
Map<Vector3d>(a).start<3>() = v;
...
I could keep going like this forever, but nothing is really good and
intuitive. Perhaps this is a good motivation to resurrect the
Matrix::Map static functions.... ??? or find something else....
> Another thing that could be a little bug:
> it is currently possible to do
>
> const double a[3]={1,2,3};
> Map<Vector3d>(a).setZero();
>
> , which discards the const qualifier of a.
ok, I'll check later if we can do something for that, but there is
nothing urgent here.
cheers,
gael.