Hi,
the last line already compiles fine in the default branch. The main problem for the first failing example is that in:
m + (-Array3f(5.0f))
operator+ is called with an _expression_ object, not an Array3f. Therefore, it follows the wrong overload of operator+ that is trying to add the coefficients of 'm' with the coefficients of 'Array3f(5.0f)'. This triggers a scalar mismatch (Array3f versus float), and also a size mismatch (2x2 versus 3x1). You would have the same issue whenever the scalar is an _expression_, like:
m + 2*v
The general workaround consists in evaluating the _expression_ into an Array3f, e.g.:
m + (2*v).eval()
or
m + Array3f(2*v)
I'm not sure this can be properly fixed on our side.
Best,
Gael.