Frobby  0.9.5
Functions
TermExtra.cpp File Reference
#include "stdinc.h"
#include "TermExtra.h"
#include <algorithm>
#include <vector>

Go to the source code of this file.

Functions

Exponent median (const Exponent *a, size_t varCount)
 Returns the lower median exponent of a. More...
 
Exponent medianPositive (const Exponent *a, size_t varCount)
 Returns the lower median of the positive exponents of a. More...
 
void totalDegree (mpz_class &res, const Exponent *a, size_t varCount)
 Puts the sum of the entries of a into res. More...
 
Exponent minimumPositive (const Exponent *a, size_t varCount)
 Returns the smallest positive exponent of a. More...
 
Exponent maximum (const Exponent *a, size_t varCount)
 Returns the largest exponent of a. More...
 

Function Documentation

◆ maximum()

Exponent maximum ( const Exponent a,
size_t  varCount 
)

Returns the largest exponent of a.

Returns zero if varCount is zero.

Definition at line 68 of file TermExtra.cpp.

◆ median()

Exponent median ( const Exponent a,
size_t  varCount 
)

Returns the lower median exponent of a.

Returns zero if varCount is zero.

Definition at line 25 of file TermExtra.cpp.

◆ medianPositive()

Exponent medianPositive ( const Exponent a,
size_t  varCount 
)

Returns the lower median of the positive exponents of a.

Returns zero if all terms of a are zero.

Definition at line 35 of file TermExtra.cpp.

◆ minimumPositive()

Exponent minimumPositive ( const Exponent a,
size_t  varCount 
)

Returns the smallest positive exponent of a.

Returns zero if all entries of a are zero.

Definition at line 55 of file TermExtra.cpp.

◆ totalDegree()

void totalDegree ( mpz_class &  res,
const Exponent a,
size_t  varCount 
)

Puts the sum of the entries of a into res.

res has to be an mpz_class as opposed to an Exponent since the sum could cause an overflow.

Definition at line 49 of file TermExtra.cpp.