aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/MPOLY.ht
blob: 1619aae48f179d13eeac184768f1bcf4ac47556a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\MultivariatePolynomialXmpTitle}{MultivariatePolynomial}
\newcommand{\MultivariatePolynomialXmpNumber}{9.54}
%
% =====================================================================
\begin{page}{MultivariatePolynomialXmpPage}{9.54 MultivariatePolynomial}
% =====================================================================
\beginscroll

The domain constructor \spadtype{MultivariatePolynomial} is similar to
\spadtype{Polynomial} except that it specifies the variables to be used.
%-% \HDindex{polynomial!multiple variables} Most functions available for{MultivariatePolynomialXmpPage}{9.54}{MultivariatePolynomial}
\spadtype{Polynomial} are available for \spadtype{MultivariatePolynomial}.
The abbreviation for \spadtype{MultivariatePolynomial} is
\spadtype{MPOLY}.
The type expressions
\centerline{{\spadtype{MultivariatePolynomial([x,y],Integer)}}}
and
\centerline{{\spadtype{MPOLY([x,y],INT)}}}
refer to the domain of multivariate polynomials in the variables
\spad{x} and \spad{y} where the coefficients are restricted to be integers.
The first
variable specified is the main variable and the display of the
polynomial reflects this.
\xtc{
This polynomial appears with
terms in descending powers of the variable \spad{x}.
}{
\spadpaste{m : MPOLY([x,y],INT) := (x**2 - x*y**3 +3*y)**2 \bound{m}}
}
\xtc{
It is easy to see a different variable ordering by doing a conversion.
}{
\spadpaste{m :: MPOLY([y,x],INT) \free{m}}
}
\xtc{
You can use other, unspecified variables, by using
\spadtype{Polynomial} in the coefficient type of \spadtype{MPOLY}.
}{
\spadpaste{p : MPOLY([x,y],POLY INT) \bound{pdec}}
}
\xtc{
}{
\spadpaste{p := (a**2*x - b*y**2 + 1)**2 \free{pdec}\bound{p}}
}
\xtc{
Conversions can be used to re-express such polynomials in terms of
the other variables.  For example, you can first push all the
variables into a polynomial with integer coefficients.
}{
\spadpaste{p :: POLY INT \free{p}\bound{prev}}
}
\xtc{
Now pull out the variables of interest.
}{
\spadpaste{\% :: MPOLY([a,b],POLY INT) \free{prev}}
}

\beginImportant
\noindent {\bf Restriction:}
\texht{\begin{quotation}\noindent}{\newline\indent{5}}
\Language{} does not allow you to create types where
\spadtype{MultivariatePolynomial} is contained in the coefficient type of
\spadtype{Polynomial}. Therefore,
\spad{MPOLY([x,y],POLY INT)} is legal but
\spad{POLY MPOLY([x,y],INT)} is not.
\texht{\end{quotation}}{\indent{0}}
\endImportant

\xtc{
Multivariate polynomials may be combined with univariate polynomials
to create types with special structures.
}{
\spadpaste{q : UP(x, FRAC MPOLY([y,z],INT)) \bound{qdec}}
}
\xtc{
This is a polynomial in \spad{x} whose coefficients are
quotients of polynomials in \spad{y} and \spad{z}.
}{
\spadpaste{q := (x**2 - x*(z+1)/y +2)**2 \free{qdec}\bound{q}}
}
\xtc{
Use conversions for structural rearrangements.
\spad{z} does not appear in a denominator and so it can be made
the main variable.
}{
\spadpaste{q :: UP(z, FRAC MPOLY([x,y],INT)) \free{q}}
}
\xtc{
Or you can make a multivariate polynomial in \spad{x} and \spad{z}
whose coefficients are fractions in polynomials in \spad{y}.
}{
\spadpaste{q :: MPOLY([x,z], FRAC UP(y,INT)) \free{q}}
}
A conversion like \spad{q :: MPOLY([x,y], FRAC UP(z,INT))} is not
possible in this example
because \spad{y} appears in the denominator of a fraction.
As you can see, \Language{} provides extraordinary flexibility in the
manipulation and display of expressions via its conversion facility.

For more information on related topics, see
\downlink{`Polynomial'}{PolynomialXmpPage}\ignore{Polynomial},
\downlink{`UnivariatePolynomial'}{UnivariatePolynomialXmpPage}\ignore{UnivariatePolynomial}, and
\downlink{`DistributedMultivariatePolynomial'}{DistributedMultivariatePolynomialXmpPage}\ignore{DistributedMultivariatePolynomial}.
\showBlurb{MultivariatePolynomial}
\endscroll
\autobuttons
\end{page}
%