Rcpp Version 1.0.9
|
Go to the source code of this file.
Classes | |
class | interrupt_exception |
Functions | |
static void | check_interrupt_impl (void *) |
bool | check_interrupt () |
RcppExport SEXP | PiLeibniz (SEXP n, SEXP frequency) |
|
inline |
Call this method to check for user interrupts. This is based on the results of a discussion on the R-devel mailing list, suggested by Simon Urbanek.
Definition at line 64 of file piWithInterrupts.cpp.
References check_interrupt_impl().
Referenced by PiLeibniz().
|
inlinestatic |
Do the actual check for an interrupt.
[in] | dummy | Dummy argument. |
Definition at line 50 of file piWithInterrupts.cpp.
Referenced by check_interrupt().
RcppExport SEXP PiLeibniz | ( | SEXP | n, |
SEXP | frequency | ||
) |
Compute pi using the Leibniz formula (a very inefficient approach).
[in] | n | Number of summands |
[in] | frequency | Check for interrupts after every frequency loop cycles. |
Definition at line 75 of file piWithInterrupts.cpp.
References BEGIN_RCPP, check_interrupt(), END_RCPP, Rcpp::algorithm::min(), and Rcpp::wrap().