HashPolynomial Class Reference

A sparse multivariate polynomial represented by a hash table mapping terms to coefficients. More...

`#include <HashPolynomial.h>`

## Public Member Functions

| HashPolynomial (size_t varCount=0)
void | clearAndSetVarCount (size_t varCount)
void | add (const mpz_class &coef, const Term &term)
| Add coef*term to the polynomial.
void | add (bool plus, const Term &term)
| Add +term or -term to the polynomial depending on whether plus is true or false, respectively.
void | feedTo (const TermTranslator &translator, CoefBigTermConsumer &consumer, bool inCanonicalOrder) const
size_t | getTermCount () const

## Private Types

typedef HashMap< Term, mpz_class > | TermMap

## Private Attributes

size_t | _varCount
TermMap | _terms

## Detailed Description

A sparse multivariate polynomial represented by a hash table mapping terms to coefficients.

This allows to avoid duplicate terms without a large overhead.

Definition at line 42 of file HashPolynomial.h.

## Member Typedef Documentation

## TermMap

typedef HashMap<Term, mpz_class> HashPolynomial::TermMap

private

Definition at line 64 of file HashPolynomial.h.

## Constructor & Destructor Documentation

## HashPolynomial()

HashPolynomial::HashPolynomial | ( | size_t | varCount = 0 | ) |

Definition at line 27 of file HashPolynomial.cpp.

## Member Function Documentation

## add() [1/2]

void HashPolynomial::add | ( | bool | plus,
|  | const Term & | term )

Add +term or -term to the polynomial depending on whether plus is true or false, respectively.

Definition at line 53 of file HashPolynomial.cpp.

## add() [2/2]

void HashPolynomial::add | ( | const mpz_class & | coef,
|  | const Term & | term )

Add coef*term to the polynomial.

Definition at line 36 of file HashPolynomial.cpp.

## clearAndSetVarCount()

void HashPolynomial::clearAndSetVarCount | ( | size_t | varCount | ) |

Definition at line 31 of file HashPolynomial.cpp.

## feedTo()

void HashPolynomial::feedTo | ( | const TermTranslator & | translator,
|  | CoefBigTermConsumer & | consumer,
|  | bool | inCanonicalOrder ) const

Definition at line 76 of file HashPolynomial.cpp.

## getTermCount()

size_t HashPolynomial::getTermCount | ( |  | ) | const

Definition at line 117 of file HashPolynomial.cpp.

## Member Data Documentation

## _terms

TermMap HashPolynomial::_terms

private

Definition at line 65 of file HashPolynomial.h.

## _varCount

size_t HashPolynomial::_varCount

private

Definition at line 62 of file HashPolynomial.h.

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

- src/HashPolynomial.h
- src/HashPolynomial.cpp