1
function [x,uu]=%i_gcd(p)
2
//Given a polynomial vector p, [pgcd,u]=gcd(p) computes the gcd
3
//of components and a unimodular matrix (with polynomial inverse) u,
4
//with minimal degree such that [p1 p2]*u=[0 ... 0 pgcd]
8
[m,n]=size(p);it=inttype(p)
16
uu=[uu(:,1:l-2) uu(:,l-1)*u(1,[2 1])];uu(l,l-1:l)=u(2,[2 1]);
19
if lhs==1 then return,end
25
if q<>iconvert(0,it) then
26
uu(1:l-1,k)=uu(1:l-1,k)-q*uu(1:l-1,l-1)