Given matrices , , , glssoln computes such that
is minimized.
This is accomplished by first computing the Choleski decomposition of :
One then solves for in the equation
This is accomplished by means of a singular-value decomposition of .
The resulting then satisfies
where the entries of are the residuals.