Re: [eigen] Maximum size at compile time |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Maximum size at compile time
- From: Joseph Mirabel <joseph.mirabel@xxxxxxx>
- Date: Thu, 17 May 2018 15:37:07 +0200
- Autocrypt: addr=joseph.mirabel@xxxxxxx; prefer-encrypt=mutual; keydata= xsFNBFgtiuYBEACcxg4wIs9+2CwLJzChODHxhe1M4dgi+n+5A6y6MppRgvm7QYCSrE8kDk8Z xuQZoKNnytdg+ZD6BLRVlB65XC6spamjhkEVEcOWPLA5VjCon0bAwYPXlxUoV5TTz1c59xfa 5pYwAxFncuOb8FGl1qqyXXvAvY0Fby5lxXrzWo2UzwXcr+22Ex6DoKaWaDWkxC6z6f92J5Pf hIRDBZUa4w7yeZZWAaq7Tr65mkf80+OkHtN420VO8LwM0mrfu5BT42X99RJ4XEQZXIeaSozi 3O23QYgl4YSWWxH1fKQvX+R/q74dvrcMjpqfR7ZzKpijOIlcnJbW7bAjXEgBd0KXYS+OlGp5 wFV4WRyCUThCv6s8W0BnFKUUFp28cOHWZzCuljbA7cc1/YHHGNg0Dc4dkhDX68+88a3cjpwi 5WCh+3HjZ+hnig1UxmVRX+27gwFUYt3xx/ywEW3XOjGndTVrfPUWNAS/Fh8DusUdBvUaT91E YXE7l3hHNikGMU7XUhM59d6UP9VN3SQrtlcZJbIsF3R1St45PiYIwbEy8BAV42oKiQnTMFYV G9gl57/stsQ6Sf67CPMlrT7xJRmVokT4lx23RtskrvoTjvsf0lA7CW1i3Ts/DccAGavyK2lK cH9OE4D5EQrX0D/BK+v0I96Wj4AcU76uLRYVFHxUvmK51yy+EwARAQABzSFKb3NlcGggTWly YWJlbCA8am1pcmFiZWxAbGFhcy5mcj7CwYIEEwECACwCGyMFCQlmAYAHCwkIBwMCAQYVCAIJ CgsEFgIDAQIeAQIXgAUCWDRzIgIZAQAKCRCwR5VHUw1bmwa+D/oC+hiM77v9uz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:01, Adrien Escande wrote:
> Hi Joseph,
>
> we have the same issue in our lab, and each time I start a new project I
> kick myself for not pushing this feature during the Eigen3 beta.
> The use of Map is not really satisfactory and error prone.
I did not think about it.
> Most critically, there is no workaround for matrix decompositions, for which
> there will be reallocation whenever the size of the matrix changes.
> Basically, there would be a need of a memory management mode in which a
> reallocation occurs only if the new buffer needs to be bigger than the
> current one. For now, the size of the buffer is supposed to be
> row()*cols(), so we would need an additional integer to keep track of
> the buffer size separately from the matrix size, which would break the ABI.
My intent is to add a flag to the Option template argument of Matrix.
This will not break ABI compatibility since it will be two different C++
types.
I did not check carefully matrix decomposition classes. I expect them to
take as template parameter a matrix type which would then contain the
memory management flag.
The only issue I see with this method is the non-compatibility between
Matrix<EnableMaxSizeAtRunTime> and Matrix<! EnableMaxSizeAtRunTime>.
Maybe it is possible to play with cast operator to fix this issue.
>
> Joris Vaillant began to tackle the problem a few years ago, but the PR
> has never been completely finished:
> https://bitbucket.org/eigen/eigen/pull-requests/125/789-memory-allocation-only-when-necessary/diff
> Maybe we could try to put it back on rail.
>
Thanks for the link. I'll have a look. Before I put too much effort on
this, I will wait for a confirmation that a patch would be welcome.
Joseph