| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Add pragme and include for Windows PCG64
|
|\
| |
| | |
MAINT: remove dSFMT
|
| | |
|
|\ \
| |/
|/| |
MAINT: random: Fix a few compiler warnings.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes:
gcc: numpy/random/src/xoshiro256/xoshiro256.c
numpy/random/src/xoshiro256/xoshiro256.c:39:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc: numpy/random/src/xoshiro512/xoshiro512.c
numpy/random/src/xoshiro512/xoshiro512.c:43:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
numpy/random/src/xoshiro512/xoshiro512.c:46:23: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (w = 0; w < sizeof s_placeholder / sizeof *s_placeholder; w++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc: numpy/random/src/distributions/distributions.c
numpy/random/src/distributions/distributions.c:185:14: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'const uint64_t' (aka 'const unsigned long long') [-Wsign-compare]
if (rabs < ki_double[idx])
~~~~ ^ ~~~~~~~~~~~~~~
numpy/random/src/distributions/distributions.c:230:14: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare]
if (rabs < ki_float[idx])
~~~~ ^ ~~~~~~~~~~~~~
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary of the changes:
* Move the functions random_hypergeometric_hyp, random_hypergeometric_hrua
and random_hypergeometric from distributions.c to legacy-distributions.c.
These are now the legacy implementation of hypergeometric.
* Add the files logfactorial.c and logfactorial.h,
containing the function logfactorial(int64_t k).
* Add the files random_hypergeometric.c and random_hypergeometric.h,
containing the function random_hypergeometric (the new implementation
of the hypergeometric distribution). See more details below.
* Fix two tests in numpy/random/tests/test_generator_mt19937.py that
used values returned by the hypergeometric distribution. The
new implementation changes the stream, so those tests needed to
be updated.
* Remove another test obviated by an added constraint on the arguments
of hypergeometric.
Details of the rewrite:
If you carefully step through the old function rk_hypergeometric_hyp(),
you'll see that the end result is basically the same as the new function
hypergeometric_sample(), but the new function accomplishes the result with
just integers. The floating point calculations in the old code caused
problems when the arguments were extremely large (explained in more detail
in the unmerged pull request https://github.com/numpy/numpy/pull/9834).
The new version of hypergeometric_hrua() is a new translation of
Stadlober's ratio-of-uniforms algorithm for the hypergeometric
distribution. It fixes a mistake in the old implementation that made the
method less efficient than it could be (see the details in the unmerged
pull request https://github.com/numpy/numpy/pull/11138), and uses a faster
function for computing log(k!).
The HRUA algorithm suffers from loss of floating point precision when
the arguments are *extremely* large (see the comments in github issue
11443). To avoid these problems, the arguments `ngood` and `nbad` of
hypergeometric must be less than 10**9. This constraint obviates an
existing regression test that was run on systems with 64 bit long
integers, so that test was removed.
|
|
|
|
| |
... and remove the unused arrays that were in ziggurat.h.
|
|
|
|
|
|
| |
In numpy/random/src/legacy/, rename distributions-boxmuller.c to
legacy-distributions.c. This file holds all the legacy distributions,
so the new name is more accurate.
|
|
|
|
| |
The file numpy/random/src/distributions/binomial.h was empty and unused.
|
|\
| |
| | |
MAINT: Use intrinsics in Win64-PCG64
|
| |
| |
| |
| | |
Use intrinsics to speed up PCG64 on Windows 64
|
|/
|
|
|
|
| |
* DOC, MAINT: Misc. typo fixes
Found via `codespell`
|
|\
| |
| | |
BUG: Avoid leading underscores in C function names.
|
| |
| |
| |
| | |
They are reserved in the C and POSIX standards.
|
|/
|
|
| |
Use _rotr64 on Windows to avoid compiler generated rotr instructions
|
|
|
|
|
|
| |
* PERF: Reorder header for philox
Reorder header so that support uint128 is always used if avilable, irrespective of platform
|
|
|
|
| |
This reverts commit 17e0070df93f4262908f884dca4b08cb7d0bba7f.
|
|
|
|
|
| |
Remove traces of the three removed bit generators
Add lock to Cython examples
|
|
|
|
|
|
| |
Use type-dependent poisson lam max
Make private
Fix backward compat issue in loggam
|
| |
|
|
|
|
| |
Let numpy detect SSE2
|
|
|
|
|
|
| |
Ensure integer type is stream compatible on 32 bit
Fix incorrect clause end
Add integer-generator tests that check long streams
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
remove numpy.random.gen, BRNG.generator, pcg*, rand, randn
remove use_mask and Lemire's method, fix benchmarks for PCG removal
convert brng to bitgen (in C) and bit_generator (in python)
convert base R{NG,andom.*} to BitGenerator, fix last commit
randint -> integers, remove rand, randn, random_integers
RandomGenerator -> Generator, more "basic RNG" -> BitGenerator
random_sample -> random, jump -> jumped, resync with randomgen
Remove derived code from entropy
Port over changes accepted in upstream to protect log(0.0) where relevant
fix doctests for jumped, better document choice
Remove Python 2.7 shims
Use NPY_INLINE to simplify
Fix performance.py to work
Renam directory brng to bit_generators
Fix examples wiht new directory structure
Clarify relationship to historical RandomState
Remove references to .generator
Rename xoshiro256/512starstar
|
|
|
|
| |
Remove Cython conditional compilation and use preprocessor only
|
|
|
|
| |
Correct type form long to int64
|
|
|
|
|
|
| |
Extend multinomial to allow broadcasting
Fix zipf changes missed in NumPy
Enable 0 as valid input for hypergeometric
|
|
remove files that were part of the origal repo
rework randomgen docs to integrate with numpy and fix some links
remove convenience functions, require explicit call to gen.brng
move code out of numpy.random.randomgen into numpy.random
|