function PR4=carr2PR2(PR2) % PR4=carr2PR2(PR2), P.Comon, Jun 12, 1998 % calcul du carre d'un polynome reel homogene de degre 2 % PR4: vecteur de taille 35 (nombre de monomes de degre 4 en 4 variables) % PR2: vecteur de taille 10 (nombre de monomes de degre 2 en 4 variables) % voir la fonction mod2PC2PR.m qui construit PR2 a=PR2(1);b=PR2(2);c=PR2(3);d=PR2(4);e=PR2(5); f=PR2(6);g=PR2(7);h=PR2(8);i=PR2(9);j=PR2(10); PR4=[ a^2; % x1^4 2*a*b; % x1^3*x2 2*a*c; % x1^3*y1 2*a*d; % x1^3*y2 2*a*e+b^2; % x1^2*x2^2 2*a*f+2*b*c; % x1^2*x2*y1 2*a*g+2*b*d; % x1^2*x2*y2 2*a*h+c^2; % x1^2*y1^2 2*a*i+2*c*d; % x1^2*y1*y2 2*a*j+d^2; % x1^2*y2^2 2*b*e; % x1*x2^3 +2*b*f+2*c*e; % x1*x2^2*y1 +2*b*g+2*d*e; % x1*x2^2*y2 2*c*f+2*b*h; % x1*x2*y1^2 2*d*f+2*b*i+2*c*g; % x1*x2*y1*y2 2*b*j+2*d*g; % x1*x2*y2^2 2*c*h; % x1*y1^3 2*d*h+2*c*i; % x1*y1^2*y2 2*d*i+2*c*j; % x1*y1*y2^2 2*d*j; % x1*y2^3 e^2; % x2^4 2*e*f; % x2^3*y1 2*e*g; % x2^3*y2 2*e*h+f^2; % x2^2*y1^2 2*f*g+2*e*i; % x2^2*y1*y2 2*e*j+g^2; % x2^2*y2^2 2*f*h; % x2*y1^3 2*g*h+2*f*i; % x2*y1^2*y2 2*f*j+2*g*i; % x2*y1*y2^2 2*g*j; % x2*y2^3 h^2; % y1^4 2*h*i; % y1^3*y2 2*h*j+i^2; % y1^2*y2^2 2*i*j; % y1*y2^3 j^2; % y2^4 ];