@@ -455,7 +455,7 @@ fit_poisson_nmf <- function (X, k, fit0, numiter = 100,
455455 cat(sprintf(" Running at most %d %s updates, %s extrapolation " ,
456456 numiter ,method.text ,
457457 ifelse(control $ extrapolate ," with" ," without" )))
458- cat(" (fastTopics 0.7-41 ).\n " )
458+ cat(" (fastTopics 0.7-42 ).\n " )
459459 }
460460
461461 # INITIALIZE ESTIMATES
@@ -554,7 +554,9 @@ fit_poisson_nmf_main_loop <- function (X, fit, numiter, update.factors,
554554 progress [i ," loglik.multinom" ] <-
555555 loglik.const - fit $ loss - sum(loglik_size_factors(X ,fit $ F ,fit $ L ))
556556 progress [i ," dev" ] <- dev.const + 2 * fit $ loss
557- res <- with(poisson_nmf_kkt(X ,fit $ F ,fit $ L ),
557+ res <- with(poisson_nmf_kkt(X ,fit $ F ,fit $ L ,
558+ version = ifelse(control $ nc == 1 ,
559+ " Rcpp" ," RcppParallel" )),
558560 max(abs(rbind(F [update.factors ,],
559561 L [update.loadings ,]))))
560562 progress [i ," res" ] <- res
@@ -647,7 +649,9 @@ update_poisson_nmf <- function (X, fit, update.factors, update.loadings,
647649
648650 # Compute the value of the objective ("loss") function at the updated
649651 # estimates.
650- fit $ loss <- sum(cost(X ,fit $ L ,t(fit $ F ),control $ eps ))
652+ fit $ loss <- sum(cost(X ,fit $ L ,t(fit $ F ),control $ eps ,
653+ version = ifelse(control $ nc == 1 ,
654+ " Rcpp" ," RcppParallel" )))
651655 fit $ loss.fnly <- fit $ loss
652656
653657 # Output the updated "fit".
@@ -697,7 +701,9 @@ update_poisson_nmf_extrapolated <- function (X, fit, update.factors,
697701 # Compute the value of the objective (loss) function at the
698702 # extrapolated solution for the loadings (Ly) and the
699703 # non-extrapolated solution for the factors (Fn).
700- fit $ loss.fnly <- sum(cost(X ,fit $ Ly ,t(Fn ),control $ eps ))
704+ fit $ loss.fnly <- sum(cost(X ,fit $ Ly ,t(Fn ),control $ eps ,
705+ version = ifelse(control $ nc == 1 ,
706+ " Rcpp" ," RcppParallel" )))
701707
702708 # Update the extrapolation parameters following Algorithm 3 of
703709 # Ang & Gillis (2019).
0 commit comments