#include <R.h>
#include <Rmath.h>
#include <Rdefines.h>
#include <assert.h>
Go to the source code of this file.
|
#define | R_NO_REMAP |
|
#define | err(...) Rf_errorcall(R_NilValue,__VA_ARGS__) |
|
#define | warn(...) Rf_warningcall(R_NilValue,__VA_ARGS__) |
|
#define | rprint(S) Rprintf("%s\n",(S).c_str()) |
|
◆ err
#define err |
( |
|
... | ) |
Rf_errorcall(R_NilValue,__VA_ARGS__) |
◆ R_NO_REMAP
◆ rprint
#define rprint |
( |
|
S | ) |
Rprintf("%s\n",(S).c_str()) |
◆ warn
#define warn |
( |
|
... | ) |
Rf_warningcall(R_NilValue,__VA_ARGS__) |
◆ name_t
◆ raw_t
◆ slate_t
◆ random_integer()
static int random_integer |
( |
int |
n | ) |
|
|
inlinestatic |
Definition at line 48 of file internal.h.
49 return (
int) floor(R_unif_index((
double)
n));
◆ random_sample_wo_repl()
static void random_sample_wo_repl |
( |
int * |
samples, |
|
|
int |
N, |
|
|
int |
n |
|
) |
| |
|
inlinestatic |
Definition at line 53 of file internal.h.
56 while (m <
n && k <
N) {
static int random_integer(int n)
◆ rcateg()
static int rcateg |
( |
double |
erate, |
|
|
double * |
rate, |
|
|
int |
nrate |
|
) |
| |
|
inlinestatic |
Definition at line 76 of file internal.h.
77 double u = erate*unif_rand();
79 while (u > rate[e] && e <
nrate) {
81 err(
"in '%s': invalid rate rate[%d]=%lg",__func__,e,rate[e]);
◆ set_list_elem()
static int set_list_elem |
( |
SEXP |
list, |
|
|
SEXP |
names, |
|
|
SEXP |
element, |
|
|
const char * |
name, |
|
|
int |
pos |
|
) |
| |
|
inlinestatic |
Definition at line 66 of file internal.h.
71 SET_ELEMENT(list,pos,element);
72 SET_STRING_ELT(names,pos,Rf_mkChar(name));