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

◆ compare_elems()

int SchurRing2::compare_elems ( const ring_elem f,
const ring_elem g ) const
virtual

Implements Ring.

Definition at line 365 of file schur2.cpp.

366{
367// assuming the monomials are sorted in the linear order on the partitions
368// see SchurRing2::compare_partitions
369
370 auto f_it = f.get_schur_poly()->begin(),
371 f_end = f.get_schur_poly()->end();
372 auto g_it = g.get_schur_poly()->begin(),
373 g_end = g.get_schur_poly()->end();
374
375 for(; f_it!=f_end && g_it!=g_end; ++f_it, ++g_it) {
376 auto cmp = compare_partitions(f_it.getMonomial(), g_it.getMonomial());
377 if(cmp) return cmp;
378 }
379
380 return (f_it!=f_end)-(g_it!=g_end); // LT, EQ or GT
381}
int compare_partitions(const_schur_partition a, const_schur_partition b) const
Definition schur2.cpp:348
iterator begin() const
Definition schur2.hpp:128
iterator end() const
Definition schur2.hpp:132
const schur_poly * get_schur_poly() const
Definition ringelem.hpp:137

References schur_poly::begin(), compare_partitions(), schur_poly::end(), and ring_elem::get_schur_poly().