Definition at line 245 of file relem.cpp.
246{
247 const PolynomialRing *P =
R->cast_to_PolynomialRing();
248 if (P == nullptr)
249 {
250 ERROR(
"expected polynomial ring");
251 return nullptr;
252 }
253 if (v < 0 || v >= P->
n_vars())
254 {
255 ERROR(
"homogenization: improper ring variable");
256 return nullptr;
257 }
258 if (wts.size() == 0 || wts.size() !=
static_cast<unsigned int>(P->
n_vars()))
259 {
260 ERROR(
"homogenization: improper weight function");
261 return nullptr;
262 }
263 if (wts[v] == 0)
264 {
265 ERROR(
"homogenization: variable weight is zero");
266 return nullptr;
267 }
268
270 if (
error())
return nullptr;
272}
virtual ring_elem homogenize(const ring_elem f, int v, int deg, const std::vector< int > &wts) const =0
RingElement(const Ring *R, ring_elem f)
VALGRIND_MAKE_MEM_DEFINED & result(result)
References ERROR, error(), PolynomialRing::homogenize(), PolynomialRing::n_vars(), R, result(), RingElement(), and val.
Referenced by IM2_RingElement_homogenize(), and IM2_RingElement_homogenize_to_degree().