or
where is the string representing the first or leading variable
of the polynomial; are the degrees of the coefficients
in ordered such that .
The coefficients corresponding to each degree (which is a polynomial
itself) are placed to the right of that degree; (k) represents
a polynomial which is terminal, i.e. has its entry a number,
which can be either an integer or a floating point number.
For example the polynomial
the text representation would be :
The following routines allow reading in polynomials in various forms, as well as printing them in various forms.
read_poly works recursively by processing the text file and based on the three type arguments reads in the text polynomial (ignoring white space) and creates a Polynomial object of the appropriate type with the appropriate coefficients. If the leading variable of the current polynomial is an Slp variable (i.e. a variable declared to be a Slp variable by insertion in the Slp variable list), it will read the rest of the current (coefficient) polynomial as an Slp . Otherwise it will read it as a polynomial. Example : Let x1, x2 be Polynomial variables and s1 an Slp variable. Then
will be read as a polynomial in x1 with its leading coefficient (of degree 2) an Slp , its next coefficient (degree 1) a polynomial in x2 and its last coefficient (degree 0) a polynomial in x2 which in turn has its leading coefficient an Slp .