问题
I do want to write a custom nullary-expression in Eigen3, which is modifyable. As described in the Eigen documentation it seems like nullary-expression are not modifiable. Is there an easy way to get something like a modifyable custom nullary-expression?
I would like to use it to write a custom data wrapper.
回答1:
Nullary-expressions are indeed read-only. For read-write expressions, you currently has to write your own expression. To this end you can start with this tutorial and take inspiration from the implementation of the Transpose
expression in Eigen.
来源:https://stackoverflow.com/questions/41034309/modifying-values-of-nullary-expressions-using-eigen