Algebra.MatrixDense matrix algebra parameterised over a semiring.
Matrices are stored row-major in a flat s array. All arithmetic uses the semiring operations (⊕ and ⊗) rather than field operations, so this module works over any Semiring.T, including Boolean, tropical, and bottleneck semirings.
Used by WFA.Make to represent the automaton matrices and by Learner.Angluin for the observation table.