SMS: Combinatorial matrix theory