Frobby 0.9.5
|
Term represents a product of variables which does not include a coefficient. More...
#include <Term.h>
Static Public Member Functions | |
static bool | divides (const Exponent *a, const Exponent *b, size_t varCount) |
Returns whether a divides b. | |
static bool | dominates (const Exponent *a, const Exponent *b, size_t varCount) |
Returns whether a dominates b, i.e. whether b divides a. | |
static bool | strictlyDivides (const Exponent *a, const Exponent *b, size_t varCount) |
Returns whether a strictly divides b. | |
static void | lcm (Exponent *res, const Exponent *a, const Exponent *b, size_t varCount) |
Sets res equal to the least commom multiple of a and b. | |
static void | gcd (Exponent *res, const Exponent *a, const Exponent *b, size_t varCount) |
Sets res equal to the greatest common divisor of a and b. | |
static void | product (Exponent *res, const Exponent *a, const Exponent *b, size_t varCount) |
Sets res equal to the product of a and b. | |
static void | setToIdentity (Exponent *res, size_t varCount) |
Set res equal to ![]() | |
static bool | isIdentity (const Exponent *a, size_t varCount) |
Returns whether a is 1, i.e. whether all entries of a are 0. | |
static bool | isSquareFree (const Exponent *a, size_t varCount) |
Returns whether a is square free, i.e. ![]() ![]() ![]() | |
static size_t | getFirstNonZeroExponent (const Exponent *a, size_t varCount) |
Returns least var such that a[var] is non-zero. | |
static size_t | getMiddleNonZeroExponent (const Exponent *a, size_t varCount) |
Returns a median element of the set of var's such that a[var] is non-zero. | |
static size_t | getFirstMaxExponent (const Exponent *a, size_t varCount) |
Returns a var such that a[var] >= a[i] for all i. | |
static size_t | getSizeOfSupport (const Exponent *a, size_t varCount) |
Returns the number of variables ![]() ![]() ![]() | |
static bool | sharesNonZeroExponent (const Exponent *a, const Exponent *b, size_t varCount) |
Returns whether there is some ![]() ![]() | |
static size_t | getHashCode (const Exponent *a, size_t varCount) |
static bool | hasSameSupport (const Exponent *a, const Exponent *b, size_t varCount) |
Returns whether ![]() ![]() | |
static void | colon (Exponent *res, const Exponent *a, const Exponent *b, size_t varCount) |
Sets res equal to ![]() | |
static void | encodedDual (Exponent *res, const Exponent *dualOf, const Exponent *point, size_t varCount) |
The parameter dualOf is interpreted to encode an irreducible ideal, and the dual of that reflected in point is a principal ideal. | |
static void | decrement (Exponent *a, size_t varCount) |
Decrements each positive entry of a by one. | |
static void | print (FILE *file, const Exponent *e, size_t varCount) |
Writes e to file in a format suitable for debug output. | |
static void | print (ostream &out, const Exponent *e, size_t varCount) |
Writes e to out in a format suitable for debug output. | |
Private Member Functions | |
void | initialize (const Exponent *exponents, size_t varCount) |
Static Private Member Functions | |
static Exponent * | allocate (size_t size) |
static void | deallocate (Exponent *p, size_t size) |
Private Attributes | |
Exponent * | _exponents |
size_t | _varCount |
Term represents a product of variables which does not include a coefficient.
This concept is also sometimes called a monomial or power product.
A term is represented as an array of Exponent and an integer indicating the length of the array, i.e. the number of variables. It is sometimes desirable to separate the length from the array, e.g. when representing an array of terms all of the same length, such as in representing the generators of a monomial ideal, in which case representing the length once for each generator would be wasteful. Thus Term has static versions of most methods where the number of variables is a separate parameter. In these cases it is allowed for the exponent array pointer to be null (i.e. equal to 0) if the length is zero.
Most methods on Term are inline to avoid function call overhead. This is significant because these methods tend to be called in the innermost loops of monomial ideal algorithms.
|
inline |