Registered Member
|
I'm trying to write a wrapper function that returns an expression operating on a mapped array, but it looks like I'm doing it wrong. Here's a sample program:
When I compile and run this, using the current development branch of Eigen, I get:
So it looks like something is overwritten where it shouldn't. Doing anything more involved with the resulting expression than simply printing the number of rows will usually result in a segfault or a failed assertion. So, is it possible to use maps in this way, and if so, what is the correct incantation? Any tips on how to fix this will be greatly appreciated. |
Moderator
|
the problem is that mymap returns a temporary while Map objects are currenty nested by reference... Honestly I don't see why Map objects are not nested by value, I'll investigate.
|
Registered Member
|
Right. That would explain the symptoms.
Thanks for looking into this! |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]