Re: [eigen] Map & TensorMap and setData() functionality

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


ahh awesome,

however, isn't it ugly to use

new (&v) Map<Type>(ptr, dimensions) 


and ->  a setData method does not need  dimensions (which stay fix),  which makes setData efficient when using it in a loop many times...
I just wanted to reset the data pointer thats all :-)

BR Gabriel





On 10/08/2015 11:42 AM, Gael Guennebaud wrote:

Because this is already possible using standard C++ features, see: http://eigen.tuxfamily.org/dox/group__TutorialMapClass.html#title3

gael

On Thu, Oct 8, 2015 at 11:07 AM, Gabriel <gnuetzi@xxxxxxxxx> wrote:
Why is there no functionality for


Map<EigenType> a(ptr);

a->setData(otherPtr);


That would be helpful, if we want to store a mapping _expression_ somewhere and change the data ptr around.

Of course so far this is not possible, but we always need to do this to somehow mimic this

a = Map<EigenType>(otherPtr);

Is there a reason for not setData() functionality?

The same would apply for TensorMap, where a setData function would even be more efficient since the constructor always needs an DSize (dimension) array...?

a = TensorMap(otherPtr, dimensions);

I think miss something here ? :)

BR Gabriel











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