diff options
author | mattip <matti.picus@gmail.com> | 2019-11-30 09:01:59 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-11-30 09:01:59 +0200 |
commit | 2b791a5906a2243b4e0a3318bd460b2062416fb9 (patch) | |
tree | a51a7facb6cc670bfda6d73e57843f611f4f578b | |
parent | aeaee5e0ab11abc9221e8ba938a3ff010b87fe36 (diff) | |
download | numpy-2b791a5906a2243b4e0a3318bd460b2062416fb9.tar.gz |
API: revert changes to standard_t, cauchy
-rw-r--r-- | numpy/core/include/numpy/random/distributions.h | 4 | ||||
-rw-r--r-- | numpy/random/_generator.pyx | 8 | ||||
-rw-r--r-- | numpy/random/src/distributions/distributions.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/numpy/core/include/numpy/random/distributions.h b/numpy/core/include/numpy/random/distributions.h index 94451ebe7..0e69fc508 100644 --- a/numpy/core/include/numpy/random/distributions.h +++ b/numpy/core/include/numpy/random/distributions.h @@ -93,7 +93,7 @@ DECLDIR double random_uniform(bitgen_t *bitgen_state, double lower, double range DECLDIR double random_beta(bitgen_t *bitgen_state, double a, double b); DECLDIR double random_chisquare(bitgen_t *bitgen_state, double df); DECLDIR double random_f(bitgen_t *bitgen_state, double dfnum, double dfden); -DECLDIR double random_cauchy(bitgen_t *bitgen_state); +DECLDIR double random_standard_cauchy(bitgen_t *bitgen_state); DECLDIR double random_pareto(bitgen_t *bitgen_state, double a); DECLDIR double random_weibull(bitgen_t *bitgen_state, double a); DECLDIR double random_power(bitgen_t *bitgen_state, double a); @@ -102,7 +102,7 @@ DECLDIR double random_gumbel(bitgen_t *bitgen_state, double loc, double scale); DECLDIR double random_logistic(bitgen_t *bitgen_state, double loc, double scale); DECLDIR double random_lognormal(bitgen_t *bitgen_state, double mean, double sigma); DECLDIR double random_rayleigh(bitgen_t *bitgen_state, double mode); -DECLDIR double random_student_t(bitgen_t *bitgen_state, double df); +DECLDIR double random_standard_t(bitgen_t *bitgen_state, double df); DECLDIR double random_noncentral_chisquare(bitgen_t *bitgen_state, double df, double nonc); DECLDIR double random_noncentral_f(bitgen_t *bitgen_state, double dfnum, diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx index 6acbb8ac3..74b379da8 100644 --- a/numpy/random/_generator.pyx +++ b/numpy/random/_generator.pyx @@ -84,7 +84,7 @@ cdef extern from "numpy/random/distributions.h": double random_beta(bitgen_t *bitgen_state, double a, double b) nogil double random_chisquare(bitgen_t *bitgen_state, double df) nogil double random_f(bitgen_t *bitgen_state, double dfnum, double dfden) nogil - double random_cauchy(bitgen_t *bitgen_state) nogil + double random_standard_cauchy(bitgen_t *bitgen_state) nogil double random_pareto(bitgen_t *bitgen_state, double a) nogil double random_weibull(bitgen_t *bitgen_state, double a) nogil double random_power(bitgen_t *bitgen_state, double a) nogil @@ -93,7 +93,7 @@ cdef extern from "numpy/random/distributions.h": double random_logistic(bitgen_t *bitgen_state, double loc, double scale) nogil double random_lognormal(bitgen_t *bitgen_state, double mean, double sigma) nogil double random_rayleigh(bitgen_t *bitgen_state, double mode) nogil - double random_student_t(bitgen_t *bitgen_state, double df) nogil + double random_standard_t(bitgen_t *bitgen_state, double df) nogil double random_noncentral_chisquare(bitgen_t *bitgen_state, double df, double nonc) nogil double random_noncentral_f(bitgen_t *bitgen_state, double dfnum, @@ -1695,7 +1695,7 @@ cdef class Generator: >>> plt.show() """ - return cont(&random_cauchy, &self._bitgen, size, self.lock, 0, + return cont(&random_standard_cauchy, &self._bitgen, size, self.lock, 0, 0.0, '', CONS_NONE, 0.0, '', CONS_NONE, 0.0, '', CONS_NONE, None) def standard_t(self, df, size=None): @@ -1786,7 +1786,7 @@ cdef class Generator: probability of about 99% of being true. """ - return cont(&random_student_t, &self._bitgen, size, self.lock, 1, + return cont(&random_standard_t, &self._bitgen, size, self.lock, 1, df, 'df', CONS_POSITIVE, 0, '', CONS_NONE, 0, '', CONS_NONE, diff --git a/numpy/random/src/distributions/distributions.c b/numpy/random/src/distributions/distributions.c index 1b886aeab..0b46dc6d8 100644 --- a/numpy/random/src/distributions/distributions.c +++ b/numpy/random/src/distributions/distributions.c @@ -443,7 +443,7 @@ double random_f(bitgen_t *bitgen_state, double dfnum, double dfden) { (random_chisquare(bitgen_state, dfden) * dfnum)); } -double random_cauchy(bitgen_t *bitgen_state) { +double random_standard_cauchy(bitgen_t *bitgen_state) { return random_standard_normal(bitgen_state) / random_standard_normal(bitgen_state); } @@ -507,7 +507,7 @@ double random_rayleigh(bitgen_t *bitgen_state, double mode) { return mode * sqrt(-2.0 * log(1.0 - next_double(bitgen_state))); } -double random_student_t(bitgen_t *bitgen_state, double df) { +double random_standard_t(bitgen_t *bitgen_state, double df) { double num, denom; num = random_standard_normal(bitgen_state); |