diff options
author | mattip <matti.picus@gmail.com> | 2019-03-20 12:39:53 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-05-20 18:45:27 +0300 |
commit | fa8af41c9d375072b2c7af66e5f7f01df4754841 (patch) | |
tree | a70e8ac590d1aa7b04799b8c4deb3d67603e856b /numpy/random/randomgen/src/entropy/entropy.h | |
parent | 6e386c05c292da49224fcab372013a6d4247ae3b (diff) | |
download | numpy-fa8af41c9d375072b2c7af66e5f7f01df4754841.tar.gz |
BUILD: move files out of _randomgen
first cut at building randomgen
upgrade 'cythonize' and fix absolute imports to relative
define NPY_NO_DEPRECATED_API and fix other warnings
enable pgc64 by always using PCG_EMULATED_MATH
refactor so import randomgen works
add TODO comments for pcg64 improvements
fix imports, module name in setup.py; remove _testing
make cythonize non-recursive, restore examples to proper place
update to randomgen 7bca296c0b9
replace mtrand with LegacyGenerator, tweak for compatibility
port f879ef4 to fix GH10839
minimized difference between generator.pyx and _legacy.pyx
fix namespace in doctests, mark results that are random
update to randomgen commit 95c8cdd1c
Incorporate testing of edge cases into main tests
Rename test files to describe their purpose
Import import locations to reflect numpy paths
Correct tolerance on float32 tests
Remove set_printoptions
Remove complex normal
Remove future imports
Pull in BasicRNG source changes from original author
Small doc fixes
_mtrand => _rand
Improve consistency of nan handling
Prevent nans prducing values from int functions
add randomgen documentation to the tree
Diffstat (limited to 'numpy/random/randomgen/src/entropy/entropy.h')
-rw-r--r-- | numpy/random/randomgen/src/entropy/entropy.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/numpy/random/randomgen/src/entropy/entropy.h b/numpy/random/randomgen/src/entropy/entropy.h new file mode 100644 index 000000000..785603dd3 --- /dev/null +++ b/numpy/random/randomgen/src/entropy/entropy.h @@ -0,0 +1,48 @@ +#ifndef _RANDOMDGEN__ENTROPY_H_ +#define _RANDOMDGEN__ENTROPY_H_ +/* + * PCG Random Number Generation for C. + * + * Copyright 2014 Melissa O'Neill <oneill@pcg-random.org> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For additional information about the PCG random number generation scheme, + * including its license and other licensing options, visit + * + * http://www.pcg-random.org + */ + +#include <stddef.h> +#ifdef _WIN32 +#if _MSC_VER == 1500 +#include "../common/stdint.h" +typedef int bool; +#define false 0 +#define true 1 +#else +#include <stdbool.h> +#include <stdint.h> +#endif +#else +#include <stdbool.h> +#include <stdint.h> +#endif + +extern void entropy_fill(void *dest, size_t size); + +extern bool entropy_getbytes(void *dest, size_t size); + +extern bool entropy_fallback_getbytes(void *dest, size_t size); + +#endif |