Frobby  0.9.0
BigattiBaseCase.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2009 University of Aarhus
3  Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see http://www.gnu.org/licenses/.
17 */
18 #ifndef BIGATTI_BASE_CASE_GUARD
19 #define BIGATTI_BASE_CASE_GUARD
20 
21 class BigattiState;
22 class TermTranslator;
23 
24 #include "Term.h"
25 #include "Ideal.h"
26 #include "HashPolynomial.h"
27 #include "UniHashPolynomial.h"
28 #include <vector>
29 
34  public:
38  BigattiBaseCase(const TermTranslator& translator);
39 
43  bool genericBaseCase(const BigattiState& state);
44 
47  bool baseCase(const BigattiState& state);
48 
51  void output(bool plus, const Term& term);
52 
56  void feedOutputTo(CoefBigTermConsumer& consumer, bool inCanonicalOrder);
57 
60  void setPrintDebug(bool value);
61 
64  void setComputeUnivariate(bool value);
65 
67  size_t getTotalBaseCasesEver() const;
68 
73  size_t getTotalTermsOutputEver() const;
74 
77  size_t getTotalTermsInOutput() const;
78 
79  private:
82  bool simpleBaseCase(const BigattiState& state);
83 
84  bool univariateAllFaces(const BigattiState& state);
85 
94  void enumerateScarfComplex(const BigattiState& state, bool allFaces);
95 
96  vector<size_t> _maxCount;
98  mpz_class _tmp;
99 
103 
107 
110  struct State {
113  bool plus;
114  };
115 
118  vector<State> _states;
119 
123 
126 
129 
132 
134 };
135 
136 #endif
This class handles the base cases for the Hilbert-Poincare series by Bigatti et.al.
Cont::const_iterator const_iterator
Definition: Ideal.h:43
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
Used in enumerateScarfComplex and necessary to have here to define _states.
A sparse univariate polynomial represented by a hash table mapping terms to coefficients.
void enumerateScarfComplex(const BigattiState &state, bool allFaces)
The ideal in state must be weakly generic.
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
BigattiBaseCase(const TermTranslator &translator)
Initialize this object to handle the computation of Hilbert-Poincare series numerator polynomials in ...
void feedOutputTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder)
Feed the output Hilbert-Poincare numerator polynomial computed so far to the consumer.
size_t _totalTermsOutputEver
For statistics.
A sparse multivariate polynomial represented by a hash table mapping terms to coefficients.
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
UniHashPolynomial _outputUnivariate
The part of the coarsely graded Hilbert-Poincare numerator polynomial computed so far...
void setComputeUnivariate(bool value)
Use the fine grading if value is false, otherwise grade each variable by the same variable t...
bool simpleBaseCase(const BigattiState &state)
Computes the Hilbert-Poincare series of state and returns true if state is a particularly simple and ...
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
const TermTranslator & _translator
Used to translate the output from ints.
void setPrintDebug(bool value)
Starts to print debug output on what happens if value is true.
size_t getTotalTermsInOutput() const
Returns the number of terms in the output polynomial right now.
Ideal::const_iterator pos
vector< size_t > _maxCount
HashPolynomial _outputMultivariate
The part of the finely graded Hilbert-Poincare numerator polynomial computed so far.
bool univariateAllFaces(const BigattiState &state)
size_t _totalBaseCasesEver
For statistics.
vector< State > _states
Used in enumerateScarfCompex.
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49
bool _computeUnivariate
Use the fine grading if false, otherwise grade each variable by the same variable t...