File r37/lisp/csl/html/r37_0584.html artifact ae585da366 part of check-in 8e196c7117



<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>(&lt;poly&gt;,&lt;x&gt;) 
<P>
<P>
<P>
&lt;poly&gt; :- a monic univariate polynomial in &lt;x&gt;. 
<P>
<P>
&lt;x&gt; :- the variable. 
<P>
<P>
<em>companion</em>creates the companion matrix C of &lt;poly&gt;. 
<P>
<P>
This is the square matrix of dimension n, where n is the degree of 
&lt;poly&gt; w.r.t. &lt;x&gt;. 
<P>
<P>
The entries of C are: 
<P>
<P>
C(i,n) = -coeffn(&lt;poly&gt;,&lt;x&gt;,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>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]