40 static const char* staticGetName() {
41 return Pred::staticGetName();
54 static const char* staticGetName() {
return "random";}
58 static constexpr unsigned min() {
return 0; }
59 static constexpr unsigned max() {
return RAND_MAX; }
60 unsigned operator()()
const {
return std::rand(); }
64 std::shuffle(ideal.
begin(), ideal.
end(),
g);
70 static const char* staticGetName() {
return "tdeg";}
84 static const char* staticGetName() {
return "median";}
94 static const char* staticGetName() {
return "posMedian";}
105 static const char* staticGetName() {
return "minPos";}
116 static const char* staticGetName() {
return "max";}
126 static const char* staticGetName() {
return "support";}
137 static const char* staticGetName() {
return "strongGenericity";}
150 for (cit
a = ideal.
begin();
a != ideal.
end(); ++
a) {
151 for (cit
b =
a + 1;
b != ideal.
end(); ++
b) {
181 return _degeneracy[
a] < _degeneracy[
b];
185 UnGenMap& _degeneracy;
191 static const char* staticGetName() {
return "null";}
197 class WeakGenericityOrderer :
public StrongGenericityOrderer {
199 static const char* staticGetName() {
return "weakGenericity";}
201 virtual void doOrder(
Ideal& ideal)
const {
218 _orderer->order(ideal);
226 CompositeOrderer(): _orderersDeleter(_orderers) {}
234 typedef Container::const_reverse_iterator rev_cit;
240 rev_cit
rbegin(_orderers.end());
241 rev_cit
rend(_orderers.begin());
271 if (prefix.substr(0, 3) ==
"rev") {
281 if (prefix.find(
'_') == string::npos)
void exceptionSafePushBack(Container &container, unique_ptr< Element > pointer)
unique_ptr< IdealOrderer > createIdealOrderer(const string &prefix)
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
unique_ptr< AbstractProduct > createWithPrefix(const NameFactory< AbstractProduct > &factory, const string &prefix)
Creates the unique product that has the indicated prefix, or create the actual product that has name ...
virtual void doOrder(Ideal &ideal) const =0
Represents a monomial ideal with int exponents.
Cont::const_iterator const_iterator
bool strictlyContains(const Exponent *term) const
const_iterator end() const
const_iterator begin() const
size_t getVarCount() const
A NameFactory takes a name and then creates an instance of a class that has been previously registere...
size_t getVarCount() const
virtual bool doPredicate(const Exponent *a, const Exponent *b) const =0
Term represents a product of variables which does not include a coefficient.
size_t getSizeOfSupport() const
static bool sharesNonZeroExponent(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether there is some such that .