~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/calpol/sylm.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [s]=sylm(a,b)
 
2
//[s]=sylm(a,b) gives the Sylvester matrix associated to polynomials
 
3
//a and b, i.e. the matrix s such that:
 
4
//  coeff( a*x + b*y )' = s * [coeff(x)';coeff(y)']
 
5
//dimension of s is equal to degree(a)+degree(b)
 
6
//If a and b are coprime polynomials
 
7
//(rank(sylm(a,b))=degree(a)+degree(b)) the instructions
 
8
//  u = sylm(a,b) \ eye(na+nb,1)
 
9
//  x = poly(u(1:nb),'z','coeff')
 
10
//  y = poly(u(nb+1:na+nb),'z','coeff')
 
11
//compute Bezout factors x et y of minimal degree de degre minimal
 
12
//such that a*x+b*y=1
 
13
//!
 
14
// Copyright INRIA
 
15
na=degree(a);a=coeff(a)';
 
16
nb=degree(b);b=coeff(b)';
 
17
s(na+nb,na+nb)=0;
 
18
for i=1:nb,s(i:na+i,i)=a,end
 
19
for i=1:na,s(i:nb+i,nb+i)=b,end
 
20
 
 
21
 
 
22