Skip to content

Commit 525dce5

Browse files
committed
do_getF: resid needs allocated storage even if it is not used dqrsl
We use the same dqrsl.f call for FIT and FIT+RESID, and although resid is only needed with RESID we do refenrence that in the dqrsl call and therefore it needs allocated storage. Altenrative would use different dqrsl calls for qrkind FIT+RESID and FIT.
1 parent 028a416 commit 525dce5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/getF.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,7 @@ SEXP do_getF(SEXP perms, SEXP E, SEXP QR, SEXP QZ, SEXP effects,
331331
}
332332

333333
double *fitted = (double *) R_alloc(nr * nc, sizeof(double));
334-
/* separate resid needed only in some cases */
335-
double *resid;
336-
if (PARTIAL || FIRST)
337-
resid = (double *) R_alloc(nr * nc, sizeof(double));
334+
double *resid = (double *) R_alloc(nr * nc, sizeof(double));
338335
/* work array and variables for QR decomposition */
339336
double *qty = (double *) R_alloc(nr, sizeof(double));
340337
double dummy[1] = {0.0};

0 commit comments

Comments
 (0)