Solving polynomial systems by matrix computations |
Ma: A | -> | A |
b | -> | a b |
|
-> |
|
|||||||||||||||
L | -> | a · L |
Ma = |
æ ç ç ç ç è |
|
ö ÷ ÷ ÷ ÷ ø |
Ma,i= |
æ ç ç ç ç è |
|
ö ÷ ÷ ÷ ÷ ø |
. |
|
-> | K | ||||||
p | -> | p(z) |
M |
|
(1 |
|
)(b)= 1 |
|
(a b) = a(zi) b(zi)= a(zi)1 |
|
(b), |
zi = ( |
|
, ..., |
|
). |
<B><PRE> E =Solve(M,n,Eigen()) </PRE></B>where M is a matrix of multiplication and n the number of variable. The matrix E will be the matrix of complex coordinates of the (simple) roots.
æ ç ç ç ç ç ç ç ç è |
é ê ê ê ê ê ê ë |
|
ù ú ú ú ú ú ú û |
-b |
é ê ê ê ê ê ê ê ê ë |
|
ù ú ú ú ú ú ú ú ú û |
ö ÷ ÷ ÷ ÷ ÷ ÷ ÷ ÷ ø |
é ê ê ê ê ê ë |
|
ù ú ú ú ú ú û |
= 0 |
<B><PRE> E = Solve$<$ MatC$>$ (Mx, Compagnon()) </PRE></B>where MatC is a type of matrix with complexe coefficients.
|
A |
C |
B |
D |
M |
|
= A - B D-1 C. |
M= USchur(S);where S is a matrix satisfying the hypotheses X (eg. a resultant matrix of a generic system).
#include <list> #include "mpoly.H" #include "mpoly/resultant.H" #include "lapack.H" #include "linalg.H" typedef Monom<double, dynamicexp<'x'> > Mon; typedef MPoly<vector<Mon>, Dlex<Mon> > Pol; typedef MatDense<lapack<double> > Matr; typedef VectStd<array1d<double> > Vect; typedef VectStd<array1d<complex<double> > > VectC; int main (int argc, char **argv) { int n; cin >>n; array1d<Pol> l(n); for(int i=0; i< n;i++) cin >> l[i]; cout <<"Polynomes:"<<endl; for(int i=0; i< n;i++) cout<<l[i]<<";"<<endl; int d=1; for(int i=1; i< n;i++) d*=Degree(l[i]); cout <<"Bezout bound:"<<d<<endl; Matr S=Macaulay<lapack<double> >(l,'N'); cout <<"Macaulay matrix of size "<< S.nbrow()<<endl; for(unsigned int i=d; i<S.nbrow(); i++) if(S(i,i)==0) cout<<"Probleme d'ordre des polynomes "<<i<<" "<<i <<endl; Matr D = S(Range(d,S.nbrow()-1),Range(d,S.nbcol()-1)); cout <<"Lower diag. block of size "<< D.nbrow()<<endl; cout <<"Singular values of D: "<<endl; Vect Sv= Svd(D); cout << Sv<<endl; // cout <<"Singular values of S: "<<endl; // cout <<Eval<Vect>(Svd(S))<<endl; Matr U= USchur(S,d); cout <<"Eigenvalues of the Schur complement: "<<endl; cout << Eigenval(U)<<endl; }