Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
For below example script, our update-in-place rewrite mistakenly marked v for update in place. This can be fixed by simply excluding variables that are not in liveout of a statement block, which excludes local variables.
QfromH = function(Matrix[double] H) return(Matrix[double] Q) { m = nrow(H); n = ncol(H); ones = matrix(1, m, 1); eye = diag(ones); Q = eye[,1:n]; for (j in n:1) { v = H[j:m,j] b = as.scalar(2/(t(v) %*% v)) Q[j:m, j:n] = Q[j:m, j:n] - (b * v) %*% (t(v) %*% Q[j:m, j:n]) } }