def _rational_reconstruction_int_coeffs(hm, m, ring):
 h = ring.zero
 if isinstance(ring.domain, PolynomialRing):
  reconstruction = _rational_reconstruction_int_coeffs
  domain = ring.domain.ring
 else:
  reconstruction = _integer_rational_reconstruction
  domain = hm.ring.domain
 for (monom, coeff) in hm.iterterms():
  coeffh = reconstruction(coeff, m, domain)
  if (not coeffh):
   return None
  h[monom] = coeffh
 return h

def _rational_reconstruction_int_coeffs ( hm , m , ring ) : h = ring . zero if isinstance ( ring . domain , PolynomialRing ) : reconstruction = _rational_reconstruction_int_coeffs domain = ring . domain . ring else : reconstruction = _integer_rational_reconstruction domain = hm . ring . domain for ( monom , coeff ) in hm . iterterms ( ) : coeffh = reconstruction ( coeff , m , domain ) if ( not coeffh ) : return None h [ monom ] = coeffh return h
reconstruct every rational coefficient c_h of a polynomial h in mathbb q[t_1 .