id summary reporter owner description type status milestone component version severity resolution keywords cc 11556 hypergeometric constructor's n & r are not consistent with online description! mchalabi@… John Maddock "Hi, at the following URL it reads: r: number of defective items n: size of sample [http://www.boost.org/doc/libs/1_52_0/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/hypergeometric_dist.html] However looking into the constructor of hypergeometric distribution reveals the contrary: r: sample size n: number of defective items {{{ class hypergeometric_distribution { public: typedef RealType value_type; typedef Policy policy_type; hypergeometric_distribution(unsigned r, unsigned n, unsigned N) // Constructor. : m_n(n), m_N(N), m_r(r) { static const char* function = ""boost::math::hypergeometric_distribution<%1%>::hypergeometric_distribution""; RealType ret; check_params(function, &ret); } // Accessor functions. unsigned total()const { return m_N; } unsigned defective()const { return m_n; } unsigned sample_count()const { return m_r; } bool check_params(const char* function, RealType* result)const { if(m_r > m_N) { *result = boost::math::policies::raise_domain_error( function, ""Parameter r out of range: must be <= N but got %1%"", static_cast(m_r), Policy()); return false; } if(m_n > m_N) { *result = boost::math::policies::raise_domain_error( function, ""Parameter n out of range: must be <= N but got %1%"", static_cast(m_n), Policy()); return false; } return true; } bool check_x(unsigned x, const char* function, RealType* result)const { if(x < static_cast((std::max)(0, (int)(m_n + m_r) - (int)(m_N)))) { *result = boost::math::policies::raise_domain_error( function, ""Random variable out of range: must be > 0 and > m + r - N but got %1%"", static_cast(x), Policy()); return false; } if(x > (std::min)(m_r, m_n)) { *result = boost::math::policies::raise_domain_error( function, ""Random variable out of range: must be less than both n and r but got %1%"", static_cast(x), Policy()); return false; } return true; } private: // Data members: unsigned m_n; // number of ""defective"" items unsigned m_N; // number of ""total"" items unsigned m_r; // number of items picked }; // class hypergeometric_distribution }}} " Bugs closed Boost 1.60.0 math Boost 1.59.0 Problem fixed hypergeometric constructor n r mor.chalabi@…