Go to the documentation of this file.
18 #ifndef RAW_SQUARE_FREE_IDEAL_GUARD
19 #define RAW_SQUARE_FREE_IDEAL_GUARD
85 void print(FILE* file)
const;
88 void print(ostream& out)
const;
105 bool insert(
const std::vector<std::string>& term);
108 void colon(
size_t var);
201 void swap(
size_t a,
size_t b);
208 return !(*
this == ideal);
bool operator!=(const RawSquareFreeIdeal &ideal) const
iterator(Word *term, size_t wordsPerTerm)
const_iterator operator+(ptrdiff_t i) const
size_t getGeneratorCount() const
const_iterator doesn't have all it needs to be a proper STL iterator.
void insertNonMultiples(const Word *term, const RawSquareFreeIdeal &ideal)
Insert those generators of ideal that are not multiples of term.
size_t insert(const Ideal &ideal)
Inserts the generators of ideal from index 0 onward until reaching a non-squarefree generator or all ...
const size_t _wordsPerTerm
Word * getGeneratorUnsafe(size_t index)
Returns a pointer to the memory where a generator at index would be, even if index is equal to or gre...
bool isValid() const
Returns true if the internal invariants of ideal are satisfied.
const size_t _wordsPerTerm
const_iterator begin() const
size_t getVarCount() const
const_iterator(const Word *term, size_t wordsPerTerm)
bool operator!=(const const_iterator &it) const
size_t getExclusiveVarGenerator()
Returns the index of a generator that is the only one to be divisible by some variable.
void getLcmOfNonMultiples(Word *lcm, size_t var) const
Sets lcm to be the least common multple of those generators that var does not divide.
bool isMinimallyGenerated() const
Returns true if no generator divides another.
iterator doesn't have all it needs to be a proper STL iterator.
void setToTransposeOf(const RawSquareFreeIdeal &ideal, Word *eraseVars=0)
Resets this object to the transpose of ideal.
static RawSquareFreeIdeal * construct(void *buffer, size_t varCount=0)
bool operator!=(const iterator &it) const
const Word * operator*() const
ptrdiff_t operator-(const iterator &it) const
iterator operator+(ptrdiff_t i) const
void compact(const Word *remove)
Removes the variables that divide remove.
const_iterator & operator=(const const_iterator &it)
const_iterator operator++()
bool hasFullSupport(const Word *ignore) const
Returns true if for every variable it either divides ignore or it divides some (not necessarily minim...
void removeGenerator(size_t index)
Removes the generator at index.
void colonReminimize(const Word *colon)
Performs a colon and minimize.
RawSquareFreeIdeal * newRawSquareFreeIdeal(size_t varCount, size_t capacity)
Allocates object with enough memory for capacity generators in varCount variables.
void swap01Exponents()
Change 0 exponents into 1 and vice versa.
const Word * back() const
bool operator==(const const_iterator &it) const
A bit packed square free ideal placed in a pre-allocated buffer.
bool operator==(const RawSquareFreeIdeal &ideal) const
Returns true if *this equals ideal.
RawSquareFreeIdeal * newRawSquareFreeIdealParse(const char *str)
Allocates and returns an ideal based on str.
size_t getMultiple(size_t var) const
Returns the index of the first generator that var divides or getGeneratorCount() if no such generator...
Word * getGenerator(size_t index)
Returns the generator at index.
unsigned long Word
The native unsigned type for the CPU.
void getVarDividesCounts(vector< size_t > &counts) const
Sets counts[var] to the number of generators that var divides.
size_t getMinSupportGen() const
Returns the index of a generator with minimum support.
void sortLexAscending()
Sorts the generators in ascending lex order.
ptrdiff_t operator-(const const_iterator &it) const
void lcm(Word *res, const Word *resEnd, const Word *a, const Word *b)
ostream & operator<<(ostream &out, const RawSquareFreeIdeal &ideal)
void colon(const Word *by)
void swap(size_t a, size_t b)
const_iterator operator--()
Represents a monomial ideal with int exponents.
const_iterator end() const
void print(FILE *file) const
Print a debug-suitable representation of this object to file.
size_t getNotRelativelyPrime(const Word *term)
Returns the index of the first generator that is not relatively prime with term.
RawSquareFreeIdeal & operator=(const RawSquareFreeIdeal &ideal)
Resets this object to be a copy of ideal.
void transpose(Word *eraseVars=0)
Equivalent to setToTransposeOf(this, eraseVars).
void deleteRawSquareFreeIdeal(RawSquareFreeIdeal *ideal)
Deallocates memory returned by newRawSquareFreeIdeal().
size_t getWordsPerTerm() const
bool operator==(const iterator &it) const
static size_t getBytesOfMemoryFor(size_t varCount, size_t generatorCount)
Returns the number of bytes of memory necessary to contain an ideal with the given parameters.
size_t getNonMultiple(size_t var) const
Returns the index of the first generator that var does not divide or getGeneratorCount() if no such g...
void getGcdOfMultiples(Word *gcd, size_t var) const
Sets gcd to be the greatest common denominator of those generators that are divisible by var.
void getLcm(Word *lcm) const
Puts the least common multiple of the generators of the ideal into lcm.
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)
iterator & operator=(const iterator &it)
size_t getMaxSupportGen() const
Returns the index of a generator with maximum support.