We need a true Identity expression
@ggael
Submitted by Gael GuennebaudAssigned to Nobody
Link to original bugzilla bug (#112)
Version: 3.0
Description
This is a proposal for a pure Identity expression which would not be based on CwiseNullary anymore (this a really inefficient way of implementing Identity).
The Identity object should be generic, not limited to DenseObject. It should have generic operator* returning its argument.
One question is do we want to support rectangular Identity objects? Currently we do, but is there any use cases? If so, operator* would not always return its argument directly but a sub block. This means that we should be able to specify at compile time the Identity object is squared even if its size is dynamic. Perhaps two objects: Identity and RectangularIdentity.
Implementation wise, DiagonalMatrixBase is a good start for the square case.
Regarding sizes, it would be very convenient to be able to instantiate some objects without specific size. This concern Identity of course, but also all CwiseNullary expressions. Indeed, in many (all ?) cases you don't have to specify the dimensions of such kind of objects which can be deduced from the context. To go even further, at least in the case of Identity, the scalar type is useless too, so we could even have a unique Identity object with no size and no scalar type. Dimensions can be needed only if you want a rectangular identity object, and in this case RectangularIdentity<> would do the job.
So far so good, but of course the big issue now is how to implement that without intrusive changes everywhere in our traits class...