22 #ifndef Rcpp__stats__random_random_h
23 #define Rcpp__stats__random_random_h
59 if (ISNAN(
mean) || !R_FINITE(
sd) ||
sd < 0.){
62 }
else if (
sd == 0. || !R_FINITE(
mean)){
65 bool sd1 =
sd == 1.0 ;
66 bool mean0 =
mean == 0.0 ;
84 }
else if ( !R_FINITE(
mean)){
87 bool mean0 =
mean == 0.0 ;
109 if (ISNAN(location) || !R_FINITE(scale) || scale < 0)
112 if (scale == 0. || !R_FINITE(location))
122 if (!R_FINITE(location))
138 double scale = 1.0 / rate ;
139 if (!R_FINITE(scale) || scale <= 0.0) {
152 if (ISNAN(n1) || ISNAN(n2) || n1 <= 0. || n2 <= 0.)
154 if( R_FINITE( n1 ) && R_FINITE( n2 ) ){
156 }
else if( ! R_FINITE( n1 ) && ! R_FINITE( n2 ) ){
158 }
else if( ! R_FINITE( n1 ) ) {
166 if (!R_FINITE(a) || !R_FINITE(scale) || a < 0.0 || scale <= 0.0) {
175 if (!R_FINITE(a) || a < 0.0 ) {
184 if (!R_FINITE(p) || p <= 0 || p > 1)
194 if (ISNAN(meanlog) || !R_FINITE(sdlog) || sdlog < 0.){
197 }
else if (sdlog == 0. || !R_FINITE(meanlog)){
205 if (ISNAN(meanlog) ){
208 }
else if ( !R_FINITE(meanlog)){
220 if (ISNAN(location) || !R_FINITE(scale))
223 if (scale == 0. || !R_FINITE(location))
230 if (ISNAN(location) )
233 if (!R_FINITE(location))
244 if(!R_FINITE(siz) || !R_FINITE(prob) || siz <= 0 || prob <= 0 || prob > 1)
252 if(!R_FINITE(siz) || !R_FINITE(mu) || siz <= 0 || mu < 0)
259 if (!R_FINITE(
df) || !R_FINITE(lambda) ||
df < 0. || lambda < 0.)
269 if (!R_FINITE(
df) ||
df < 0. )
284 if (ISNAN(
df) ||
df <= 0.0)
312 if (!R_FINITE(shape) || !R_FINITE(scale) || shape <= 0. || scale <= 0.) {
321 if (!R_FINITE(shape) || shape <= 0. ) {
double df(double x, double df1, double df2, int lg)
void exp(InputIterator begin, InputIterator end, OutputIterator out)
Vector< REALSXP > NumericVector
NumericVector rexp(int n, double rate)
NumericVector rnbinom(int n, double siz, double prob)
NumericVector rsignrank(int n, double nn)
NumericVector rf(int n, double n1, double n2)
NumericVector rchisq(int n, double df)
NumericVector rnchisq(int n, double df, double lambda)
NumericVector runif(int n, double min, double max)
sugar::Sd< REALSXP, NA, T > sd(const VectorBase< REALSXP, NA, T > &t)
NumericVector rcauchy(int n, double location, double scale)
NumericVector rbinom(int n, double nin, double pp)
sugar::Mean< REALSXP, NA, T > mean(const VectorBase< REALSXP, NA, T > &t)
NumericVector rgeom(int n, double p)
NumericVector rnorm(int n, double mean, double sd)
NumericVector rpois(int n, double mu)
NumericVector rbeta(int n, double a, double b)
NumericVector rlogis(int n, double location, double scale)
sugar::Max< RTYPE, NA, T > max(const VectorBase< RTYPE, NA, T > &x)
NumericVector rlnorm(int n, double meanlog, double sdlog)
NumericVector rnbinom_mu(int n, double siz, double mu)
NumericVector rgamma(int n, double a, double scale)
NumericVector rweibull(int n, double shape, double scale)
NumericVector rwilcox(int n, double mm, double nn)
NumericVector rt(int n, double df)
NumericVector rhyper(int n, double nn1, double nn2, double kk)
sugar::Min< RTYPE, NA, T > min(const VectorBase< RTYPE, NA, T > &x)