UniHashPolynomial Class Reference

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

`#include <UniHashPolynomial.h>`

## Public Member Functions

void | add (bool plus, const mpz_class &exponent)
| Add +t^exponent or -t^exponent to the polynomial depending on whether plus is true or false, respectively.
void | add (int coef, size_t exponent)
| Add coef*t^exponent to the polynomial.
void | add (const mpz_class &coef, const mpz_class &exponent)
| Add coef*t^exponent to the polynomial.
void | feedTo (CoefBigTermConsumer &consumer, bool inCanonicalOrder=false) const
size_t | getTermCount () const

## Private Types

typedef HashMap< mpz_class, mpz_class > | TermMap

## Private Attributes

TermMap | _terms

## Detailed Description

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

This allows to avoid duplicate terms without a large overhead.

Definition at line 41 of file UniHashPolynomial.h.

## Member Typedef Documentation

## TermMap

typedef HashMap<mpz_class, mpz_class> UniHashPolynomial::TermMap

private

Definition at line 58 of file UniHashPolynomial.h.

## Member Function Documentation

## add() [1/3]

void UniHashPolynomial::add | ( | bool | plus,
|  | const mpz_class & | exponent )

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

Definition at line 25 of file UniHashPolynomial.cpp.

## add() [2/3]

void UniHashPolynomial::add | ( | const mpz_class & | coef,
|  | const mpz_class & | exponent )

Add coef*t^exponent to the polynomial.

Definition at line 44 of file UniHashPolynomial.cpp.

## add() [3/3]

void UniHashPolynomial::add | ( | int | coef,
|  | size_t | exponent )

Add coef*t^exponent to the polynomial.

Definition at line 35 of file UniHashPolynomial.cpp.

## feedTo()

void UniHashPolynomial::feedTo | ( | CoefBigTermConsumer & | consumer,
|  | bool | inCanonicalOrder = false ) const

Definition at line 64 of file UniHashPolynomial.cpp.

## getTermCount()

size_t UniHashPolynomial::getTermCount | ( |  | ) | const

Definition at line 110 of file UniHashPolynomial.cpp.

## Member Data Documentation

## _terms

TermMap UniHashPolynomial::_terms

private

Definition at line 59 of file UniHashPolynomial.h.

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

- src/UniHashPolynomial.h
- src/UniHashPolynomial.cpp