Macaulay2 Engine
Loading...
Searching...
No Matches
pcomparator.hpp File Reference

BIBasis::PointerLessComparator / PointerMoreComparator — pointer-deref comparators for STL containers. More...

#include <string>
#include "error.h"

Go to the source code of this file.

Classes

class  BIBasis::PointerLessComparator< T >
class  BIBasis::PointerMoreComparator< T >

Namespaces

namespace  BIBasis

Detailed Description

BIBasis::PointerLessComparator / PointerMoreComparator — pointer-deref comparators for STL containers.

Note
AI-generated documentation. Verify against the source before relying on it.

Two tiny templated function objects so a std::sort or std::set over Polynom* / Triple* collections orders by the pointed-to value rather than the raw pointer address. PointerLessComparator forwards to T::operator<; PointerMoreComparator forwards to T::operator> for descending sorts. Both throw a descriptive std::string on a null pointer so the algorithm fails loudly rather than dereferencing junk.

Currently only BooleanInvolutiveBasis::ReduceSet uses PointerMoreComparator to sort the working GBasis list descending by leading monomial before incremental reduction; PointerLessComparator is provided symmetrically for future callers.

See also
polynom.hpp
involutive.hpp
triple.hpp

Definition in file pcomparator.hpp.