geometric.hpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. // boost\math\distributions\geometric.hpp
  2. // Copyright John Maddock 2010.
  3. // Copyright Paul A. Bristow 2010.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt
  7. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. // geometric distribution is a discrete probability distribution.
  9. // It expresses the probability distribution of the number (k) of
  10. // events, occurrences, failures or arrivals before the first success.
  11. // supported on the set {0, 1, 2, 3...}
  12. // Note that the set includes zero (unlike some definitions that start at one).
  13. // The random variate k is the number of events, occurrences or arrivals.
  14. // k argument may be integral, signed, or unsigned, or floating point.
  15. // If necessary, it has already been promoted from an integral type.
  16. // Note that the geometric distribution
  17. // (like others including the binomial, geometric & Bernoulli)
  18. // is strictly defined as a discrete function:
  19. // only integral values of k are envisaged.
  20. // However because the method of calculation uses a continuous gamma function,
  21. // it is convenient to treat it as if a continuous function,
  22. // and permit non-integral values of k.
  23. // To enforce the strict mathematical model, users should use floor or ceil functions
  24. // on k outside this function to ensure that k is integral.
  25. // See http://en.wikipedia.org/wiki/geometric_distribution
  26. // http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/Statistics/DiscreteDistributions.html
  27. // http://mathworld.wolfram.com/GeometricDistribution.html
  28. #ifndef BOOST_MATH_SPECIAL_GEOMETRIC_HPP
  29. #define BOOST_MATH_SPECIAL_GEOMETRIC_HPP
  30. #include <boost/math/distributions/fwd.hpp>
  31. #include <boost/math/special_functions/beta.hpp> // for ibeta(a, b, x) == Ix(a, b).
  32. #include <boost/math/distributions/complement.hpp> // complement.
  33. #include <boost/math/distributions/detail/common_error_handling.hpp> // error checks domain_error & logic_error.
  34. #include <boost/math/special_functions/fpclassify.hpp> // isnan.
  35. #include <boost/math/tools/roots.hpp> // for root finding.
  36. #include <boost/math/distributions/detail/inv_discrete_quantile.hpp>
  37. #include <boost/math/special_functions/log1p.hpp>
  38. #include <limits> // using std::numeric_limits;
  39. #include <utility>
  40. #include <cmath>
  41. #if defined (BOOST_MSVC)
  42. # pragma warning(push)
  43. // This believed not now necessary, so commented out.
  44. //# pragma warning(disable: 4702) // unreachable code.
  45. // in domain_error_imp in error_handling.
  46. #endif
  47. namespace boost
  48. {
  49. namespace math
  50. {
  51. namespace geometric_detail
  52. {
  53. // Common error checking routines for geometric distribution function:
  54. template <class RealType, class Policy>
  55. inline bool check_success_fraction(const char* function, const RealType& p, RealType* result, const Policy& pol)
  56. {
  57. if( !(boost::math::isfinite)(p) || (p < 0) || (p > 1) )
  58. {
  59. *result = policies::raise_domain_error<RealType>(
  60. function,
  61. "Success fraction argument is %1%, but must be >= 0 and <= 1 !", p, pol);
  62. return false;
  63. }
  64. return true;
  65. }
  66. template <class RealType, class Policy>
  67. inline bool check_dist(const char* function, const RealType& p, RealType* result, const Policy& pol)
  68. {
  69. return check_success_fraction(function, p, result, pol);
  70. }
  71. template <class RealType, class Policy>
  72. inline bool check_dist_and_k(const char* function, const RealType& p, RealType k, RealType* result, const Policy& pol)
  73. {
  74. if(check_dist(function, p, result, pol) == false)
  75. {
  76. return false;
  77. }
  78. if( !(boost::math::isfinite)(k) || (k < 0) )
  79. { // Check k failures.
  80. *result = policies::raise_domain_error<RealType>(
  81. function,
  82. "Number of failures argument is %1%, but must be >= 0 !", k, pol);
  83. return false;
  84. }
  85. return true;
  86. } // Check_dist_and_k
  87. template <class RealType, class Policy>
  88. inline bool check_dist_and_prob(const char* function, RealType p, RealType prob, RealType* result, const Policy& pol)
  89. {
  90. if((check_dist(function, p, result, pol) && detail::check_probability(function, prob, result, pol)) == false)
  91. {
  92. return false;
  93. }
  94. return true;
  95. } // check_dist_and_prob
  96. } // namespace geometric_detail
  97. template <class RealType = double, class Policy = policies::policy<> >
  98. class geometric_distribution
  99. {
  100. public:
  101. typedef RealType value_type;
  102. typedef Policy policy_type;
  103. geometric_distribution(RealType p) : m_p(p)
  104. { // Constructor stores success_fraction p.
  105. RealType result;
  106. geometric_detail::check_dist(
  107. "geometric_distribution<%1%>::geometric_distribution",
  108. m_p, // Check success_fraction 0 <= p <= 1.
  109. &result, Policy());
  110. } // geometric_distribution constructor.
  111. // Private data getter class member functions.
  112. RealType success_fraction() const
  113. { // Probability of success as fraction in range 0 to 1.
  114. return m_p;
  115. }
  116. RealType successes() const
  117. { // Total number of successes r = 1 (for compatibility with negative binomial?).
  118. return 1;
  119. }
  120. // Parameter estimation.
  121. // (These are copies of negative_binomial distribution with successes = 1).
  122. static RealType find_lower_bound_on_p(
  123. RealType trials,
  124. RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
  125. {
  126. static const char* function = "boost::math::geometric<%1%>::find_lower_bound_on_p";
  127. RealType result = 0; // of error checks.
  128. RealType successes = 1;
  129. RealType failures = trials - successes;
  130. if(false == detail::check_probability(function, alpha, &result, Policy())
  131. && geometric_detail::check_dist_and_k(
  132. function, RealType(0), failures, &result, Policy()))
  133. {
  134. return result;
  135. }
  136. // Use complement ibeta_inv function for lower bound.
  137. // This is adapted from the corresponding binomial formula
  138. // here: http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
  139. // This is a Clopper-Pearson interval, and may be overly conservative,
  140. // see also "A Simple Improved Inferential Method for Some
  141. // Discrete Distributions" Yong CAI and K. KRISHNAMOORTHY
  142. // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf
  143. //
  144. return ibeta_inv(successes, failures + 1, alpha, static_cast<RealType*>(nullptr), Policy());
  145. } // find_lower_bound_on_p
  146. static RealType find_upper_bound_on_p(
  147. RealType trials,
  148. RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
  149. {
  150. static const char* function = "boost::math::geometric<%1%>::find_upper_bound_on_p";
  151. RealType result = 0; // of error checks.
  152. RealType successes = 1;
  153. RealType failures = trials - successes;
  154. if(false == geometric_detail::check_dist_and_k(
  155. function, RealType(0), failures, &result, Policy())
  156. && detail::check_probability(function, alpha, &result, Policy()))
  157. {
  158. return result;
  159. }
  160. if(failures == 0)
  161. {
  162. return 1;
  163. }// Use complement ibetac_inv function for upper bound.
  164. // Note adjusted failures value: *not* failures+1 as usual.
  165. // This is adapted from the corresponding binomial formula
  166. // here: http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
  167. // This is a Clopper-Pearson interval, and may be overly conservative,
  168. // see also "A Simple Improved Inferential Method for Some
  169. // Discrete Distributions" Yong CAI and K. Krishnamoorthy
  170. // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf
  171. //
  172. return ibetac_inv(successes, failures, alpha, static_cast<RealType*>(nullptr), Policy());
  173. } // find_upper_bound_on_p
  174. // Estimate number of trials :
  175. // "How many trials do I need to be P% sure of seeing k or fewer failures?"
  176. static RealType find_minimum_number_of_trials(
  177. RealType k, // number of failures (k >= 0).
  178. RealType p, // success fraction 0 <= p <= 1.
  179. RealType alpha) // risk level threshold 0 <= alpha <= 1.
  180. {
  181. static const char* function = "boost::math::geometric<%1%>::find_minimum_number_of_trials";
  182. // Error checks:
  183. RealType result = 0;
  184. if(false == geometric_detail::check_dist_and_k(
  185. function, p, k, &result, Policy())
  186. && detail::check_probability(function, alpha, &result, Policy()))
  187. {
  188. return result;
  189. }
  190. result = ibeta_inva(k + 1, p, alpha, Policy()); // returns n - k
  191. return result + k;
  192. } // RealType find_number_of_failures
  193. static RealType find_maximum_number_of_trials(
  194. RealType k, // number of failures (k >= 0).
  195. RealType p, // success fraction 0 <= p <= 1.
  196. RealType alpha) // risk level threshold 0 <= alpha <= 1.
  197. {
  198. static const char* function = "boost::math::geometric<%1%>::find_maximum_number_of_trials";
  199. // Error checks:
  200. RealType result = 0;
  201. if(false == geometric_detail::check_dist_and_k(
  202. function, p, k, &result, Policy())
  203. && detail::check_probability(function, alpha, &result, Policy()))
  204. {
  205. return result;
  206. }
  207. result = ibetac_inva(k + 1, p, alpha, Policy()); // returns n - k
  208. return result + k;
  209. } // RealType find_number_of_trials complemented
  210. private:
  211. //RealType m_r; // successes fixed at unity.
  212. RealType m_p; // success_fraction
  213. }; // template <class RealType, class Policy> class geometric_distribution
  214. typedef geometric_distribution<double> geometric; // Reserved name of type double.
  215. #ifdef __cpp_deduction_guides
  216. template <class RealType>
  217. geometric_distribution(RealType)->geometric_distribution<typename boost::math::tools::promote_args<RealType>::type>;
  218. #endif
  219. template <class RealType, class Policy>
  220. inline const std::pair<RealType, RealType> range(const geometric_distribution<RealType, Policy>& /* dist */)
  221. { // Range of permissible values for random variable k.
  222. using boost::math::tools::max_value;
  223. return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // max_integer?
  224. }
  225. template <class RealType, class Policy>
  226. inline const std::pair<RealType, RealType> support(const geometric_distribution<RealType, Policy>& /* dist */)
  227. { // Range of supported values for random variable k.
  228. // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
  229. using boost::math::tools::max_value;
  230. return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // max_integer?
  231. }
  232. template <class RealType, class Policy>
  233. inline RealType mean(const geometric_distribution<RealType, Policy>& dist)
  234. { // Mean of geometric distribution = (1-p)/p.
  235. return (1 - dist.success_fraction() ) / dist.success_fraction();
  236. } // mean
  237. // median implemented via quantile(half) in derived accessors.
  238. template <class RealType, class Policy>
  239. inline RealType mode(const geometric_distribution<RealType, Policy>&)
  240. { // Mode of geometric distribution = zero.
  241. BOOST_MATH_STD_USING // ADL of std functions.
  242. return 0;
  243. } // mode
  244. template <class RealType, class Policy>
  245. inline RealType variance(const geometric_distribution<RealType, Policy>& dist)
  246. { // Variance of Binomial distribution = (1-p) / p^2.
  247. return (1 - dist.success_fraction())
  248. / (dist.success_fraction() * dist.success_fraction());
  249. } // variance
  250. template <class RealType, class Policy>
  251. inline RealType skewness(const geometric_distribution<RealType, Policy>& dist)
  252. { // skewness of geometric distribution = 2-p / (sqrt(r(1-p))
  253. BOOST_MATH_STD_USING // ADL of std functions.
  254. RealType p = dist.success_fraction();
  255. return (2 - p) / sqrt(1 - p);
  256. } // skewness
  257. template <class RealType, class Policy>
  258. inline RealType kurtosis(const geometric_distribution<RealType, Policy>& dist)
  259. { // kurtosis of geometric distribution
  260. // http://en.wikipedia.org/wiki/geometric is kurtosis_excess so add 3
  261. RealType p = dist.success_fraction();
  262. return 3 + (p*p - 6*p + 6) / (1 - p);
  263. } // kurtosis
  264. template <class RealType, class Policy>
  265. inline RealType kurtosis_excess(const geometric_distribution<RealType, Policy>& dist)
  266. { // kurtosis excess of geometric distribution
  267. // http://mathworld.wolfram.com/Kurtosis.html table of kurtosis_excess
  268. RealType p = dist.success_fraction();
  269. return (p*p - 6*p + 6) / (1 - p);
  270. } // kurtosis_excess
  271. // RealType standard_deviation(const geometric_distribution<RealType, Policy>& dist)
  272. // standard_deviation provided by derived accessors.
  273. // RealType hazard(const geometric_distribution<RealType, Policy>& dist)
  274. // hazard of geometric distribution provided by derived accessors.
  275. // RealType chf(const geometric_distribution<RealType, Policy>& dist)
  276. // chf of geometric distribution provided by derived accessors.
  277. template <class RealType, class Policy>
  278. inline RealType pdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  279. { // Probability Density/Mass Function.
  280. BOOST_FPU_EXCEPTION_GUARD
  281. BOOST_MATH_STD_USING // For ADL of math functions.
  282. static const char* function = "boost::math::pdf(const geometric_distribution<%1%>&, %1%)";
  283. RealType p = dist.success_fraction();
  284. RealType result = 0;
  285. if(false == geometric_detail::check_dist_and_k(
  286. function,
  287. p,
  288. k,
  289. &result, Policy()))
  290. {
  291. return result;
  292. }
  293. if (k == 0)
  294. {
  295. return p; // success_fraction
  296. }
  297. RealType q = 1 - p; // Inaccurate for small p?
  298. // So try to avoid inaccuracy for large or small p.
  299. // but has little effect > last significant bit.
  300. //cout << "p * pow(q, k) " << result << endl; // seems best whatever p
  301. //cout << "exp(p * k * log1p(-p)) " << p * exp(k * log1p(-p)) << endl;
  302. //if (p < 0.5)
  303. //{
  304. // result = p * pow(q, k);
  305. //}
  306. //else
  307. //{
  308. // result = p * exp(k * log1p(-p));
  309. //}
  310. result = p * pow(q, k);
  311. return result;
  312. } // geometric_pdf
  313. template <class RealType, class Policy>
  314. inline RealType cdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  315. { // Cumulative Distribution Function of geometric.
  316. static const char* function = "boost::math::cdf(const geometric_distribution<%1%>&, %1%)";
  317. // k argument may be integral, signed, or unsigned, or floating point.
  318. // If necessary, it has already been promoted from an integral type.
  319. RealType p = dist.success_fraction();
  320. // Error check:
  321. RealType result = 0;
  322. if(false == geometric_detail::check_dist_and_k(
  323. function,
  324. p,
  325. k,
  326. &result, Policy()))
  327. {
  328. return result;
  329. }
  330. if(k == 0)
  331. {
  332. return p; // success_fraction
  333. }
  334. //RealType q = 1 - p; // Bad for small p
  335. //RealType probability = 1 - std::pow(q, k+1);
  336. RealType z = boost::math::log1p(-p, Policy()) * (k + 1);
  337. RealType probability = -boost::math::expm1(z, Policy());
  338. return probability;
  339. } // cdf Cumulative Distribution Function geometric.
  340. template <class RealType, class Policy>
  341. inline RealType logcdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  342. { // Cumulative Distribution Function of geometric.
  343. using std::pow;
  344. static const char* function = "boost::math::logcdf(const geometric_distribution<%1%>&, %1%)";
  345. // k argument may be integral, signed, or unsigned, or floating point.
  346. // If necessary, it has already been promoted from an integral type.
  347. RealType p = dist.success_fraction();
  348. // Error check:
  349. RealType result = 0;
  350. if(false == geometric_detail::check_dist_and_k(
  351. function,
  352. p,
  353. k,
  354. &result, Policy()))
  355. {
  356. return -std::numeric_limits<RealType>::infinity();
  357. }
  358. if(k == 0)
  359. {
  360. return log(p); // success_fraction
  361. }
  362. //RealType q = 1 - p; // Bad for small p
  363. //RealType probability = 1 - std::pow(q, k+1);
  364. RealType z = boost::math::log1p(-p, Policy()) * (k + 1);
  365. return log1p(-exp(z), Policy());
  366. } // logcdf Cumulative Distribution Function geometric.
  367. template <class RealType, class Policy>
  368. inline RealType cdf(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  369. { // Complemented Cumulative Distribution Function geometric.
  370. BOOST_MATH_STD_USING
  371. static const char* function = "boost::math::cdf(const geometric_distribution<%1%>&, %1%)";
  372. // k argument may be integral, signed, or unsigned, or floating point.
  373. // If necessary, it has already been promoted from an integral type.
  374. RealType const& k = c.param;
  375. geometric_distribution<RealType, Policy> const& dist = c.dist;
  376. RealType p = dist.success_fraction();
  377. // Error check:
  378. RealType result = 0;
  379. if(false == geometric_detail::check_dist_and_k(
  380. function,
  381. p,
  382. k,
  383. &result, Policy()))
  384. {
  385. return result;
  386. }
  387. RealType z = boost::math::log1p(-p, Policy()) * (k+1);
  388. RealType probability = exp(z);
  389. return probability;
  390. } // cdf Complemented Cumulative Distribution Function geometric.
  391. template <class RealType, class Policy>
  392. inline RealType logcdf(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  393. { // Complemented Cumulative Distribution Function geometric.
  394. BOOST_MATH_STD_USING
  395. static const char* function = "boost::math::logcdf(const geometric_distribution<%1%>&, %1%)";
  396. // k argument may be integral, signed, or unsigned, or floating point.
  397. // If necessary, it has already been promoted from an integral type.
  398. RealType const& k = c.param;
  399. geometric_distribution<RealType, Policy> const& dist = c.dist;
  400. RealType p = dist.success_fraction();
  401. // Error check:
  402. RealType result = 0;
  403. if(false == geometric_detail::check_dist_and_k(
  404. function,
  405. p,
  406. k,
  407. &result, Policy()))
  408. {
  409. return -std::numeric_limits<RealType>::infinity();
  410. }
  411. return boost::math::log1p(-p, Policy()) * (k+1);
  412. } // logcdf Complemented Cumulative Distribution Function geometric.
  413. template <class RealType, class Policy>
  414. inline RealType quantile(const geometric_distribution<RealType, Policy>& dist, const RealType& x)
  415. { // Quantile, percentile/100 or Percent Point geometric function.
  416. // Return the number of expected failures k for a given probability p.
  417. // Inverse cumulative Distribution Function or Quantile (percentile / 100) of geometric Probability.
  418. // k argument may be integral, signed, or unsigned, or floating point.
  419. static const char* function = "boost::math::quantile(const geometric_distribution<%1%>&, %1%)";
  420. BOOST_MATH_STD_USING // ADL of std functions.
  421. RealType success_fraction = dist.success_fraction();
  422. // Check dist and x.
  423. RealType result = 0;
  424. if(false == geometric_detail::check_dist_and_prob
  425. (function, success_fraction, x, &result, Policy()))
  426. {
  427. return result;
  428. }
  429. // Special cases.
  430. if (x == 1)
  431. { // Would need +infinity failures for total confidence.
  432. result = policies::raise_overflow_error<RealType>(
  433. function,
  434. "Probability argument is 1, which implies infinite failures !", Policy());
  435. return result;
  436. // usually means return +std::numeric_limits<RealType>::infinity();
  437. // unless #define BOOST_MATH_THROW_ON_OVERFLOW_ERROR
  438. }
  439. if (x == 0)
  440. { // No failures are expected if P = 0.
  441. return 0; // Total trials will be just dist.successes.
  442. }
  443. // if (P <= pow(dist.success_fraction(), 1))
  444. if (x <= success_fraction)
  445. { // p <= pdf(dist, 0) == cdf(dist, 0)
  446. return 0;
  447. }
  448. if (x == 1)
  449. {
  450. return 0;
  451. }
  452. // log(1-x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
  453. result = boost::math::log1p(-x, Policy()) / boost::math::log1p(-success_fraction, Policy()) - 1;
  454. // Subtract a few epsilons here too?
  455. // to make sure it doesn't slip over, so ceil would be one too many.
  456. return result;
  457. } // RealType quantile(const geometric_distribution dist, p)
  458. template <class RealType, class Policy>
  459. inline RealType quantile(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  460. { // Quantile or Percent Point Binomial function.
  461. // Return the number of expected failures k for a given
  462. // complement of the probability Q = 1 - P.
  463. static const char* function = "boost::math::quantile(const geometric_distribution<%1%>&, %1%)";
  464. BOOST_MATH_STD_USING
  465. // Error checks:
  466. RealType x = c.param;
  467. const geometric_distribution<RealType, Policy>& dist = c.dist;
  468. RealType success_fraction = dist.success_fraction();
  469. RealType result = 0;
  470. if(false == geometric_detail::check_dist_and_prob(
  471. function,
  472. success_fraction,
  473. x,
  474. &result, Policy()))
  475. {
  476. return result;
  477. }
  478. // Special cases:
  479. if(x == 1)
  480. { // There may actually be no answer to this question,
  481. // since the probability of zero failures may be non-zero,
  482. return 0; // but zero is the best we can do:
  483. }
  484. if (-x <= boost::math::powm1(dist.success_fraction(), dist.successes(), Policy()))
  485. { // q <= cdf(complement(dist, 0)) == pdf(dist, 0)
  486. return 0; //
  487. }
  488. if(x == 0)
  489. { // Probability 1 - Q == 1 so infinite failures to achieve certainty.
  490. // Would need +infinity failures for total confidence.
  491. result = policies::raise_overflow_error<RealType>(
  492. function,
  493. "Probability argument complement is 0, which implies infinite failures !", Policy());
  494. return result;
  495. // usually means return +std::numeric_limits<RealType>::infinity();
  496. // unless #define BOOST_MATH_THROW_ON_OVERFLOW_ERROR
  497. }
  498. // log(x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
  499. result = log(x) / boost::math::log1p(-success_fraction, Policy()) - 1;
  500. return result;
  501. } // quantile complement
  502. } // namespace math
  503. } // namespace boost
  504. // This include must be at the end, *after* the accessors
  505. // for this distribution have been defined, in order to
  506. // keep compilers that support two-phase lookup happy.
  507. #include <boost/math/distributions/detail/derived_accessors.hpp>
  508. #if defined (BOOST_MSVC)
  509. # pragma warning(pop)
  510. #endif
  511. #endif // BOOST_MATH_SPECIAL_GEOMETRIC_HPP