Skip to content

Commit 03f32db

Browse files
committed
Add package startup message, expand documentation
1 parent edfdfc7 commit 03f32db

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
useDynLib("RcppEigen", .registration=TRUE)
22

33
importFrom("Rcpp", "evalCpp")
4-
importFrom("utils", "packageDescription", "package.skeleton")
4+
importFrom("utils", "packageDescription", "package.skeleton", "packageVersion")
55
importFrom("stats", "model.frame", "model.matrix", "model.response", "fitted", "coef", "printCoefmat", "pt", "na.omit")
66
export("fastLm",
77
"fastLmPure",

R/init.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,25 @@
3030
RcppEigen_throttle_cores(ncores)
3131
}
3232

33-
##' Throttle (or Reset) (Rcpp)Eigen to Two Cores
33+
.onAttach <- function(libname, pkgname) {
34+
if (interactive()) {
35+
packageStartupMessage("RcppEigen ", packageVersion("RcppEigen"),
36+
" using ", .pkgenv[["nb_threads"]], " cores. See ",
37+
"'help(\"RcppEigen-package\")' for details.")
38+
}
39+
}
40+
41+
##' Throttle (or Reset) (Rcpp)Eigen Core Usage
3442
##'
3543
##' Helper functions to throttle use of cores by RcppEigen-internal code.
3644
##' On package load, the initial value is saved and used to reset the value.
37-
##' @param n Integer value of desired cores, default is two
45+
##' @param n Integer value of desired cores, default is the value set at package
46+
##' startup reflecting the smallest value among the total number of available
47+
##' cores (or one if compiled without OpenMP support), the value of option
48+
##' \code{Ncpus} and the value of environment variable \code{OMP_THREAD_LIMIT}.
3849
##' @return Only \code{EigenNbThreads()} returns a value, the current value of
39-
##' the number of cores used. The other functions are invoked for their side-effect
40-
##' of affecting the core count.
50+
##' the number of cores used. The other functions are invoked for their side
51+
##' effect of affecting the count of cores used.
4152
##' @seealso \code{\link{RcppEigen-package}}
4253
RcppEigen_throttle_cores <- function(n) {
4354
if (missing(n)) n <- .pkgenv[["nb_threads"]]

man/RcppEigen_throttle_cores.Rd

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)