A-C implementation in "C". Tight-packed (interleaved) state transition matrix -- as fast as it gets, as small as it gets.