JuliaLang/julia — pull request #1376 by andreasnoackjensen (2012-10-13 15:02:13+00:00)
Title: Added xgelsd for solving rank deficient least squares problems.

The Lapack subroutine gels does not allow rank deficient matrices but gelsd does which is sometimes useful. This is also closer to Matlab behaviour. An example

julia> mX=[ones(10) 1:10 1:10];

julia> mY=eye(5,2)[:];

julia> mX\mY
3-element Float64 Array:
-0.0
-1.00185e15
1.00185e15

julia> mX[:,1:2]\mY
2-element Float64 Array:
0.4
-0.0363636

julia> Lapack.gelsd!(copy(mX), copy(mY))[1]
3-element Float64 Array:
0.4
-0.0181818
-0.0181818

Should "\" call gelsd?