62.17 The Representations of Rational Functions

GAP uses three representations of rational functions: Rational functions given by numerator and denominator, polynomials and Laurent polynomials (given by coefficient list and valuation).

These representations do not necessarily reflect mathematical properties: While an object in the laurent polynomials reprepresentation must be a laurent polynomial it might turn out that a rational function given by numerator and denominator is actually a laurent polynomial and the property tests in section Properties and Attributes of Rational Functions will find this out.

Each representation is associated one or several ``defining attributes'' that give an ``external'' representation (see The Defining Attributes of Rational Functions) of the representation in the form of lists and are the defining information that tells a rational function what it is.

GAP also implements methods to compute these attributes for rational functions in other representations, provided it would be possible to express an mathematically equal rational function in the representation associated with the attribute. (That is one can always get a numerator/denominator representation of a polynomial while an arbitrary function of course can compute a polynomial representation only if it is a polynomial.)

Therefore these attributes can be thought of as ``conceptual'' representations that allow us -- as far as possible -- to consider an object as a rational function, a polynomial or a laurent polynomial, regardless of the way it is represented in the computer.

Functions thus usually do not need to care about the representation of a rational function. Depending on its (known in the context or determined) properties, they can access the attribute representing the rational function in the desired way.

Consequentially, methods for rational functions are installed for properties and not for representations.

When creating new rational functions however they must be created in one of the three representations. In most cases this will be the representation for which the ``conceptual'' representation in which the calculation was done is the defining attribute.

Iterated operations (like forming the product over a list) therefore will tend to stay in the most suitable representation and the calculation of another conceptual representation (which may be comparatively expensive in certain circumstances) is not necessary.

[Top] [Previous] [Up] [Next] [Index]

GAP 4 manual
February 2000