|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Two matrix-like carriers can be added iff they share shape and scalar type. More...
Two matrix-like carriers can be added iff they share shape and scalar type.
Matrix addition requires the two operands to share row count, column count, and scalar type. Matrix multiplication requires the inner dimensions to agree: an m × k matrix composed with a k × n matrix produces an m × n result. These predicates express the ideal type- checking rule: you cannot add or multiply two matrices whose shapes are incompatible — the expression should not even compile.
For the current Matrix2x2V<T> the rule is enforced structurally (the operators are signed with a fixed shape), but expressing it as a concept generalises cleanly to future MatrixMxN<T, M, N> carriers and lets the rule be asserted at use sites.