By default this uses Householder transformations with R's LINPACK-style limited column pivoting: columns that
are (nearly) linearly dependent on earlier ones, as judged by tol, are moved to the right end and the rank is
reduced. With lapack: true it uses LAPACK-style column pivoting (R's LAPACK = TRUE).
The default method throws on NaN or infinite values. With lapack: true, such input does not throw and the
result may differ from R's (which is not meaningful either).
// Least-squares fit of y on an intercept and x constq = qr([[1, 1], [1, 2], [1, 3], [1, 4]]); q.rank; // 2 qrCoef(q, [2.1, 3.9, 6.2, 7.8]); // [0.15, 1.94] (up to rounding)
QR decomposition. Equivalent to R's
qr().By default this uses Householder transformations with R's LINPACK-style limited column pivoting: columns that are (nearly) linearly dependent on earlier ones, as judged by
tol, are moved to the right end and the rank is reduced. Withlapack: trueit uses LAPACK-style column pivoting (R'sLAPACK = TRUE).The default method throws on
NaNor infinite values. Withlapack: true, such input does not throw and the result may differ from R's (which is not meaningful either).