<A NAME=companion>
<TITLE>companion</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>
<B>COMPANION</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P>
<P>
<P>
<P>
<P> <H3>
syntax: </H3>
<em>companion</em>(<poly>,<x>)
<P>
<P>
<P>
<poly> :- a monic univariate polynomial in <x>.
<P>
<P>
<x> :- the variable.
<P>
<P>
<em>companion</em>creates the companion matrix C of <poly>.
<P>
<P>
This is the square matrix of dimension n, where n is the degree of
<poly> w.r.t. <x>.
<P>
<P>
The entries of C are:
<P>
<P>
C(i,n) = -coeffn(<poly>,<x>,i-1) for i = 1
... n, C(i,i-1) = 1 for i = 2 ... n and
the rest are 0.
<P>
<P>
<P> <H3>
examples: </H3>
<P><PRE><TT>
companion(x^4+17*x^3-9*x^2+11,x);
[0 0 0 -11]
[ ]
[1 0 0 0 ]
[ ]
[0 1 0 9 ]
[ ]
[0 0 1 -17]
</TT></PRE><P>Related functions:
<A HREF=r37_0588.html>find_companion</A>.
<P>
<P>