Skip to content

Commit ba6df2c

Browse files
committed
version 0.3.4 - fix cran error due to bug in vignette
1 parent 5d0b8f6 commit ba6df2c

File tree

1 file changed

+4
-48
lines changed

1 file changed

+4
-48
lines changed

R/boot_algo2.R

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -199,30 +199,9 @@ boot_algo2 <- function(preprocessed_object, boot_iter, point_estimate, impose_nu
199199
S_diag_XinvXXRu_S_b <- Matrix.utils::aggregate.Matrix(diag_XinvXXRuS_b, clustid[x])
200200
K_b <- S_diag_XinvXXRu_S_b - tcrossprod(SXinvXXrX_invXX, SuXb)
201201

202-
bigstatsr <- FALSE
203-
if(bigstatsr == FALSE){
204-
C <- eigenMapMatMult(as.matrix(K_a), v, nthreads)
205-
D <- eigenMapMatMult(as.matrix(K_b), v, nthreads)
206-
} else if(bigstatr == TRUE){
202+
C <- eigenMapMatMult(as.matrix(K_a), v, nthreads)
203+
D <- eigenMapMatMult(as.matrix(K_b), v, nthreads)
207204

208-
# matrix multiplication via bigstatsr
209-
C_fbm <- FBM(dim(K_a)[1], B)
210-
D_fbm <- FBM(dim(K_b)[1], B)
211-
# C
212-
big_apply(C, a.FUN = function(C_fbm, ind, K_a, v) {
213-
C_fbm[, ind] <- tcrossprod(K_a, v[ind, ])
214-
NULL ## you don't want to return anything here
215-
}, a.combine = 'c', ncores = nthreads, K_a = K_a, v = v)
216-
# D
217-
big_apply(D, a.FUN = function(D_fbm, ind, K_b, v) {
218-
D_fbm[, ind] <- tcrossprod(K_b, v[ind, ])
219-
NULL ## you don't want to return anything here
220-
}, a.combine = 'c', ncores = nthreads, K_b = K_b, v = v)
221-
222-
C <- C_fbm[]
223-
D <- D_fbm[]
224-
225-
}
226205

227206
CC[[x]] <- colSums(C * C)
228207
DD[[x]] <- colSums(D * D)
@@ -249,32 +228,9 @@ boot_algo2 <- function(preprocessed_object, boot_iter, point_estimate, impose_nu
249228
S_diag_XinvXXRu_S_b <- S_diag_XinvXXRu_S_b - prod_b
250229
K_b <- S_diag_XinvXXRu_S_b - tcrossprod(SXinvXXrX_invXX, SuXb)
251230

252-
bigstatsr <- FALSE
253-
if(bigstatsr == FALSE){
254-
255-
C <- eigenMapMatMult(as.matrix(K_a), v, nthreads)
256-
D <- eigenMapMatMult(as.matrix(K_b), v, nthreads)
257-
258-
} else if(bigstatr == TRUE){
259-
260-
# matrix multiplication via bigstatsr
261-
C_fbm <- FBM(dim(K_a)[1], B)
262-
D_fbm <- FBM(dim(K_b)[1], B)
263-
# C
264-
big_apply(C, a.FUN = function(C_fbm, ind, K_a, v) {
265-
C_fbm[, ind] <- tcrossprod(K_a, v[ind, ])
266-
NULL ## you don't want to return anything here
267-
}, a.combine = 'c', ncores = nthreads, K_a = K_a, v = v)
268-
# D
269-
big_apply(D, a.FUN = function(D_fbm, ind, K_b, v) {
270-
D_fbm[, ind] <- tcrossprod(K_b, v[ind, ])
271-
NULL ## you don't want to return anything here
272-
}, a.combine = 'c', ncores = nthreads, K_b = K_b, v = v)
273-
274-
C <- C_fbm[]
275-
D <- D_fbm[]
231+
C <- eigenMapMatMult(as.matrix(K_a), v, nthreads)
232+
D <- eigenMapMatMult(as.matrix(K_b), v, nthreads)
276233

277-
}
278234
CC[[x]] <- colSums(C * C)
279235
DD[[x]] <- colSums(D * D)
280236
CD[[x]] <- colSums(C * D)

0 commit comments

Comments
 (0)