215{
216
217 const int n = R->
n_vars();
218 if (h.inCoeffDomain())
219 {
220 if (h.inZ())
221 {
226 }
227 else if (h.inQ())
228 {
233 if (not ok)
234 {
235 std::cout << "internal error: unexpected failure to lift "
236 "rational number to ring"
237 << std::endl;
239 }
241 mpq_clear(&z);
242 return ret;
243 }
244 else if (h.inFF())
246 else if (h.inExtension())
247 {
250 for (int j = h.taildegree(); j <= h.degree(); j++)
251 {
259 }
261 }
262 else
263 {
264 ERROR(
"conversion from factory over unknown type");
266 }
267 }
269 for (int j = h.taildegree(); j <= h.degree(); j++)
270 {
274 int var =
275#if REVERSE_VARIABLES
276 (n - 1) -
277#endif
278 (h.level() - 1);
283 }
285}
virtual ring_elem var(int v) const =0
virtual ring_elem from_long(long n) const =0
void add_to(ring_elem &f, const ring_elem &g) const
virtual ring_elem from_int(mpz_srcptr n) const =0
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 mult(const ring_elem f, const ring_elem g) const =0
virtual bool from_rational(const mpq_srcptr q, ring_elem &result) const =0
ring_elem get_value() const
static RingElement * make_raw(const Ring *R, ring_elem f)
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
static const RingElement * convertToM2(const PolynomialRing *R, CanonicalForm h)
static __mpz_struct toInteger(CanonicalForm h)
const RingElement * algebraicElement_M2
VALGRIND_MAKE_MEM_DEFINED & result(result)