Macaulay2 Engine
Loading...
Searching...
No Matches

◆ rawSetRandomInteger()

void rawSetRandomInteger ( mpz_ptr result,
gmp_ZZ maxN )

Definition at line 56 of file random.cpp.

58{
59 if (maxN == nullptr) maxN = maxHeight;
60 if (mpz_cmp_si(maxN, 0) <= 0)
61 throw exc::engine_error("expected a positive height");
62
63 mpz_urandomm(result, state, maxN);
64}
VALGRIND_MAKE_MEM_DEFINED & result(result)
static mpz_t maxHeight
Definition random.cpp:17
static gmp_randstate_t state
Definition random.cpp:18

References maxHeight, result(), and state.

Referenced by M2::ARingZZGMP::random(), RingZZ::random(), and rawRandomInteger().