Frobby 0.10.0
Loading...
Searching...
No Matches
RawSquareFreeIdeal Class Reference

#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)

Detailed Description

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.

Member Function Documentation

◆ colonReminimize() [1/2]

void RSFIdeal::colonReminimize ( const Word * colon)

Performs a colon and minimize. Object must be already minimized.

◆ colonReminimize() [2/2]

void RSFIdeal::colonReminimize ( size_t var)

Performs a colon by var and minimize. Object must be already minimized.

◆ compact()

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.

◆ getBytesOfMemoryFor()

size_t RSFIdeal::getBytesOfMemoryFor ( size_t varCount,
size_t generatorCount )
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.

◆ getExclusiveVarGenerator()

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.

◆ getGcdOfMultiples() [1/2]

void RSFIdeal::getGcdOfMultiples ( Word * gcd,
const Word * div ) const

Sets gcd to be the greatest common denominator of those generators that are divisible by div.

◆ getGcdOfMultiples() [2/2]

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.

◆ getGenerator() [1/2]

Word * RawSquareFreeIdeal::getGenerator ( size_t index)
inline

Returns the generator at index.

◆ getGenerator() [2/2]

const Word * RawSquareFreeIdeal::getGenerator ( size_t index) const
inline

Returns the generator at index.

◆ getGeneratorUnsafe() [1/2]

Word * RawSquareFreeIdeal::getGeneratorUnsafe ( size_t 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().

◆ getGeneratorUnsafe() [2/2]

const Word * RawSquareFreeIdeal::getGeneratorUnsafe ( size_t index) const
inline

Returns a pointer to the memory where a generator at index would be, even if index is equal to or greater than getGeneratorCount().

◆ getLcm()

void RSFIdeal::getLcm ( Word * lcm) const

Puts the least common multiple of the generators of the ideal into lcm.

◆ getLcmOfNonMultiples()

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.

◆ getMaxSupportGen()

size_t RSFIdeal::getMaxSupportGen ( ) const

Returns the index of a generator with maximum support. Returns 0 if there are no generators.

◆ getMinSupportGen()

size_t RSFIdeal::getMinSupportGen ( ) const

Returns the index of a generator with minimum support. Returns 0 if there are no generators.

◆ getMultiple()

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.

◆ getNonMultiple()

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.

◆ getNotRelativelyPrime()

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.

◆ getVarDividesCounts()

void RSFIdeal::getVarDividesCounts ( vector< size_t > & counts) const

Sets counts[var] to the number of generators that var divides.

◆ hasFullSupport()

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.

◆ insert() [1/3]

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.

◆ insert() [2/3]

void RSFIdeal::insert ( const RawSquareFreeIdeal & ideal)

Inserts all the generators of ideal.

◆ insert() [3/3]

bool RSFIdeal::insert ( const std::vector< std::string > & term)

Returns false if the strings in term are not all "", "1" or "0".

◆ insertNonMultiples() [1/2]

void RSFIdeal::insertNonMultiples ( const Word * term,
const RawSquareFreeIdeal & ideal )

Insert those generators of ideal that are not multiples of term.

◆ insertNonMultiples() [2/2]

void RSFIdeal::insertNonMultiples ( size_t var,
const RawSquareFreeIdeal & ideal )

Insert those generators of ideal that are not multiples of var.

◆ isMinimallyGenerated()

bool RSFIdeal::isMinimallyGenerated ( ) const

Returns true if no generator divides another.

◆ isValid()

bool RSFIdeal::isValid ( ) const

Returns true if the internal invariants of ideal are satisfied. Useful for debugging and tests.

◆ operator=()

RawSquareFreeIdeal & RawSquareFreeIdeal::operator= ( const RawSquareFreeIdeal & ideal)
inline

Resets this object to be a copy of ideal.

◆ operator==()

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.

◆ print() [1/2]

void RSFIdeal::print ( FILE * file) const

Print a debug-suitable representation of this object to file.

◆ print() [2/2]

void RSFIdeal::print ( ostream & out) const

Print a debug-suitable representation of this object to out.

◆ removeGenerator()

void RSFIdeal::removeGenerator ( size_t index)

Removes the generator at index.

◆ setToTransposeOf()

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.

◆ sortLexAscending()

void RSFIdeal::sortLexAscending ( )

Sorts the generators in ascending lex order.

◆ swap01Exponents()

void RSFIdeal::swap01Exponents ( )

Change 0 exponents into 1 and vice versa.

◆ transpose()

void RSFIdeal::transpose ( Word * eraseVars = 0)

Equivalent to setToTransposeOf(this, eraseVars).


The documentation for this class was generated from the following files: