Frobby 0.9.5
IdealComparator.h
Go to the documentation of this file.
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see http://www.gnu.org/licenses/.
16*/
17#ifndef IDEAL_COMPARATOR_GUARD
18#define IDEAL_COMPARATOR_GUARD
19
20class Ideal;
21class BigIdeal;
22class TermTranslator;
23
24// These three classes are in the same file because they use
25// templates in a way so that they all have the same implementation.
26// They all define the same order given the natural bijection between
27// the three different objects, and it is true of all of them that the
28// order of the generators matter, and that non-minimal generators
29// also matter. So to get an actual canonical order on the ideals as
30// mathematical objects, each ideal must be in a canonical form already.
31
32// Defines a total order on Ideal. The ideals compared must have the same
33// number of variables, though the number can vary between individual
34// calls to operator().
36 public:
37 bool operator()(const Ideal& a, const Ideal& b) const;
38 bool operator()(const Ideal* a, const Ideal* b) const;
39};
40
41// Defines a total order on Ideal based on the translated values. Each
42// ideal must have the same number of variables as the translator.
44 public:
46 bool operator()(const Ideal& a, const Ideal& b) const;
47 bool operator()(const Ideal* a, const Ideal* b) const;
48 private:
50};
51
52// Defines a total order on BigIdeal.
54 public:
55 bool operator()(const BigIdeal& a, const BigIdeal& b) const;
56 bool operator()(const BigIdeal* a, const BigIdeal* b) const;
57};
58
59namespace IdealComparatorHelpers {
60 bool idealLessThan(const BigIdeal& a, const BigIdeal& b);
61 bool idealLessThan(const Ideal& a, const Ideal& b);
62 bool idealLessThan(const Ideal& a, const Ideal& b,
63 TermTranslator& translator);
64}
65
66inline bool IdealComparator::operator()(const Ideal& a, const Ideal& b) const {
68}
69
70inline bool IdealComparator::operator()(const Ideal* a, const Ideal* b) const {
72}
73
75 const Ideal& b) const {
77}
78
80 const Ideal* b) const {
82}
83
85 const BigIdeal& b) const {
87}
88
89inline bool BigIdealComparator::operator()(const BigIdeal* a, const
90 BigIdeal* b) const {
92}
93
94#endif
bool operator()(const BigIdeal &a, const BigIdeal &b) const
bool operator()(const Ideal &a, const Ideal &b) const
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
TranslatedIdealComparator(TermTranslator &translator)
TermTranslator & _translator
bool operator()(const Ideal &a, const Ideal &b) const
bool idealLessThan(const BigIdeal &a, const BigIdeal &b)