Should output be automatically resized? Or should the user provide a correctly sized output?
The issue is if the resize is done automatically it is silent and may not be what the user expects. However, manually specifying sizes is tedious.
Examples:
Resize automatically
SparseMatrix A = GetAFromSomeWhere();
DenseMatrix B = GetBFromSomeWhere();
DenseMatrix C;
A.Mult(B, C);
Resize required by user
SparseMatrix A = GetAFromSomeWhere();
DenseMatrix B = GetBFromSomeWhere();
// DenseMatrix C; // Should fail assertion
DenseMatrix C(A.Rows(), B.Cols());
A.Mult(B, C);
Should output be automatically resized? Or should the user provide a correctly sized output?
The issue is if the resize is done automatically it is silent and may not be what the user expects. However, manually specifying sizes is tedious.
Examples:
Resize automatically
Resize required by user