Skip to content

Commit

Permalink
Update docs (c.f. #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstub committed Apr 27, 2024
1 parent 2a18894 commit c5c07e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions R/dqset.seed.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#' according to a uniform, normal and exponential distribution. These
#' functions are modeled after the \code{base} functions
#' \code{\link{set.seed}}, \code{\link{RNGkind}}, \code{\link{runif}},
#' \code{\link{rnorm}}, and \code{\link{rexp}}.
#' \code{\link{rnorm}}, and \code{\link{rexp}}. However, note that the functions
#' provided here do not accept vector arguments for the number of observations
#' as well as the parameters describing the distribution functions. Please see
#' \code{\link{register_methods}} if you need this functionality.
#'
#' \code{dqrrademacher} uses a fast algorithm to generate random
#' Rademacher variables (-1 and 1 with equal probability). To do so, it
Expand Down Expand Up @@ -36,7 +39,7 @@
#' \item{pcg64}{The default 64 bit variant from the PCG family developed by
#' Melissa O'Neill. See \url{https://www.pcg-random.org/} for more details.}
#' \item{Xoroshiro128++ and Xoshiro256++}{RNGs developed by David Blackman and
#' Sebastiano Vigna. See \url{https://xoshiro.di.unimi.it/} for more details.
#' Sebastiano Vigna. See \url{https://prng.di.unimi.it/} for more details.
#' The older generators Xoroshiro128+ and Xoshiro256+ should be used only for
#' backwards compatibility.}
#' \item{Threefry}{The 64 bit version of the 20 rounds Threefry engine as
Expand Down
7 changes: 5 additions & 2 deletions man/dqrng-functions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/cpp-api.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Rcpp::XPtr<dqrng::random_64bit_generator> dqrng::get_rng()

Direct usage of this method is **discouraged**. The prefered way of accesing the global RNG is to instantiate `dqrng::random_64bit_accessor` within your function. Note that you MUST NOT delete the global RNG. Using `dqrng::random_64bit_accessor` makes this impossible. In addition, you SHOULD NOT store a reference to the RNG permanently, because it can be invalidated by calls to `dqRNGkind`. Therefore, instances of `dqrng::random_64bit_accessor` SHOULD be stored as (non-static) variables in functions.

Note that `dqrng::random_64bit_accessor` supports [UniformRandomBitGenerator](https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator) and can therefore be used together with any C++11 distribtion function. In addition, the follwing functions are supported, since they are inherited from the abstract parent class `random_64bit_generator`:
Note that `dqrng::random_64bit_accessor` supports [UniformRandomBitGenerator](https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator) and can therefore be used together with any C++11 distribtion function. In addition, the following functions are supported, since they are inherited from the abstract parent class `random_64bit_generator`:

```cpp
// clone RNG and select a different stream
Expand Down Expand Up @@ -178,4 +178,4 @@ generate<Dist>(start, end, param1, ... paramN)
: A container that is to be filled with variates from the distribution function. Needs to support `std::begin` and `std::end`.
`start, end`
: Forward iterators pointing to start and end of a range to be filled with variates from the distribution function.
: Forward iterators pointing to start and end of a range to be filled with variates from the distribution function.

0 comments on commit c5c07e5

Please sign in to comment.