Rcpp Version 1.1.2
Loading...
Searching...
No Matches
macros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define give_log   log_p
#define R_D__0   (log_p ? ML_NEGINF : 0.) /* 0 */
#define R_D__1   (log_p ? 0. : 1.) /* 1 */
#define R_DT_0   (lower_tail ? R_D__0 : R_D__1) /* 0 */
#define R_DT_1   (lower_tail ? R_D__1 : R_D__0) /* 1 */
#define R_D_Lval(p)
#define R_D_Cval(p)
#define R_D_val(x)
#define R_D_qIv(p)
#define R_D_exp(x)
#define R_D_log(p)
#define R_D_Clog(p)
#define R_Log1_Exp(x)
#define R_D_LExp(x)
#define R_DT_val(x)
#define R_DT_Cval(x)
#define R_DT_qIv(p)
#define R_DT_CIv(p)
#define R_DT_exp(x)
#define R_DT_Cexp(x)
#define R_DT_log(p)
#define R_DT_Clog(p)
#define R_DT_Log(p)
#define R_Q_P01_check(p)
#define R_Q_P01_boundaries(p, _LEFT_, _RIGHT_)
#define R_P_bounds_01(x, x_min, x_max)
#define R_P_bounds_Inf_01(x)
#define R_D_fexp(f, x)
#define R_D_forceint(x)
#define R_D_nonint(x)
#define R_D_negInonint(x)
#define R_D_nonint_check(x)

Macro Definition Documentation

◆ give_log

◆ R_D__0

◆ R_D__1

#define R_D__1   (log_p ? 0. : 1.) /* 1 */

Definition at line 28 of file macros.h.

◆ R_D_Clog

#define R_D_Clog ( p)
Value:
(log_p ? ::log1p(-(p)) : (0.5 - (p) + 0.5)) /* [log](1-p) */

Definition at line 40 of file macros.h.

◆ R_D_Cval

#define R_D_Cval ( p)
Value:
(lower_tail ? (0.5 - (p) + 0.5) : (p)) /* 1 - p */

Definition at line 34 of file macros.h.

◆ R_D_exp

#define R_D_exp ( x)
Value:
(log_p ? (x) : ::exp(x)) /* exp(x) */

Definition at line 38 of file macros.h.

Referenced by Rcpp::stats::p_exp_0(), and Rcpp::stats::pweibull_1().

◆ R_D_fexp

#define R_D_fexp ( f,
x )
Value:
(give_log ? -0.5*log(f)+(x) : exp(x)/sqrt(f))
#define give_log
Definition macros.h:24

Definition at line 116 of file macros.h.

◆ R_D_forceint

#define R_D_forceint ( x)
Value:
floor((x) + 0.5)

Definition at line 117 of file macros.h.

◆ R_D_LExp

#define R_D_LExp ( x)
Value:
(log_p ? R_Log1_Exp(x) : ::log1p(-x))
#define R_Log1_Exp(x)
Definition macros.h:43

Definition at line 46 of file macros.h.

◆ R_D_log

#define R_D_log ( p)
Value:
(log_p ? (p) : ::log(p)) /* log(p) */

Definition at line 39 of file macros.h.

◆ R_D_Lval

