36 _gens.push_back(binom);
52 fputs(tmp.str().c_str(), out);
56 out <<
"/---- SatBinomIdeal of " <<
_gens.size() <<
" generators:\n";
57 for (vector<vector<mpz_class> >::const_iterator it =
_gens.begin();
58 it !=
_gens.end(); ++it) {
59 for (vector<mpz_class>::const_iterator entry = it->begin();
60 entry != it->end(); ++entry)
64 out <<
"----/ End of list.\n";
157 bool sharesEntry =
false;
159 if (g1[var] == g2[var] && g1[var] > 0) {
176 const vector<mpz_class>& b)
const {
184 rhs[var] = a[var] > b[var] ? a[var] : b[var];
194 const vector<mpz_class>& b,
195 const vector<mpz_class>& c)
const {
203 rhs[var] = a[var] > b[var] ? a[var] : b[var];
204 rhs[var] = rhs[var] > c[var] ? rhs[var] : c[var];
214 const vector<mpz_class>& b)
const {
215 ASSERT(a.size() == b.size());
220 for (
size_t var = 1; var < a.size(); ++var)
221 if (a[var] <= 0 && b[var] <= 0)
227 bool hasCycle(
size_t gen, vector<char>& color,
const SatBinomIdeal& ideal) {
239 hasCycle(g, color, ideal))
256 if (hasCycle(gen, color, *
this))
263 size_t outDegree = 0;
289 vector<mpz_class> sum(fromGen.size());
290 for (
size_t var = 0; var < fromGen.size(); ++var)
291 sum[var] = fromGen[var] + toGen[var];
302 vector<mpz_class> sum(fromGen.size());
303 for (
size_t var = 0; var < fromGen.size(); ++var)
304 sum[var] = fromGen[var] + toGen[var];
319 sum[var] = g1[var] + g2[var];
353 (
const vector<mpz_class>& v)
const {
354 for (
size_t gen = 0; gen < getGeneratorCount(); ++gen)
355 if (getGenerator(gen) == v)
372 matrix(gen, var) =
_gens[gen][var];
void clearAndSetNames(const VarNames &names)
vector< vector< mpz_class > > _gens
Represents a saturated binomial ideal.
void projectVar(size_t index)
void print(FILE *file) const
const vector< mpz_class > & getGenerator(size_t index) const
size_t getVarCount() const
Returns the current number of variables.
mpz_class & getLastTermExponentRef(size_t var)
void clear()
Resets the number of variables to zero.
void reserve(size_t capacity)
bool initialIdealIsWeaklyGeneric() const
Returns true if the initial ideal is weakly generic.
void removeGeneratorsWithoutLeadingZero()
Defines the variables of a polynomial ring and facilities IO involving them.
void projectVar(size_t var)
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...
bool isInteriorEdge(size_t from, size_t to) const
Returns whether {to,to+from} is an interior edge of Top.
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.
void resize(size_t rowCount, size_t colCount)
Set the number of rows and columns.
bool hasZeroEntry() const
Returns true if any generator does not involve every variable, i.e.
bool isGeneric() const
Returns true if the generating set is generic, i.e.
bool validate() const
Temporary.
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...
void renameVars(const VarNames &names)
Requires that names.getVarCount() equals getVarCount().
bool isDominating(const vector< mpz_class > &v) const
Returns true if any generator, considered as an integer vector, is dominated by v.
void reserve(size_t size)
const VarNames & getNames() const
size_t getVarCount() const
void clearAndSetNames(const VarNames &names)
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} are both interior...
SatBinomIdeal & operator=(const SatBinomIdeal &ideal)
void getInitialIdeal(BigIdeal &ideal) const
void getMatrix(Matrix &matrix) const
void removeGeneratorsWithLeadingZero()
void insert(const vector< mpz_class > &binom)
bool isGenerator(const vector< mpz_class > &v) const
Returns true if v is a generator.
vector< mpz_class > & getLastBinomRef()
size_t getGeneratorCount() const