SatBinomIdeal.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2009 Bjarke Hammersholt Roune (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 SAT_BINOM_IDEAL_GUARD
#define SAT_BINOM_IDEAL_GUARD
#include "VarNames.h"
#include <vector>
class BigIdeal;
class Matrix;
class SatBinomIdeal {
public:
SatBinomIdeal();
SatBinomIdeal(const VarNames& names);
void insert(const vector<mpz_class>& binom);
const vector<mpz_class>& getGenerator(size_t index) const;
size_t getGeneratorCount() const;
void print(FILE* file) const;
void print(ostream& out) const;
void clearAndSetNames(const VarNames& names);
void removeGeneratorsWithLeadingZero();
void removeGeneratorsWithoutLeadingZero();
void getInitialIdeal(BigIdeal& ideal) const;
void renameVars(const VarNames& names);
size_t getVarCount() const;
void clear();
void reserve(size_t size);
vector<mpz_class>& getLastBinomRef();
void newLastTerm();
const VarNames& getNames() const;
bool hasZeroEntry() const;
bool initialIdealIsWeaklyGeneric() const;
bool isGeneric() const;
void getDoubleTriangleCount(mpz_class& count) const;
bool isPointFreeBody(const vector<mpz_class>& a,
const vector<mpz_class>& b) const;
bool isPointFreeBody(const vector<mpz_class>& a,
const vector<mpz_class>& b,
const vector<mpz_class>& c) const;
bool isInterior(const vector<mpz_class>& a,
const vector<mpz_class>& b) const;
bool isInteriorEdge(size_t from, size_t to) const;
bool isTerminatingEdge(size_t from, size_t to) const;
bool validate() const;
bool isDominating(const vector<mpz_class>& v) const;
bool isGenerator(const vector<mpz_class>& v) const;
void projectVar(size_t var);
SatBinomIdeal& operator=(const SatBinomIdeal& ideal);
void getMatrix(Matrix& matrix) const;
private:
vector<vector<mpz_class> > _gens;
VarNames _names;
};
ostream& operator<<(ostream& out, const SatBinomIdeal& ideal);
#endif
operator<<
ostream & operator<<(ostream &out, const SatBinomIdeal &ideal)
VarNames.h
BigIdeal
Definition BigIdeal.h:27
Matrix
Definition Matrix.h:26
SatBinomIdeal
Represents a saturated binomial ideal.
Definition SatBinomIdeal.h:28
SatBinomIdeal::getDoubleTriangleCount
void getDoubleTriangleCount(mpz_class &count) const
Returns the number of pairs of generators a and b such that {0,a,a+b} and {0,b,a+b}...
Definition SatBinomIdeal.cpp:308
SatBinomIdeal::newLastTerm
void newLastTerm()
Definition SatBinomIdeal.cpp:135
SatBinomIdeal::isGeneric
bool isGeneric() const
Returns true if the generating set is generic, i.e.
Definition SatBinomIdeal.cpp:327
SatBinomIdeal::getLastBinomRef
vector< mpz_class > & getLastBinomRef()
Definition SatBinomIdeal.cpp:129
SatBinomIdeal::validate
bool validate() const
Temporary.
Definition SatBinomIdeal.cpp:246
SatBinomIdeal::isInterior
bool isInterior(const vector< mpz_class > &a, const vector< mpz_class > &b) const
Returns true if max(0,a,b) is strictly positive in every element.
Definition SatBinomIdeal.cpp:213
SatBinomIdeal::isPointFreeBody
bool isPointFreeBody(const vector< mpz_class > &a, const vector< mpz_class > &b) const
Returns true if the smallest body containing zero, a and b has no generator in its interior.
Definition SatBinomIdeal.cpp:175
SatBinomIdeal::isInteriorEdge
bool isInteriorEdge(size_t from, size_t to) const
Returns whether {to,to+from} is an interior edge of Top.
Definition SatBinomIdeal.cpp:280
SatBinomIdeal::print
void print(FILE *file) const
Definition SatBinomIdeal.cpp:49
SatBinomIdeal::renameVars
void renameVars(const VarNames &names)
Requires that names.getVarCount() equals getVarCount().
Definition SatBinomIdeal.cpp:76
SatBinomIdeal::getVarCount
size_t getVarCount() const
Definition SatBinomIdeal.cpp:72
SatBinomIdeal::isTerminatingEdge
bool isTerminatingEdge(size_t from, size_t to) const
Returns wehther {from,to+from} is an interior edge of Top and also {to,to+from} is an edge of Top (no...
Definition SatBinomIdeal.cpp:295
SatBinomIdeal::getGeneratorCount
size_t getGeneratorCount() const
Definition SatBinomIdeal.cpp:45
SatBinomIdeal::operator=
SatBinomIdeal & operator=(const SatBinomIdeal &ideal)
Definition SatBinomIdeal.cpp:331
SatBinomIdeal::insert
void insert(const vector< mpz_class > &binom)
Definition SatBinomIdeal.cpp:33
SatBinomIdeal::getNames
const VarNames & getNames() const
Definition SatBinomIdeal.cpp:82
SatBinomIdeal::getGenerator
const vector< mpz_class > & getGenerator(size_t index) const
Definition SatBinomIdeal.cpp:39
SatBinomIdeal::removeGeneratorsWithoutLeadingZero
void removeGeneratorsWithoutLeadingZero()
Definition SatBinomIdeal.cpp:106
SatBinomIdeal::reserve
void reserve(size_t size)
Definition SatBinomIdeal.cpp:91
SatBinomIdeal::_gens
vector< vector< mpz_class > > _gens
Definition SatBinomIdeal.h:122
SatBinomIdeal::hasZeroEntry
bool hasZeroEntry() const
Returns true if any generator does not involve every variable, i.e.
Definition SatBinomIdeal.cpp:140
SatBinomIdeal::removeGeneratorsWithLeadingZero
void removeGeneratorsWithLeadingZero()
Definition SatBinomIdeal.cpp:95
SatBinomIdeal::clearAndSetNames
void clearAndSetNames(const VarNames &names)
Definition SatBinomIdeal.cpp:67
SatBinomIdeal::isDominating
bool isDominating(const vector< mpz_class > &v) const
Returns true if any generator, considered as an integer vector, is dominated by v.
Definition SatBinomIdeal.cpp:337
SatBinomIdeal::getInitialIdeal
void getInitialIdeal(BigIdeal &ideal) const
Definition SatBinomIdeal.cpp:117
SatBinomIdeal::getMatrix
void getMatrix(Matrix &matrix) const
Definition SatBinomIdeal.cpp:368
SatBinomIdeal::projectVar
void projectVar(size_t var)
Definition SatBinomIdeal.cpp:360
SatBinomIdeal::clear
void clear()
Definition SatBinomIdeal.cpp:86
SatBinomIdeal::SatBinomIdeal
SatBinomIdeal()
Definition SatBinomIdeal.cpp:26
SatBinomIdeal::_names
VarNames _names
Definition SatBinomIdeal.h:123
SatBinomIdeal::initialIdealIsWeaklyGeneric
bool initialIdealIsWeaklyGeneric() const
Returns true if the initial ideal is weakly generic.
Definition SatBinomIdeal.cpp:148
SatBinomIdeal::isGenerator
bool isGenerator(const vector< mpz_class > &v) const
Returns true if v is a generator.
Definition SatBinomIdeal.cpp:353
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40