Re: [eigen] Conversion to DenseCoeffsBase yields unexpected behaviour |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Conversion to DenseCoeffsBase yields unexpected behaviour
- From: Joseph Mirabel <joseph.mirabel@xxxxxxx>
- Date: Tue, 28 Jul 2020 12:04:57 +0200
- Autocrypt: addr=joseph.mirabel@xxxxxxx; 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 CgsEFgIDAQIeAQIXgAUCWDRzIgIZAQAKCRCwR5VH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as argument, always. Replace the
argument by `const Eigen::DenseCoeffsBase<...>&`.
See https://eigen.tuxfamily.org/dox/TopicFunctionTakingEigenTypes.html
for details.
Joseph
On 28/07/2020 12:00, Janos Meny wrote:
> Hey Eigen community,
> I was trying to write a function taking in any eigen expression which
> has direct memory access. That is I am looking for the expression type
> which has access to a memory location and associated size and stride
> information. I think the correct type for this should be
> Eigen::DenseCoeffsBase<Derived, Eigen::DirectWriteAccess>. Am I right
> in assuming so? Unfortunately casting an derived type into this
> expression is resulting dangling references, see e.g
> https://godbolt.org/z/KPdcoG. Can someone point me out what I am doing
> wrong?
> cheers
> Janos Meny