Numerical integration of a class of ordinary differential equation on the general linear group of matrices