Re: [eigen] Map questions

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


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/