def sdm_mul_term(f, term, O, K):
 (X, c) = term
 if ((not f) or (not c)):
  return []
 elif K.is_one(c):
  return [(sdm_monomial_mul(f_M, X), f_c) for (f_M, f_c) in f]
 else:
  return [(sdm_monomial_mul(f_M, X), (f_c * c)) for (f_M, f_c) in f]

def sdm_mul_term ( f , term , O , K ) : ( X , c ) = term if ( ( not f ) or ( not c ) ) : return [ ] elif K . is_one ( c ) : return [ ( sdm_monomial_mul ( f_M , X ) , f_c ) for ( f_M , f_c ) in f ] else : return [ ( sdm_monomial_mul ( f_M , X ) , ( f_c * c ) ) for ( f_M , f_c ) in f ]
multiply a distributed module element f by a term term .