#### Factorising a unimodular matrix

This program expresses a unimodular matrix A = ≠ or U_{0} = , with non-negative coefficients, as a product of the type
P, U_{0}P, PU_{0}, or U_{0}PU_{0}, where P is a product of matrices of the form U_{c} = , c > 0.

The representation is unique. (See Kjell Kolden, *Continued fractions and linear substitutions*, Arch. Math. Naturvid. 50 (1949), 141-196.)
While r > 0 and s > 0, we repeatedly use the identity

where d = min([p/r],[q/s]).

The process eventually stops, either because r = 0, in which case we reach U_{q}U_{0},

or because s=0, in which case we reach U_{p}.

This is a BCMATH translation of a BC program.

*Last modified 24th June 2010*

Return to main page