Matrix.Makemodule S : Semiring.Ttype s = S.tInternal representation: dimensions (rows, cols) and flat row-major array.
Internal representation: dimensions (rows, cols) and flat row-major array.
val zero : Base.int -> Base.int -> tzero r c returns the r×c zero matrix (all entries = S.zero).
val one : Base.int -> tone n returns the n×n identity matrix (diagonal = S.one, rest S.zero).
of_list r c lst constructs an r×c matrix from a flat row-major list. Raises a fatal error if List.length lst ≠ r * c.
of_cols cols assembles a list of m×1 column matrices into an m×n matrix.
set m i j v returns a copy of m with entry (i, j) replaced by v.
app_col m c appends column vector c to the right of matrix m, increasing the column count by 1. Used by Learner.Angluin to extend observation table rows with new suffix columns.
count ~f m counts the number of entries satisfying predicate f.
val dim : t -> Base.int * Base.intsolve basis vec returns coefficient vector c such that Σ_i c_i * basis_i = vec if one exists, or None. Enumerates all combinations of semiring elements (requires finite semiring via S.elements); used by Learner.Angluin for the closed-table check.
val hash : t -> Base.intval hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval to_string : t -> Base.stringval sexp_of_t : t -> Base.Sexp.t