Next: Integer lists
Up: Input Syntax
Previous: Integer Expressions
The syntax for polynomial expressions is similar to integer expressions.
The legal operators for polynomials, in order of increasing precedence, are
given in the following table.
- +, -
- *, / (polynomial division), & (polynomial remainder)
- +, - unary operators
-
^, ** (both are exponentiation operators)
The polynomial division and remainder are done using the defined monomial
order in the base ring. Parentheses are used to enforce groupings in an
expression.
The following remarks describe certain aspects of polynomial expressions.
- Polynomials in Macaulay are output in an abbreviated notation:
each polynomial is displayed as a number of monomials separated by
``+'' or ``-''. Each monomial is preceeded by its coefficient and
each indeterminate is followed by its degree with no intervening
blanks. Rational number coefficients are represented by x/y. A
polynomial which extends over a line boundary is displayed by using
as the continuation character. If you wish to have polynomials
output in Mathematica format, use the prmat command. - User defined matrix variables can appear in polynomial expressions.
The variable must be enclosed in curly braces so that Macaulay won't
think that it is a sequence of ring indeterminates. ``{M}''
refers to the (1,1) entry of the matrix M.
- A
at the end of a line, preceded by a space, is the line
continuation character. Macaulay computes the polynomial on each
continued line, and then adds them all together. Thus, each line must
be a well-defined polynomial. - Certain abbreviations are allowed, mainly in order to allow easier
entry of polynomials, and to allow the output polynomials of
Macaulay to be legal input. One can suppress the
``*'' between a number or a ring indeterminate and another ring
indeterminate, the ``
^'' between a ring indeterminate and its
exponent, and the ``*'' before a left parenthesis, or after a right
parenthesis.
For example,
% poly f (x[1]+x[2])^2
% type f
; x[1]2+2x[1]x[2]+x[2]2
% int i 1
% poly g (x[i]-x[i+1])^2*{f}
% type g
; x[1]4-2x[1]2x[2]2+x[2]4
% poly h ab2+c2d+a(b+c)(b-c)
% type h
; 2ab2-ac2+c2d
Next: Integer lists
Up: Input Syntax
Previous: Integer Expressions
Sorin Popescu
Fri Feb 14 17:37:19 EST 1997