Skip to content

Inverting a square matrix using solve() with LAPACK=TRUE (PR#13765)

1 message · Peter Dalgaard

#
rvaradhan at jhmi.edu wrote:
Thanks, but there seems to be a much easier fix.

Inside coef.qr, we have

coef[qr$pivot, ] <-
.Call("qr_coef_real", qr, y, PACKAGE = "base")[seq_len(p)]

which should be [seq_len(p),]

(otherwise, in the matrix case, the RHS will recycle only the 1st p 
elements, i.e., the 1st column).