#define R_D_Lval ( p)
Value:
(lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */

Definition at line 33 of file macros.h.

◆ R_D_negInonint

#define R_D_negInonint ( x)
Value:
(x < 0. || R_D_nonint(x))
#define R_D_nonint(x)
Definition macros.h:118

Definition at line 120 of file macros.h.

◆ R_D_nonint

#define R_D_nonint ( x)
Value:
(fabs((x) - floor((x)+0.5)) > 1e-7)

Definition at line 118 of file macros.h.

◆ R_D_nonint_check

#define R_D_nonint_check ( x)
Value:
if(R_D_nonint(x)) { \
MATHLIB_WARNING("non-integer x = %f", x); \
return R_D__0; \
}
#define R_D__0
Definition macros.h:27

Definition at line 122 of file macros.h.

◆ R_D_qIv

#define R_D_qIv ( p)
Value:
(log_p ? ::exp(p) : (p)) /* p in qF(p,..) */

Definition at line 37 of file macros.h.

◆ R_D_val

#define R_D_val ( x)
Value:
(log_p ? ::log(x) : (x)) /* x in pF(x,..) */

Definition at line 36 of file macros.h.

Referenced by Rcpp::stats::punif_0().

◆ R_DT_0

◆ R_DT_1

#define R_DT_1   (lower_tail ? R_D__1 : R_D__0) /* 1 */

Definition at line 30 of file macros.h.

Referenced by Rcpp::stats::pnorm_0(), Rcpp::stats::pnorm_1(), and Rcpp::stats::punif_0().

◆ R_DT_Cexp

#define R_DT_Cexp ( x)
Value:
R_D_exp(R_D_Cval(x)) /* exp(1 - x) */
#define R_D_exp(x)
Definition macros.h:38
#define R_D_Cval(p)
Definition macros.h:34

Definition at line 60 of file macros.h.

◆ R_DT_CIv

#define R_DT_CIv ( p)
Value:
(log_p ? (lower_tail ? -expm1(p) : ::exp(p)) \
: R_D_Cval(p))

Definition at line 56 of file macros.h.

◆ R_DT_Clog

#define R_DT_Clog ( p)
Value:
(lower_tail? R_D_LExp(p): R_D_log(p))/* log(1-p) in qF*/
#define R_D_LExp(x)
Definition macros.h:46
#define R_D_log(p)
Definition macros.h:39

Definition at line 63 of file macros.h.

Referenced by Rcpp::stats::q_exp_0(), and Rcpp::stats::qweibull_1().

◆ R_DT_Cval

#define R_DT_Cval ( x)
Value:
(lower_tail ? R_D_Clog(x) : R_D_val(x))
#define R_D_val(x)
Definition macros.h:36
#define R_D_Clog(p)
Definition macros.h:40

Definition at line 49 of file macros.h.

◆ R_DT_exp

#define R_DT_exp ( x)
Value:
R_D_exp(R_D_Lval(x)) /* exp(x) */
#define R_D_Lval(p)
Definition macros.h:33

Definition at line 59 of file macros.h.

◆ R_DT_Log

#define R_DT_Log ( p)
Value:
(lower_tail? (p) : R_Log1_Exp(p))

Definition at line 64 of file macros.h.

◆ R_DT_log

#define R_DT_log ( p)
Value:
(lower_tail? R_D_log(p) : R_D_LExp(p))/* log(p) in qF */

Definition at line 62 of file macros.h.

◆ R_DT_qIv

#define R_DT_qIv ( p)
Value:
(log_p ? (lower_tail ? ::exp(p) : - ::expm1(p)) \
: R_D_Lval(p))

Definition at line 52 of file macros.h.

Referenced by Rcpp::stats::qunif_0(), and Rcpp::stats::qunif_1().

◆ R_DT_val

#define R_DT_val ( x)
Value:
(lower_tail ? R_D_val(x) : R_D_Clog(x))

Definition at line 48 of file macros.h.

◆ R_Log1_Exp

#define R_Log1_Exp ( x)
Value:
((x) > -M_LN2 ? ::log(-::expm1(x)) : ::log1p(-::exp(x)))

Definition at line 43 of file macros.h.

◆ R_P_bounds_01

#define R_P_bounds_01 ( x,
x_min,
x_max )
Value:
if(x <= x_min) return R_DT_0; \
if(x >= x_max) return R_DT_1
#define R_DT_0
Definition macros.h:29
#define R_DT_1
Definition macros.h:30

Definition at line 102 of file macros.h.

◆ R_P_bounds_Inf_01

#define R_P_bounds_Inf_01 ( x)
Value:
if(!R_FINITE(x)) { \
if (x > 0) return R_DT_1; \
/* x < 0 */return R_DT_0; \
}

Definition at line 107 of file macros.h.

Referenced by Rcpp::stats::plogis_0(), and Rcpp::stats::plogis_1().

◆ R_Q_P01_boundaries

#define R_Q_P01_boundaries ( p,
_LEFT_,
_RIGHT_ )
Value:
if (log_p) { \
if(p > 0) \
return R_NaN ; \
if(p == 0) /* upper bound*/ \
return lower_tail ? _RIGHT_ : _LEFT_; \
if(p == ML_NEGINF) \
return lower_tail ? _LEFT_ : _RIGHT_; \
} \
else { /* !log_p */ \
if(p < 0 || p > 1) \
return R_NaN ; \
if(p == 0) \
return lower_tail ? _LEFT_ : _RIGHT_; \
if(p == 1) \
return lower_tail ? _RIGHT_ : _LEFT_; \
}
#define ML_NEGINF
Definition stats.h:28

Definition at line 84 of file macros.h.

Referenced by Rcpp::stats::qlnorm_0(), Rcpp::stats::qlnorm_1(), Rcpp::stats::qlogis_0(), Rcpp::stats::qlogis_1(), and Rcpp::stats::qweibull_1().

◆ R_Q_P01_check

#define R_Q_P01_check ( p)
Value:
if ((log_p && p > 0) || \
(!log_p && (p < 0 || p > 1)) ) \
return R_NaN

Definition at line 68 of file macros.h.

Referenced by Rcpp::stats::qunif_0(), and Rcpp::stats::qunif_1().