|
Frobby 0.10.0
|
#include <RawSquareFreeIdeal.h>
Classes | |
| class | const_iterator |
| class | iterator |
Public Member Functions | |
| RawSquareFreeIdeal & | operator= (const RawSquareFreeIdeal &ideal) |
| void | setToTransposeOf (const RawSquareFreeIdeal &ideal, Word *eraseVars=0) |
| void | transpose (Word *eraseVars=0) |
| void | compact (const Word *remove) |
| void | print (FILE *file) const |
| void | print (ostream &out) const |
| size_t | insert (const Ideal &ideal) |
| size_t | insert (const BigIdeal &ideal) |
| void | insert (const RawSquareFreeIdeal &ideal) |
| void | insert (const Word *term) |
| void | insertIdentity () |
| bool | insert (const std::vector< std::string > &term) |
| void | minimize () |
| void | colon (const Word *by) |
| void | colon (size_t var) |
| void | colonReminimize (const Word *colon) |
| void | colonReminimize (size_t var) |
| void | swap01Exponents () |
| void | getLcm (Word *lcm) const |
| size_t | getGeneratorCount () const |
| size_t | getVarCount () const |
| size_t | getWordsPerTerm () const |
| Word * | getGenerator (size_t index) |
| const Word * | getGenerator (size_t index) const |
| Word * | getGeneratorUnsafe (size_t index) |
| const Word * | getGeneratorUnsafe (size_t index) const |
| void | getLcmOfNonMultiples (Word *lcm, size_t var) const |
| void | getGcdOfMultiples (Word *gcd, size_t var) const |
| void | getGcdOfMultiples (Word *gcd, const Word *div) const |
| void | getVarDividesCounts (vector< size_t > &counts) const |
| size_t | getMultiple (size_t var) const |
| size_t | getNonMultiple (size_t var) const |
| size_t | getMaxSupportGen () const |
| size_t | getMinSupportGen () const |
| void | removeGenerator (size_t index) |
| void | insertNonMultiples (const Word *term, const RawSquareFreeIdeal &ideal) |
| void | insertNonMultiples (size_t var, const RawSquareFreeIdeal &ideal) |
| size_t | getNotRelativelyPrime (const Word *term) |
| size_t | getExclusiveVarGenerator () |
| bool | hasFullSupport (const Word *ignore) const |
| bool | isMinimallyGenerated () const |
| void | swap (size_t a, size_t b) |
| bool | operator== (const RawSquareFreeIdeal &ideal) const |
| bool | operator!= (const RawSquareFreeIdeal &ideal) const |
| Word * | back () |
| const Word * | back () const |
| void | sortLexAscending () |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| bool | isValid () const |
Static Public Member Functions | |
| static RawSquareFreeIdeal * | construct (void *buffer, size_t varCount=0) |
| static RawSquareFreeIdeal * | construct (void *buffer, const Ideal &ideal) |
| static RawSquareFreeIdeal * | construct (void *buffer, const RawSquareFreeIdeal &ideal) |
| static size_t | getBytesOfMemoryFor (size_t varCount, size_t generatorCount) |
A bit packed square free ideal placed in a pre-allocated buffer.
Use SquareFreeIdeal for a more pleasant interface.
This class allocates none of its own memory. It must be initialized using the member function construct() in a buffer of sufficient size. What is sufficient memory for a given ideal can be determined by getBytesOfMemoryFor(). The buffer must be correctly aligned to support the data members that this class has.
| void RSFIdeal::colonReminimize | ( | const Word * | colon | ) |
Performs a colon and minimize. Object must be already minimized.
| void RSFIdeal::colonReminimize | ( | size_t | var | ) |
Performs a colon by var and minimize. Object must be already minimized.
| void RSFIdeal::compact | ( | const Word * | remove | ) |
Removes the variables that divide remove. Unless remove is the identity this will decrease varCount. The operation is much like colon, except that the exponents are remove entirely instead of just set to zero. The relative order of the remaining variables is preserved.
|
static |
Returns the number of bytes of memory necessary to contain an ideal with the given parameters. This size is padded to ensure proper alignment if ideals are placed one after the other.
This function return zero if the number of bytes cannot be represented in a size_t, or nearly cannot be represented in a size_t. The returned value is otherwise positive.
| size_t RSFIdeal::getExclusiveVarGenerator | ( | ) |
Returns the index of a generator that is the only one to be divisible by some variable. Returns getGeneratorCount() if there is no such generator.
Sets gcd to be the greatest common denominator of those generators that are divisible by div.
| void RSFIdeal::getGcdOfMultiples | ( | Word * | gcd, |
| size_t | var ) const |
Sets gcd to be the greatest common denominator of those generators that are divisible by var.
|
inline |
Returns the generator at index.
|
inline |
Returns the generator at index.
|
inline |
Returns a pointer to the memory where a generator at index would be, even if index is equal to or greater than getGeneratorCount().
|
inline |
Returns a pointer to the memory where a generator at index would be, even if index is equal to or greater than getGeneratorCount().
| void RSFIdeal::getLcm | ( | Word * | lcm | ) | const |
Puts the least common multiple of the generators of the ideal into lcm.
| void RSFIdeal::getLcmOfNonMultiples | ( | Word * | lcm, |
| size_t | var ) const |
Sets lcm to be the least common multple of those generators that var does not divide.
| size_t RSFIdeal::getMaxSupportGen | ( | ) | const |
Returns the index of a generator with maximum support. Returns 0 if there are no generators.
| size_t RSFIdeal::getMinSupportGen | ( | ) | const |
Returns the index of a generator with minimum support. Returns 0 if there are no generators.
| size_t RSFIdeal::getMultiple | ( | size_t | var | ) | const |
Returns the index of the first generator that var divides or getGeneratorCount() if no such generator exists.
| size_t RSFIdeal::getNonMultiple | ( | size_t | var | ) | const |
Returns the index of the first generator that var does not divide or getGeneratorCount() if no such generator exists.
| size_t RSFIdeal::getNotRelativelyPrime | ( | const Word * | term | ) |
Returns the index of the first generator that is not relatively prime with term. Returns getGeneratorCount() if no such generator exists.
| void RSFIdeal::getVarDividesCounts | ( | vector< size_t > & | counts | ) | const |
Sets counts[var] to the number of generators that var divides.
| bool RSFIdeal::hasFullSupport | ( | const Word * | ignore | ) | const |
Returns true if for every variable it either divides ignore or it divides some (not necessarily minimal) generator.
| size_t RSFIdeal::insert | ( | const Ideal & | ideal | ) |
Inserts the generators of ideal from index 0 onward until reaching a non-squarefree generator or all generators have been inserted. Returns the number of generators that has been inserted. There must be enough capacity for all the generators even if not all are actually inserted.
| void RSFIdeal::insert | ( | const RawSquareFreeIdeal & | ideal | ) |
Inserts all the generators of ideal.
| bool RSFIdeal::insert | ( | const std::vector< std::string > & | term | ) |
Returns false if the strings in term are not all "", "1" or "0".
| void RSFIdeal::insertNonMultiples | ( | const Word * | term, |
| const RawSquareFreeIdeal & | ideal ) |
Insert those generators of ideal that are not multiples of term.
| void RSFIdeal::insertNonMultiples | ( | size_t | var, |
| const RawSquareFreeIdeal & | ideal ) |
Insert those generators of ideal that are not multiples of var.
| bool RSFIdeal::isMinimallyGenerated | ( | ) | const |
Returns true if no generator divides another.
| bool RSFIdeal::isValid | ( | ) | const |
Returns true if the internal invariants of ideal are satisfied. Useful for debugging and tests.
|
inline |
Resets this object to be a copy of ideal.
| bool RSFIdeal::operator== | ( | const RawSquareFreeIdeal & | ideal | ) | const |
Returns true if *this equals ideal. This comparison takes non-minimal generators and the order of the generators into account.
| void RSFIdeal::print | ( | FILE * | file | ) | const |
Print a debug-suitable representation of this object to file.
| void RSFIdeal::print | ( | ostream & | out | ) | const |
Print a debug-suitable representation of this object to out.
| void RSFIdeal::removeGenerator | ( | size_t | index | ) |
Removes the generator at index.
| void RSFIdeal::setToTransposeOf | ( | const RawSquareFreeIdeal & | ideal, |
| Word * | eraseVars = 0 ) |
Resets this object to the transpose of ideal.
Let M be a matrix with variable-labeled columns and generator-labeled rows. Entry (g,v) is 1 if and only if v divides g and otherwise it is 0. There is a bijection between such matrices and generating sets of ideals. Take a generating set, construct its matric and transpose the matrix. The generating set corresponding to the transposed matrix generates the transpose ideal.
The eraseVars parameter is used as for compact(). So the variables who have a 1 at their index into eraseVars (as bits) will not be taken into the matrix that is transposed. A null value indicates to take along all variables.
| void RSFIdeal::sortLexAscending | ( | ) |
Sorts the generators in ascending lex order.
| void RSFIdeal::swap01Exponents | ( | ) |
Change 0 exponents into 1 and vice versa.
| void RSFIdeal::transpose | ( | Word * | eraseVars = 0 | ) |
Equivalent to setToTransposeOf(this, eraseVars).