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

◆ power_mpz()

void M2::ARingGFFlint::power_mpz ( ElementType & result,
const ElementType & a,
mpz_srcptr n ) const
inline

Definition at line 364 of file aring-gf-flint.hpp.

365 {
366 if (mpz_sgn(n) < 0)
367 invert(result, a);
368 else
369 copy(result, a);
370
371 mpz_t abs_n;
372 mpz_init(abs_n);
373 mpz_abs(abs_n, n);
374
375 fmpz_t fn;
376 fmpz_init_set_readonly(fn, abs_n);
377 fq_zech_pow(&result, &result, fn, mContext);
378 fmpz_clear_readonly(fn);
379 mpz_clear(abs_n);
380 }
void copy(ElementType &result, const ElementType &a) const
fq_zech_ctx_t mContext
void invert(ElementType &result, const ElementType &a) const
OrigFn fn
Definition m2-mem.cpp:273
VALGRIND_MAKE_MEM_DEFINED & result(result)

References copy(), fn, invert(), mContext, and result().