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

◆ rawRandomQQ()

gmp_QQ rawRandomQQ ( gmp_ZZ height)

Definition at line 194 of file random.cpp.

197{
198 mpq_ptr result = getmemstructtype(mpq_ptr);
199 mpq_init(result);
200
201 try {
202 rawSetRandomQQ(result, height);
203 } catch (const exc::engine_error& e) {
204 ERROR(e.what());
205 return nullptr;
206 }
207
208 return moveTo_gmpQQ(result);
209}
gmp_QQ moveTo_gmpQQ(mpq_ptr z)
Definition gmp-util.h:58
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define getmemstructtype(S)
Definition m2-mem.h:143
void rawSetRandomQQ(mpq_ptr result, gmp_ZZ height)
Definition random.cpp:170

References ERROR, getmemstructtype, moveTo_gmpQQ(), rawSetRandomQQ(), and result().

Referenced by getElement< RingQQ >().