BigattiBaseCase.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2009 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef BIGATTI_BASE_CASE_GUARD
#define BIGATTI_BASE_CASE_GUARD
class BigattiState;
class TermTranslator;
#include "Term.h"
#include "Ideal.h"
#include "HashPolynomial.h"
#include "UniHashPolynomial.h"
#include <vector>
class BigattiBaseCase {
public:
BigattiBaseCase(const TermTranslator& translator);
bool genericBaseCase(const BigattiState& state);
bool baseCase(const BigattiState& state);
void output(bool plus, const Term& term);
void feedOutputTo(CoefBigTermConsumer& consumer, bool inCanonicalOrder);
void setPrintDebug(bool value);
void setComputeUnivariate(bool value);
size_t getTotalBaseCasesEver() const;
size_t getTotalTermsOutputEver() const;
size_t getTotalTermsInOutput() const;
private:
bool simpleBaseCase(const BigattiState& state);
bool univariateAllFaces(const BigattiState& state);
void enumerateScarfComplex(const BigattiState& state, bool allFaces);
vector<size_t> _maxCount;
Term _lcm;
mpz_class _tmp;
HashPolynomial _outputMultivariate;
UniHashPolynomial _outputUnivariate;
struct State {
Term term;
Ideal::const_iterator pos;
bool plus;
};
vector<State> _states;
bool _computeUnivariate;
const TermTranslator& _translator;
size_t _totalBaseCasesEver;
size_t _totalTermsOutputEver;
bool _printDebug;
};
#endif
HashPolynomial.h
Ideal.h
Term.h
UniHashPolynomial.h
BigattiBaseCase::BigattiBaseCase
BigattiBaseCase(const TermTranslator &translator)
Initialize this object to handle the computation of Hilbert-Poincare series numerator polynomials in ...
Definition BigattiBaseCase.cpp:25
BigattiBaseCase::_tmp
mpz_class _tmp
Definition BigattiBaseCase.h:98
BigattiBaseCase::_totalBaseCasesEver
size_t _totalBaseCasesEver
For statistics.
Definition BigattiBaseCase.h:128
BigattiBaseCase::getTotalTermsOutputEver
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
Definition BigattiBaseCase.cpp:128
BigattiBaseCase::setPrintDebug
void setPrintDebug(bool value)
Starts to print debug output on what happens if value is true.
Definition BigattiBaseCase.cpp:116
BigattiBaseCase::_lcm
Term _lcm
Definition BigattiBaseCase.h:97
BigattiBaseCase::genericBaseCase
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
Definition BigattiBaseCase.cpp:36
BigattiBaseCase::_printDebug
bool _printDebug
Definition BigattiBaseCase.h:133
BigattiBaseCase::univariateAllFaces
bool univariateAllFaces(const BigattiState &state)
Definition BigattiBaseCase.cpp:168
BigattiBaseCase::getTotalBaseCasesEver
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
Definition BigattiBaseCase.cpp:124
BigattiBaseCase::setComputeUnivariate
void setComputeUnivariate(bool value)
Use the fine grading if value is false, otherwise grade each variable by the same variable t.
Definition BigattiBaseCase.cpp:120
BigattiBaseCase::_maxCount
vector< size_t > _maxCount
Definition BigattiBaseCase.h:96
BigattiBaseCase::simpleBaseCase
bool simpleBaseCase(const BigattiState &state)
Computes the Hilbert-Poincare series of state and returns true if state is a particularly simple and ...
Definition BigattiBaseCase.cpp:139
BigattiBaseCase::_computeUnivariate
bool _computeUnivariate
Use the fine grading if false, otherwise grade each variable by the same variable t.
Definition BigattiBaseCase.h:122
BigattiBaseCase::baseCase
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
Definition BigattiBaseCase.cpp:49
BigattiBaseCase::enumerateScarfComplex
void enumerateScarfComplex(const BigattiState &state, bool allFaces)
The ideal in state must be weakly generic.
Definition BigattiBaseCase.cpp:241
BigattiBaseCase::_outputMultivariate
HashPolynomial _outputMultivariate
The part of the finely graded Hilbert-Poincare numerator polynomial computed so far.
Definition BigattiBaseCase.h:102
BigattiBaseCase::_translator
const TermTranslator & _translator
Used to translate the output from ints.
Definition BigattiBaseCase.h:125
BigattiBaseCase::_totalTermsOutputEver
size_t _totalTermsOutputEver
For statistics.
Definition BigattiBaseCase.h:131
BigattiBaseCase::_states
vector< State > _states
Used in enumerateScarfCompex.
Definition BigattiBaseCase.h:118
BigattiBaseCase::output
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
Definition BigattiBaseCase.cpp:86
BigattiBaseCase::_outputUnivariate
UniHashPolynomial _outputUnivariate
The part of the coarsely graded Hilbert-Poincare numerator polynomial computed so far.
Definition BigattiBaseCase.h:106
BigattiBaseCase::feedOutputTo
void feedOutputTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder)
Feed the output Hilbert-Poincare numerator polynomial computed so far to the consumer.
Definition BigattiBaseCase.cpp:108
BigattiBaseCase::getTotalTermsInOutput
size_t getTotalTermsInOutput() const
Returns the number of terms in the output polynomial right now.
Definition BigattiBaseCase.cpp:132
BigattiState
Definition BigattiState.h:27
CoefBigTermConsumer
Definition CoefBigTermConsumer.h:29
HashPolynomial
A sparse multivariate polynomial represented by a hash table mapping terms to coefficients.
Definition HashPolynomial.h:42
Ideal::const_iterator
Cont::const_iterator const_iterator
Definition Ideal.h:43
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
UniHashPolynomial
A sparse univariate polynomial represented by a hash table mapping terms to coefficients.
Definition UniHashPolynomial.h:41
BigattiBaseCase::State
Used in enumerateScarfComplex and necessary to have here to define _states.
Definition BigattiBaseCase.h:110
BigattiBaseCase::State::pos
Ideal::const_iterator pos
Definition BigattiBaseCase.h:112
BigattiBaseCase::State::plus
bool plus
Definition BigattiBaseCase.h:113
BigattiBaseCase::State::term
Term term
Definition BigattiBaseCase.h:111