Re: [eigen] Map questions
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] Map questions
• From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
• Date: Wed, 29 Oct 2008 22:51:34 +0100
• 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.
```

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