I think the reason it has the extra parameter is that a lot of algorithm cutoffs are based on the number of elements in the matrix, so being able to get that directly from the type domain probably saves a multiplication in a decent number of places.
This may be a nice incidental advantage to having L
(… though constant propagation could make the point of such benefits moot?) but I think the fundamental reason is that an SMatrix{N,M,...}
is backed by an NTuple{N*M, ...}
: since you can’t currently do arithmetic with type parameters/TypeVar
s (#18466) in struct constructors, this forces the existence of the otherwise redundant L
.