Frobby  0.9.5
HilbertSlice.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 HILBERT_SLICE_GUARD
18 #define HILBERT_SLICE_GUARD
19 
20 #include "Slice.h"
21 #include "Term.h"
22 #include "Ideal.h"
23 
24 class CoefTermConsumer;
25 class HilbertStrategy;
26 
27 class HilbertSlice : public Slice {
28  public:
29  HilbertSlice(HilbertStrategy& strategy);
30  HilbertSlice(HilbertStrategy& strategy,
31  const Ideal& ideal,
32  const Ideal& subtract,
33  const Term& multiply,
34  CoefTermConsumer* consumer);
35 
37 
38  // *** Mutators
39 
40  virtual bool baseCase(bool simplified);
41 
42  virtual Slice& operator=(const Slice& slice);
43 
44  virtual bool simplifyStep();
45 
46  void setToProjOf(const Slice& slice,
47  const Projection& projection,
48  CoefTermConsumer* consumer);
49 
50  // Efficiently swaps the values of *this and slice while avoiding
51  // copies.
52  void swap(HilbertSlice& slice);
53 
54  private:
55  // Returns a lower bound on the content of the slice. Returns false
56  // if a base case is detected.
57  virtual bool getLowerBound(Term& bound, size_t var) const;
58 
60 };
61 
62 
63 inline void swap(HilbertSlice& a, HilbertSlice& b) { a.swap(b); }
64 
65 
66 #endif
void swap(HilbertSlice &a, HilbertSlice &b)
Definition: HilbertSlice.h:63
void setToProjOf(const Slice &slice, const Projection &projection, CoefTermConsumer *consumer)
virtual bool getLowerBound(Term &bound, size_t var) const
Calculates a lower bound that depends on var.
virtual bool baseCase(bool simplified)
Returns true if this slice is a base case slice, and in that case produces output in a derivative-spe...
virtual Slice & operator=(const Slice &slice)
Performs a deep copy of slice into this object.
virtual bool simplifyStep()
Like simplify(), except that only one simplification step is performed.
HilbertSlice(HilbertStrategy &strategy)
CoefTermConsumer * _consumer
Definition: HilbertSlice.h:59
void swap(HilbertSlice &slice)
CoefTermConsumer * getConsumer()
Definition: HilbertSlice.h:36
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
This class represents a slice, which is the central data structure of the Slice Algorithm.
Definition: Slice.h:77
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49