Algorithms for the equilibration of matrices and their application to limited-memory quasi-newton methods