JuliaLang/julia — pull request #7806 by Jutho (2014-08-01 13:20:01+00:00)
Title: uniformize the orglq orgqr methods, and ormlq ormqr

Small 'fixes' (rather: more uniform calling convention) for the qr and lq calls in lapack.jl:
* calling convention of `orgqr!` and `orglq!`:

The latter had a required argument `k::Int`, whereas the former had a default value in the function body, that could not be changed. Now they both have an optional argument with default value and a consistency check in the function body.
* return type of `orgqr!` and `orglq!`:

Both returned a slice of the return matrix, even if this slice was the complete matrix (which is the usual case). This results in an extra copy, which is typically unnecessary.
* calling convention of `ormqr!` and `ormlq!`:

The latter had a required argument `k::Int`, whereas the former had a default value in the function body. Since this argument was not in the final position, and it would be very rare that one would like to use a value different from the default, I just added the default value to `ormlq!` and removed it from the argument list.

None of these methods are used by the user-exposed linalg methods, since LQ factorisation is not yet available, and QR factorisation uses the more recent `geqrt` or `qeqpf` methods instead of the `geqrf` method, to which the aforementioned qr methods belong).