Frobby  0.9.5
Functions
SquareFreeTermOps Namespace Reference

Functions

WordnewTermParse (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...
 
WordnewTerm (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)
 

Function Documentation

◆ assign() [1/2]

void SquareFreeTermOps::assign ( Word a,
const Word aEnd,
const Word b 
)
inline

Definition at line 165 of file RawSquareFreeTerm.h.

◆ assign() [2/2]

void SquareFreeTermOps::assign ( Word a,
const Word b,
size_t  varCount 
)

Definition at line 186 of file RawSquareFreeTerm.cpp.

◆ colon()

void SquareFreeTermOps::colon ( Word res,
const Word resEnd,
const Word a,
const Word b 
)

Definition at line 176 of file RawSquareFreeTerm.cpp.

◆ colonInPlace()

void SquareFreeTermOps::colonInPlace ( Word res,
const Word resEnd,
const Word b 
)

Definition at line 181 of file RawSquareFreeTerm.cpp.

◆ compact()

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.

◆ decrementAtSupport()

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.

◆ deleteTerm()

void SquareFreeTermOps::deleteTerm ( Word term)

Deletes term previously returned by newTerm().

Term can be null.

Definition at line 154 of file RawSquareFreeTerm.cpp.

◆ divides()

bool SquareFreeTermOps::divides ( const Word a,
const Word aEnd,
const Word b 
)
inline

Returns true if a divides b.

Definition at line 144 of file RawSquareFreeTerm.h.

◆ encodeTerm() [1/3]

bool SquareFreeTermOps::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.

Otherwise returns false.

Definition at line 193 of file RawSquareFreeTerm.cpp.

◆ encodeTerm() [2/3]

bool SquareFreeTermOps::encodeTerm ( Word encoded,
const std::vector< mpz_class > &  term,
const size_t  varCount 
)

Definition at line 211 of file RawSquareFreeTerm.cpp.

◆ encodeTerm() [3/3]

bool SquareFreeTermOps::encodeTerm ( Word encoded,
const std::vector< std::string > &  term,
const size_t  varCount 
)

Definition at line 229 of file RawSquareFreeTerm.cpp.

◆ equals()

bool SquareFreeTermOps::equals ( const Word a,
const Word b,
size_t  varCount 
)

Returns true if a equals b.

Definition at line 397 of file RawSquareFreeTerm.cpp.

◆ gcd() [1/2]

void SquareFreeTermOps::gcd ( Word res,
const Word a,
const Word b,
size_t  varCount 
)

Definition at line 281 of file RawSquareFreeTerm.cpp.

◆ gcd() [2/2]

void SquareFreeTermOps::gcd ( Word res,
const Word resEnd,
const Word a,
const Word b 
)

Definition at line 276 of file RawSquareFreeTerm.cpp.

◆ gcdInPlace() [1/2]

void SquareFreeTermOps::gcdInPlace ( Word res,
const Word a,
size_t  varCount 
)

Definition at line 293 of file RawSquareFreeTerm.cpp.

◆ gcdInPlace() [2/2]

void SquareFreeTermOps::gcdInPlace ( Word res,
const Word resEnd,
const Word a 
)

Definition at line 288 of file RawSquareFreeTerm.cpp.

◆ getBitOffset()

size_t SquareFreeTermOps::getBitOffset ( size_t  var)
inline

Definition at line 157 of file RawSquareFreeTerm.h.

◆ getExponent()

bool SquareFreeTermOps::getExponent ( const Word a,
size_t  var 
)
inline

returns true if var divides a and false otherwise.

Definition at line 151 of file RawSquareFreeTerm.h.

◆ getSizeOfSupport()

size_t SquareFreeTermOps::getSizeOfSupport ( const Word a,
size_t  varCount 
)

Definition at line 71 of file RawSquareFreeTerm.cpp.

◆ getVarIfPure()

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.

◆ getWordCount()

size_t SquareFreeTermOps::getWordCount ( size_t  varCount)

Definition at line 91 of file RawSquareFreeTerm.cpp.

◆ getWordOffset()

size_t SquareFreeTermOps::getWordOffset ( size_t  var)
inline

Definition at line 161 of file RawSquareFreeTerm.h.

◆ hasFullSupport()

bool SquareFreeTermOps::hasFullSupport ( const Word a,
size_t  varCount 
)
inline

Definition at line 183 of file RawSquareFreeTerm.h.

◆ invert()

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.

◆ isIdentity() [1/2]

bool SquareFreeTermOps::isIdentity ( const Word a,
size_t  varCount 
)

Definition at line 58 of file RawSquareFreeTerm.cpp.

◆ isIdentity() [2/2]

bool SquareFreeTermOps::isIdentity ( const Word a,
Word aEnd 
)

Definition at line 51 of file RawSquareFreeTerm.cpp.

◆ isRelativelyPrime() [1/2]

bool SquareFreeTermOps::isRelativelyPrime ( const Word a,
const Word aEnd,
const Word b 
)
inline

Definition at line 195 of file RawSquareFreeTerm.h.

◆ isRelativelyPrime() [2/2]

bool SquareFreeTermOps::isRelativelyPrime ( const Word a,
const Word b,
size_t  varCount 
)

Definition at line 300 of file RawSquareFreeTerm.cpp.

◆ isValid()

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.

◆ lcm() [1/2]

void SquareFreeTermOps::lcm ( Word res,
const Word a,
const Word b,
size_t  varCount 
)

Definition at line 257 of file RawSquareFreeTerm.cpp.

◆ lcm() [2/2]

void SquareFreeTermOps::lcm ( Word res,
const Word resEnd,
const Word a,
const Word b 
)

Definition at line 251 of file RawSquareFreeTerm.cpp.

◆ lcmInPlace() [1/2]

void SquareFreeTermOps::lcmInPlace ( Word res,
const Word a,
size_t  varCount 
)

Definition at line 269 of file RawSquareFreeTerm.cpp.

◆ lcmInPlace() [2/2]

void SquareFreeTermOps::lcmInPlace ( Word res,
const Word resEnd,
const Word a 
)

Definition at line 264 of file RawSquareFreeTerm.cpp.

◆ lexLess()

bool SquareFreeTermOps::lexLess ( const Word a,
const Word b,
size_t  varCount 
)

Definition at line 158 of file RawSquareFreeTerm.cpp.

◆ newTerm()

Word * SquareFreeTermOps::newTerm ( size_t  varCount)

Returns identity term of varCount variables.

Must deallocate with deleteTerm().

Definition at line 139 of file RawSquareFreeTerm.cpp.

◆ newTermParse()

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.

◆ print() [1/2]

void SquareFreeTermOps::print ( FILE *  file,
const Word term,
size_t  varCount 
)

Definition at line 35 of file RawSquareFreeTerm.cpp.

◆ print() [2/2]

void SquareFreeTermOps::print ( ostream &  out,
const Word term,
size_t  varCount 
)

Definition at line 41 of file RawSquareFreeTerm.cpp.

◆ setExponent()

void SquareFreeTermOps::setExponent ( Word a,
size_t  var,
bool  value 
)
inline

Definition at line 170 of file RawSquareFreeTerm.h.

◆ setToAllVarProd()

void SquareFreeTermOps::setToAllVarProd ( Word res,
size_t  varCount 
)

Sets all exponents of res to 1.

Definition at line 128 of file RawSquareFreeTerm.cpp.

◆ setToIdentity() [1/2]

void SquareFreeTermOps::setToIdentity ( Word res,
const Word resEnd 
)

Definition at line 115 of file RawSquareFreeTerm.cpp.

◆ setToIdentity() [2/2]

void SquareFreeTermOps::setToIdentity ( Word res,
size_t  varCount 
)

Definition at line 120 of file RawSquareFreeTerm.cpp.

◆ swap() [1/2]

void SquareFreeTermOps::swap ( Word a,
Word aEnd,
Word b 
)
inline

Definition at line 178 of file RawSquareFreeTerm.h.

◆ swap() [2/2]

void SquareFreeTermOps::swap ( Word a,
Word b,
size_t  varCount 
)

Definition at line 425 of file RawSquareFreeTerm.cpp.

◆ toZeroAtSupport()

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.