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 {
372 matrix(gen, var) =
_gens[gen][var];
void reserve(size_t capacity)
void clearAndSetNames(const VarNames &names)
mpz_class & getLastTermExponentRef(size_t var)
void resize(size_t rowCount, size_t colCount)
Set the number of rows and columns.
Represents a saturated binomial ideal.
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...
bool isGeneric() const
Returns true if the generating set is generic, i.e.
vector< mpz_class > & getLastBinomRef()
bool validate() const
Temporary.
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.
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.
bool isInteriorEdge(size_t from, size_t to) const
Returns whether {to,to+from} is an interior edge of Top.
void print(FILE *file) const
void renameVars(const VarNames &names)
Requires that names.getVarCount() equals getVarCount().
size_t getVarCount() const
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...
size_t getGeneratorCount() const
SatBinomIdeal & operator=(const SatBinomIdeal &ideal)
void insert(const vector< mpz_class > &binom)
const VarNames & getNames() const
const vector< mpz_class > & getGenerator(size_t index) const
void removeGeneratorsWithoutLeadingZero()
void reserve(size_t size)
vector< vector< mpz_class > > _gens
bool hasZeroEntry() const
Returns true if any generator does not involve every variable, i.e.
void removeGeneratorsWithLeadingZero()
void clearAndSetNames(const VarNames &names)
bool isDominating(const vector< mpz_class > &v) const
Returns true if any generator, considered as an integer vector, is dominated by v.
void getInitialIdeal(BigIdeal &ideal) const
void getMatrix(Matrix &matrix) const
void projectVar(size_t var)
bool initialIdealIsWeaklyGeneric() const
Returns true if the initial ideal is weakly generic.
bool isGenerator(const vector< mpz_class > &v) const
Returns true if v is a generator.
Defines the variables of a polynomial ring and facilities IO involving them.
size_t getVarCount() const
Returns the current number of variables.
void projectVar(size_t index)
void clear()
Resets the number of variables to zero.