-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #386 from bashtage/more-test-broadcast
Add test for float 1
- Loading branch information
Showing
5 changed files
with
89 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
#include <inttypes.h> | ||
#include "numpy/random/distributions.h" | ||
|
||
extern double double0_func(bitgen_t *state); | ||
extern double double1_func(bitgen_t *state, double a); | ||
extern double double2_func(bitgen_t *state, double a, double b); | ||
extern double double3_func(bitgen_t *state, double a, double b, double c); | ||
|
||
extern float float_0(bitgen_t *state); | ||
extern float float_1(bitgen_t *state, float a); | ||
|
||
extern int64_t int_0(void *state); | ||
extern int64_t int_d(void *state, double a); | ||
extern int64_t int_dd(void *state, double a, double b); | ||
extern int64_t int_di(void *state, double a, uint64_t b); | ||
extern int64_t int_i(void *state, int64_t a); | ||
extern int64_t int_iii(void *state, int64_t a, int64_t b, int64_t c); | ||
|
||
/* | ||
extern uint32_t uint_0_32(bitgen_t *state); | ||
extern uint32_t uint_1_i_32(bitgen_t *state, uint32_t a); | ||
extern int32_t int_2_i_32(bitgen_t *state, int32_t a, int32_t b); | ||
extern int64_t int_2_i(bitgen_t *state, int64_t a, int64_t b); | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
from cpython.pycapsule cimport PyCapsule_GetPointer, PyCapsule_IsValid | ||
from numpy.random cimport bitgen_t | ||
|
||
from randomgen.tests.data.compute_hashes import bit_gen | ||
from randomgen.broadcasting cimport constraint_type, cont, cont_f | ||
from randomgen.common cimport ( | ||
byteswap_little_endian, | ||
int_to_array, | ||
object_to_int, | ||
view_little_endian, | ||
) | ||
|
||
from Cython.Includes.cpython.datetime import noexcept | ||
|
||
from libc.stdint cimport int64_t, uint64_t | ||
|
||
|
||
cdef extern from "_shim_dist.h": | ||
double double0_func(bitgen_t *state); | ||
double double1_func(bitgen_t *state, double a); | ||
double double2_func(bitgen_t *state, double a, double b); | ||
double double3_func(bitgen_t *state, double a, double b, double c); | ||
double double0_func(bitgen_t *state) noexcept nogil | ||
double double1_func(bitgen_t *state, double a) noexcept nogil | ||
double double2_func(bitgen_t *state, double a, double b) noexcept nogil | ||
double double3_func(bitgen_t *state, double a, double b, double c) noexcept nogil | ||
|
||
float float_0(bitgen_t *state) noexcept nogil | ||
float float_1(bitgen_t *state, float a) noexcept nogil | ||
|
||
int64_t int_0(bitgen_t *state) noexcept nogil | ||
int64_t int_d(bitgen_t *state, double a) noexcept nogil | ||
int64_t int_dd(bitgen_t *state, double a, double b) noexcept nogil | ||
int64_t int_di(bitgen_t *state, double a, uint64_t b) noexcept nogil | ||
int64_t int_i(bitgen_t *state, int64_t a) noexcept nogil | ||
int64_t int_iii(bitgen_t *state, int64_t a, int64_t b, int64_t c) noexcept nogil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters