Macaulay2 Engine
Loading...
Searching...
No Matches

◆ vec_locate_lead_term()

const vecterm * PolyRing::vec_locate_lead_term ( const FreeModule * F,
vec v ) const
virtual

Implements PolynomialRing.

Definition at line 2295 of file poly.cpp.

2298{
2299 if (v == nullptr) return v;
2300 const vecterm *lead = v;
2301 const SchreyerOrder *S = F->get_schreyer_order();
2302 if (S)
2303 {
2304 for (vec w = v->next; w != nullptr; w = w->next)
2305 {
2306 if (S->schreyer_compare(POLY(lead->coeff)->monom,
2307 lead->comp,
2308 POLY(w->coeff)->monom,
2309 w->comp) == LT)
2310 {
2311 lead = w;
2312 }
2313 }
2314 }
2315 else
2316 {
2317 for (vec w = v->next; w != nullptr; w = w->next)
2318 {
2319 if (M_->compare(POLY(lead->coeff)->monom,
2320 lead->comp,
2321 POLY(w->coeff)->monom,
2322 w->comp) == LT)
2323 {
2324 lead = w;
2325 }
2326 }
2327 }
2328 return lead;
2329}
const SchreyerOrder * get_schreyer_order() const
Definition freemod.hpp:103
const Monoid * M_
Definition polyring.hpp:124
int schreyer_compare(const_monomial m, int m_comp, const_monomial n, int n_comp) const
Definition schorder.cpp:337
#define POLY(q)
Definition poly.cpp:23
ring_elem coeff
Definition ringelem.hpp:172
const int LT
Definition style.hpp:39

References vec::coeff, vec::comp, FreeModule, LT, PolynomialRing::M_, POLY, and SchreyerOrder::schreyer_compare().

Referenced by vec_lead_term().