9 #include <R_ext/Utils.h>
35 virtual const char*
what()
const throw() {
51 R_CheckUserInterrupt();
80 int n_cycles = Rcpp::as<int>(n);
81 int interrupt_check_frequency = Rcpp::as<int>(frequency);
84 bool interrupt =
false;
88 #pragma omp parallel for \
89 shared(interrupt_check_frequency, n_cycles, interrupt) \
92 for (
int i=0; i<n_cycles; i+=interrupt_check_frequency) {
99 if (omp_get_thread_num() == 0)
106 int j_end =
std::min(i+interrupt_check_frequency, n_cycles);
107 for (
int j=i; j<j_end; ++j) {
108 double summand = 1.0 / (double)(2*j + 1);
interrupt_exception(std::string message)
virtual const char * what() const
std::string detailed_message
virtual ~interrupt_exception()
traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type min(InputIterator begin, InputIterator end)
SEXP wrap(const Date &date)
RcppExport SEXP PiLeibniz(SEXP n, SEXP frequency)
static void check_interrupt_impl(void *)