#include #include #include #include #include #include using std::vector; using std::max; static inline double LAMBDA(vector const &par) { return *par[0]->value(); } DPois::DPois() : DistDiscrete("dpois", 1, DIST_POSITIVE, true) {} DPois::~DPois() {} bool DPois::checkParameterDim (vector const &par) const { return par[0]->length() == 1; } bool DPois::checkParameterValue(vector const &par) const { return (LAMBDA(par) > 0); } double DPois::d(double x, vector const &par, bool give_log) const { return dpois(x, LAMBDA(par), give_log); } double DPois::p(double q, vector const &par, bool lower, bool give_log) const { return ppois(q, LAMBDA(par), lower, give_log); } double DPois::q(double p, vector const &par, bool lower, bool log_p) const { return qpois(p, LAMBDA(par), lower, log_p); } double DPois::r(vector const &par) const { return rpois(LAMBDA(par)); } double DPois::mean(vector const &par) const { return LAMBDA(par); } double DPois::var(vector const &par) const { return LAMBDA(par); }