Add rmax option to matrix class