Frobby
0.9.5
|
Functions | |
Word * | newTermParse (const char *str) |
Allocates and returns a term based on str. More... | |
void | print (FILE *file, const Word *term, size_t varCount) |
void | print (ostream &out, const Word *term, size_t varCount) |
bool | isIdentity (const Word *a, Word *aEnd) |
bool | isIdentity (const Word *a, size_t varCount) |
size_t | getSizeOfSupport (const Word *a, size_t varCount) |
size_t | getWordCount (size_t varCount) |
void | compact (Word *compacted, const Word *term, const Word *remove, size_t varCount) |
For every variable var that divides remove, remove the space for that variable in term and put the result in compacted. More... | |
void | setToIdentity (Word *res, const Word *resEnd) |
void | setToIdentity (Word *res, size_t varCount) |
void | setToAllVarProd (Word *res, size_t varCount) |
Sets all exponents of res to 1. More... | |
Word * | newTerm (size_t varCount) |
Returns identity term of varCount variables. More... | |
void | deleteTerm (Word *term) |
Deletes term previously returned by newTerm(). More... | |
bool | lexLess (const Word *a, const Word *b, size_t varCount) |
void | colon (Word *res, const Word *resEnd, const Word *a, const Word *b) |
void | colonInPlace (Word *res, const Word *resEnd, const Word *b) |
void | assign (Word *a, const Word *b, size_t varCount) |
bool | encodeTerm (Word *encoded, const Exponent *term, const size_t varCount) |
Assigns the RawSquareFreeTerm-encoded form of term to encoded and returns true if term is square free. More... | |
bool | encodeTerm (Word *encoded, const std::vector< mpz_class > &term, const size_t varCount) |
bool | encodeTerm (Word *encoded, const std::vector< std::string > &term, const size_t varCount) |
void | lcm (Word *res, const Word *resEnd, const Word *a, const Word *b) |
void | lcm (Word *res, const Word *a, const Word *b, size_t varCount) |
void | lcmInPlace (Word *res, const Word *resEnd, const Word *a) |
void | lcmInPlace (Word *res, const Word *a, size_t varCount) |
void | gcd (Word *res, const Word *resEnd, const Word *a, const Word *b) |
void | gcd (Word *res, const Word *a, const Word *b, size_t varCount) |
void | gcdInPlace (Word *res, const Word *resEnd, const Word *a) |
void | gcdInPlace (Word *res, const Word *a, size_t varCount) |
bool | isRelativelyPrime (const Word *a, const Word *b, size_t varCount) |
void | invert (Word *a, size_t varCount) |
Make 0 exponents 1 and make 1 exponents 0. More... | |
size_t | getVarIfPure (const Word *const a, size_t varCount) |
Returns var if a equals var. More... | |
void | decrementAtSupport (const Word *a, size_t *inc, size_t varCount) |
For every variable var that divides a, decrement inc[var] by one. More... | |
void | toZeroAtSupport (const Word *a, size_t *inc, size_t varCount) |
For every variable var that divides a, set inc[var] to zero. More... | |
bool | equals (const Word *a, const Word *b, size_t varCount) |
Returns true if a equals b. More... | |
bool | isValid (const Word *a, size_t varCount) |
The unused bits at the end of the last word must be zero for the functions here to work correctly. More... | |
void | swap (Word *a, Word *b, size_t varCount) |
bool | divides (const Word *a, const Word *aEnd, const Word *b) |
Returns true if a divides b. More... | |
void | assign (Word *a, const Word *aEnd, const Word *b) |
size_t | getBitOffset (size_t var) |
size_t | getWordOffset (size_t var) |
bool | hasFullSupport (const Word *a, size_t varCount) |
bool | isRelativelyPrime (const Word *a, const Word *aEnd, const Word *b) |
void | setExponent (Word *a, size_t var, bool value) |
bool | getExponent (const Word *a, size_t var) |
returns true if var divides a and false otherwise. More... | |
void | swap (Word *a, Word *aEnd, Word *b) |
Definition at line 165 of file RawSquareFreeTerm.h.
Definition at line 186 of file RawSquareFreeTerm.cpp.
Definition at line 176 of file RawSquareFreeTerm.cpp.
Definition at line 181 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::compact | ( | Word * | compacted, |
const Word * | term, | ||
const Word * | remove, | ||
size_t | varCount | ||
) |
For every variable var that divides remove, remove the space for that variable in term and put the result in compacted.
So the operation performed is a colon, except that the bits are removed instead of just set to zero. The remaining bits are moved into the gaps so that compacted may take up less space than term does. The relative order of the remaining variables is preserved. The result is placed in res.
It is allowed for compacted to equal term. Otherwise its memory must be disjoint from that of term. The memory for remove must always be disjoint from that of term.
Definition at line 100 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::decrementAtSupport | ( | const Word * | a, |
size_t * | inc, | ||
size_t | varCount | ||
) |
For every variable var that divides a, decrement inc[var] by one.
Definition at line 356 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::deleteTerm | ( | Word * | term | ) |
Deletes term previously returned by newTerm().
Term can be null.
Definition at line 154 of file RawSquareFreeTerm.cpp.
Returns true if a divides b.
Definition at line 144 of file RawSquareFreeTerm.h.
Assigns the RawSquareFreeTerm-encoded form of term to encoded and returns true if term is square free.
Otherwise returns false.
Definition at line 193 of file RawSquareFreeTerm.cpp.
bool SquareFreeTermOps::encodeTerm | ( | Word * | encoded, |
const std::vector< mpz_class > & | term, | ||
const size_t | varCount | ||
) |
Definition at line 211 of file RawSquareFreeTerm.cpp.
bool SquareFreeTermOps::encodeTerm | ( | Word * | encoded, |
const std::vector< std::string > & | term, | ||
const size_t | varCount | ||
) |
Definition at line 229 of file RawSquareFreeTerm.cpp.
Returns true if a equals b.
Definition at line 397 of file RawSquareFreeTerm.cpp.
Definition at line 281 of file RawSquareFreeTerm.cpp.
Definition at line 276 of file RawSquareFreeTerm.cpp.
Definition at line 293 of file RawSquareFreeTerm.cpp.
Definition at line 288 of file RawSquareFreeTerm.cpp.
|
inline |
Definition at line 157 of file RawSquareFreeTerm.h.
|
inline |
returns true if var divides a and false otherwise.
Definition at line 151 of file RawSquareFreeTerm.h.
size_t SquareFreeTermOps::getSizeOfSupport | ( | const Word * | a, |
size_t | varCount | ||
) |
Definition at line 71 of file RawSquareFreeTerm.cpp.
size_t SquareFreeTermOps::getVarIfPure | ( | const Word *const | a, |
size_t | varCount | ||
) |
Returns var if a equals var.
If a is the identity or the product of more than one variable then returns varCount.
Definition at line 322 of file RawSquareFreeTerm.cpp.
size_t SquareFreeTermOps::getWordCount | ( | size_t | varCount | ) |
Definition at line 91 of file RawSquareFreeTerm.cpp.
|
inline |
Definition at line 161 of file RawSquareFreeTerm.h.
|
inline |
Definition at line 183 of file RawSquareFreeTerm.h.
void SquareFreeTermOps::invert | ( | Word * | a, |
size_t | varCount | ||
) |
Make 0 exponents 1 and make 1 exponents 0.
Definition at line 311 of file RawSquareFreeTerm.cpp.
bool SquareFreeTermOps::isIdentity | ( | const Word * | a, |
size_t | varCount | ||
) |
Definition at line 58 of file RawSquareFreeTerm.cpp.
Definition at line 51 of file RawSquareFreeTerm.cpp.
|
inline |
Definition at line 195 of file RawSquareFreeTerm.h.
Definition at line 300 of file RawSquareFreeTerm.cpp.
bool SquareFreeTermOps::isValid | ( | const Word * | a, |
size_t | varCount | ||
) |
The unused bits at the end of the last word must be zero for the functions here to work correctly.
They should all maintain this invariant. This function is useful in tests to ensure that that is true.
Definition at line 415 of file RawSquareFreeTerm.cpp.
Definition at line 257 of file RawSquareFreeTerm.cpp.
Definition at line 251 of file RawSquareFreeTerm.cpp.
Definition at line 269 of file RawSquareFreeTerm.cpp.
Definition at line 264 of file RawSquareFreeTerm.cpp.
Definition at line 158 of file RawSquareFreeTerm.cpp.
Word * SquareFreeTermOps::newTerm | ( | size_t | varCount | ) |
Returns identity term of varCount variables.
Must deallocate with deleteTerm().
Definition at line 139 of file RawSquareFreeTerm.cpp.
Word * SquareFreeTermOps::newTermParse | ( | const char * | str | ) |
Allocates and returns a term based on str.
The returned term must be deallocated using deleteTerm. str is parsed as a list of exponent vector entries that must be '0' or '1'. The string can contain no other characters. The parsing is inefficient and is intended for constructing terms in testing.
Definition at line 25 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::print | ( | FILE * | file, |
const Word * | term, | ||
size_t | varCount | ||
) |
Definition at line 35 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::print | ( | ostream & | out, |
const Word * | term, | ||
size_t | varCount | ||
) |
Definition at line 41 of file RawSquareFreeTerm.cpp.
|
inline |
Definition at line 170 of file RawSquareFreeTerm.h.
void SquareFreeTermOps::setToAllVarProd | ( | Word * | res, |
size_t | varCount | ||
) |
Sets all exponents of res to 1.
Definition at line 128 of file RawSquareFreeTerm.cpp.
Definition at line 115 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::setToIdentity | ( | Word * | res, |
size_t | varCount | ||
) |
Definition at line 120 of file RawSquareFreeTerm.cpp.
Definition at line 178 of file RawSquareFreeTerm.h.
Definition at line 425 of file RawSquareFreeTerm.cpp.
void SquareFreeTermOps::toZeroAtSupport | ( | const Word * | a, |
size_t * | inc, | ||
size_t | varCount | ||
) |
For every variable var that divides a, set inc[var] to zero.
Definition at line 376 of file RawSquareFreeTerm.cpp.