Matrix behaviour: assignment to scalar
I'm working on a little matrix library. But now I'm faced with a tricky interface question.
Assigning a matrix to a scalar, does it make more sense to
(A) set every element of the matrix to that value?
(B) set the diagonals to that value, and the rest to zero?
From a mathematical standpoint (B) seems logical. But thinking of actual use cases (A) might make better sense.
Or maybe do (B) for square matrices and (A) for non-square ones? I don't know, that could be confusing too!