Exponentiation. This is the default function, if a class doesn't define this.
Reimplemented from Ring.
Reimplemented in SchurRing, SkewPolynomialRing, SolvableAlgebra, and WeylAlgebra.
Definition at line 829 of file poly.cpp.
830{
832
833 if (mpz_sgn(n) == 0)
return from_long(1);
835
836 mpz_t abs_n;
837 mpz_init(abs_n);
838 mpz_abs(abs_n, n);
839 if (mpz_sgn(n) > 0)
840 ff = f0;
841 else
843
844 Nterm *f = ff;
845
846
847
849 if (n1.first)
850 {
852 }
854 {
855 ring_elem a =
K_->power(f->
coeff, abs_n);
857 }
858 else
859 {
860 ERROR(
"exponent too large");
862 }
863
864 mpz_clear(abs_n);
866}
virtual ring_elem power(const ring_elem f, mpz_srcptr n) const
Exponentiation. This is the default function, if a class doesn't define this.
virtual ring_elem from_long(long n) const
virtual ring_elem invert(const ring_elem f) const
virtual bool is_unit(const ring_elem f) const
virtual ring_elem make_flat_term(const ring_elem a, const_monomial m) const
virtual bool is_zero(const ring_elem f) const
static std::pair< bool, int > get_si(mpz_srcptr n)
VALGRIND_MAKE_MEM_DEFINED & result(result)
References Nterm::coeff, ERROR, from_long(), RingZZ::get_si(), invert(), is_unit(), is_zero(), PolynomialRing::K_, make_flat_term(), Nterm::monom, power(), result(), and ZERO_RINGELEM.
Referenced by power().