Example #1
0
 void set_var(ElementType& result, int v) const
 {
   if (v != 0) set_from_long(result, 1);
   std::vector<long> poly = {0, 1};
   fromSmallIntegerCoefficients(result, poly);
   // printf("variable is %lu\n", result.value);
 }
Example #2
0
 bool ARingGFFlint::promote(const Ring *Rf, const ring_elem f, ElementType& result) const
 {
   if (&originalRing() != Rf) return false;
   std::vector<long> poly;
   RingElement F(Rf,f);
   F.getSmallIntegerCoefficients(poly);
   fromSmallIntegerCoefficients(result, poly);
   return true;
 }