The design of multi-configuration optical systems leads to the minimization of a merit function whose terms are most conveniently evaluated in groups. The Jacobian or difference matrix associated with these merit functions can be decomposed into blocks corresponding to these groups. The associated constrained least-squares problem can be solved without requiring that more than two or three blocks be in high-speed memory at one time. The algorithm described here is useful for lens-design programs running on mini-computers where high-speed memory is limited but medium-speed storage such as disc is available. An orthogonal factorization of the matrix is obtained so that rank-deficient problems can be handled in a consistent and numerically stable manner. This factorization can be used as an adjunct to a variety of least-squares type algorithms.