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

◆ heft_degree()

std::pair< int, bool > FreeAlgebra::heft_degree ( const Poly & f) const

Definition at line 859 of file FreeAlgebra.cpp.

860{
861 bool ishomog = true;
862 Word tmp;
863 auto i = f.cbegin();
864 if (i == f.cend()) return std::make_pair(0, true);
865 monoid().wordFromMonom(tmp, i.monom());
866 int maxheft = monoid().wordHeft(tmp);
867 for (++i; i != f.cend(); ++i)
868 {
869 monoid().wordFromMonom(tmp, i.monom());
870 int thisheft = monoid().wordHeft(tmp);
871 if (thisheft != maxheft)
872 {
873 ishomog = false;
874 if (thisheft > maxheft)
875 maxheft = thisheft;
876 }
877 }
878 return std::make_pair(maxheft, ishomog);
879}
const FreeMonoid & monoid() const
int wordHeft(Word &word) const
void wordFromMonom(Word &result, const Monom &m) const

References monoid(), FreeMonoid::wordFromMonom(), and FreeMonoid::wordHeft().

Referenced by NCF4::NCF4(), and NCGroebner::NCGroebner().