[Rcpp-commits] r3847 - pkg/Rcpp/inst/include/Rcpp
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Oct 28 23:11:54 CET 2012
Author: edd
Date: 2012-10-28 23:11:54 +0100 (Sun, 28 Oct 2012)
New Revision: 3847
Modified:
pkg/Rcpp/inst/include/Rcpp/Rmath.h
Log:
added unif and gamma to namespace 'R' with Rmath functions
Modified: pkg/Rcpp/inst/include/Rcpp/Rmath.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Rmath.h 2012-10-28 19:57:54 UTC (rev 3846)
+++ pkg/Rcpp/inst/include/Rcpp/Rmath.h 2012-10-28 22:11:54 UTC (rev 3847)
@@ -34,10 +34,29 @@
/* Normal Distribution */
inline double dnorm(double x, double mu, double sigma, int lg) { return ::Rf_dnorm4(x, mu, sigma, lg); }
inline double pnorm(double x, double mu, double sigma, int lt, int lg) { return ::Rf_pnorm5(x, mu, sigma, lt, lg); }
- inline double qnorm(double x, double mu, double sigma, int lt, int lg) { return ::Rf_qnorm5(x, mu, sigma, lt, lg); }
+ inline double qnorm(double p, double mu, double sigma, int lt, int lg) { return ::Rf_qnorm5(p, mu, sigma, lt, lg); }
inline double rnorm(double mu, double sigma) { return ::Rf_rnorm(mu, sigma); }
inline void pnorm_both(double x, double *cum, double *ccum, int lt, int lg) { return ::Rf_pnorm_both(x, cum, ccum, lt, lg); }
+ /* Uniform Distribution */
+ inline double dunif(double x, double a, double b, int lg) { return ::Rf_dunif(x, a, b, lg); }
+ inline double punif(double x, double a, double b, int lt, int lg) { return ::Rf_punif(x, a, b, lt, lg); }
+ inline double qunif(double p, double a, double b, int lt, int lg) { return ::Rf_qunif(p, a, b, lt, lg); }
+ inline double runif(double a, double b) { return ::Rf_runif(a, b); }
+
+ /* Gamma Distribution */
+ inline double dgamma(double x, double shp, double scl, int lg) { return ::Rf_dgamma(x, shp, scl, lg); }
+ inline double pgamma(double x, double alp, double scl, int lt, int lg) { return ::Rf_pgamma(x, alp, scl, lt, lg); }
+ inline double qgamma(double p, double alp, double scl, int lt, int lg) { return ::Rf_pgamma(p, alp, scl, lt, lg); }
+ inline double rgamma(double a, double scl) { return ::Rf_rgamma(a, scl); }
+
+ inline double log1pmx(double x) { return ::Rf_log1pmx(x); }
+ inline double log1pexp(double x) { return ::log1pexp(x); } // <-- ../nmath/plogis.c
+ inline double lgamma1p(double a) { return ::Rf_lgamma1p(a); }
+ inline double logspace_add(double lx, double ly) { return ::Rf_logspace_add(lx, ly); }
+ inline double logspace_sub(double lx, double ly) { return ::Rf_logspace_sub(lx, ly); }
+
+
}
#endif
More information about the Rcpp-commits
mailing list