Conversation
|
There should be macros for |
Yes, agreed! |
|
I should also mention that I added clears of the random state in two |
|
This looks fine to me. The missing underscore in |
* Rename flint_rand_s to flint_rand_struct, * Replace fields `gmp_state` and `gmp_init` in `flint_rand_s` by `void * __gmp_state`, * Rename the following functions: flint_randinit -> flint_rand_init (different content) flint_randclear -> flint_rand_clear (different content) flint_randseed -> flint_rand_set_seed flint_get_randseed -> flint_rand_get_seed but keep the old names, marked as deprecated with the new keyword FLINT_DEPRECATED, to preserve backwards-compatibility. * Deprecate _flint_rand_init_gmp and replace with the two new functions _flint_rand_init_gmp_state and _flint_rand_clear_gmp_state. NOTE: The new init-function for the GMP-state assumes that __gmp_state *is not* initialized, and the new clear-function assumes that __gmp_state *is* initialized. To help with this, a new macro `FLINT_RAND_GMP_STATE_IS_INITIALISED(state)` can be utilized to check whether the GMP-state is initialized in `state`, assuming that `state` has been initialized via `flint_rand_init`. * Deprecate flint_rand_alloc and flint_rand_free. * Typedef `ulong` and `slong` to proper primitive C type instead of relying on GMP's `mp_limb_t` and `mp_limb_signed_t`.
|
Nemo still needs a fix, but I will push that soon. |
|
CI fails on Cygwin. |
|
Yes, I saw that. Will fix. |
|
Note that the struct rename breaks backwards compatibility sagemath/sage#39413 . If backwards compatibility is supported for p/s this might have to do with cython/cython#1984 |
This is a breaking change. To mitigate this, you can use preprocessor stuff to maintain compatibility with older versions. |
Sure. However, since the only public use of If you eliminate |
Sorry, but I will not bring back
Seems reasonable. |
Rename
flint_rand_stoflint_rand_struct,Replace fields
gmp_stateandgmp_initinflint_rand_sbyvoid * __gmp_state,Rename the following functions:
Remove
_flint_rand_init_gmpand replace with the two new functions_flint_rand_init_gmp_stateand_flint_rand_clear_gmp_state.NOTE: The new init-function for the GMP-state assumes that
__gmp_stateis not initialized, and the new clear-function assumes that__gmp_stateis initialized. To help with this, a new macroFLINT_RAND_GMP_STATE_IS_INITIALISED(state)can be utilized to check whether the GMP-state is initialized instate, assuming thatstatehas been initialized viaflint_rand_init.Typedef
ulongandslongto proper primitive C type instead of relying on GMP'smp_limb_tandmp_limb_signed_t.