libstdc++: Correct gamma distribution parameter updates
Ensured correct parameter updates for several C++ random number distributions, fixing PR123409.
This commit rectifies an issue in GCC’s libstdc++ where the param() function for several random number distributions (negative_binomial_distribution, student_t_distribution, fisher_f_distribution) did not correctly update their underlying gamma distributions. By invoking the param() function on the respective internal gamma distribution members, the distributions now behave as expected, ensuring consistent random number generation. A new test case distribution_param.cc has been added to validate these corrections.
In Details
The param() member function for negative_binomial_distribution, student_t_distribution, and fisher_f_distribution in libstdc++ was not properly propagating parameter changes to their internal gamma distribution objects (_M_gd or _M_gd_x, _M_gd_y). This commit ensures that param() is called on these internal members, aligning with the behavior of chi_squared_distribution and fixing PR123409. A new test suite covers these distributions and removes a redundant test for chi_squared_distribution that is now covered by the general distribution_param.cc test.
- libstdc++
- The C++ standard library implementation used by GCC. It provides classes and functions for input/output, strings, containers, algorithms, and more, as defined by the C++ standard.
- gamma distribution
- A continuous probability distribution that often models the time until a certain number of events occur in a Poisson process. It is used as a component in several other probability distributions.
- negative_binomial_distribution
- A C++ standard library random number distribution that models the number of Bernoulli trials needed to get a specified number of successes. Its behavior can be related to gamma distributions.
- student_t_distribution
- A C++ standard library random number distribution used in statistics, particularly for hypothesis testing when the population standard deviation is unknown. It is related to the normal distribution and gamma distributions.
- fisher_f_distribution
- A C++ standard library random number distribution used in statistical hypothesis testing, typically for comparing variances of two populations. It is related to chi-squared distributions and thus indirectly to gamma distributions.
- PR123409
- Patch/Problem Report number 123409. This indicates a bug or issue that has been reported and subsequently fixed in the GCC bug tracking system.