Home Online Manual
Top
Back: netmatrixShort
Forward: netPrimePower
FastBack:
FastForward:
Up: nets_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.15.14.19 netPoly

Procedure from library nets.lib (see nets_lib).

Usage:
netPoly(P); P poly

Assume:
P is a poly

Return:
visual presentation of P over two rows

Theory:
A Singular object is converted into a character array (a Net) for on screen printing.

Example:
 
LIB "nets.lib";
// from 3.3.1 Examples of ring declarations
//
ring R1 = 32003,(x,y,z),dp;
poly q6=1;
print(q6);
==> 1
netPoly(q6);
==>  
==> 1
==> 
poly q7=-1;
print(q7);
==> -1
netPoly(q7);
==>   
==> -1
==> 
poly q8=2;
print(q8);
==> 2
netPoly(q8);
==>  
==> 2
==> 
poly q9=-2;
print(q9);
==> -2
netPoly(q9);
==>   
==> -2
==> 
poly q1=x+y+z;
print(q1);
==> x+y+z
netPoly(q1);
==>      
==> x+y+z
==> 
poly q2=xy+xz+yz;
print(q2);
==> xy+xz+yz
netPoly(q2);
==>         
==> xy+xz+yz
==> 
poly q3=2x3y3z4-3x4y5z6;
print(q3);
==> -3x4y5z6+2x3y3z4
netPoly(q3);
==>    4 5 6   3 3 4
==> -3x y z +2x y z 
==> 
poly q4=x3y3z4-x4y5z6;
print(q4);
==> -x4y5z6+x3y3z4
netPoly(q4);
==>   4 5 6  3 3 4
==> -x y z +x y z 
==> 
poly q5=-x3y3z4+x4y5z6;
print(q5);
==> x4y5z6-x3y3z4
netPoly(q5);
==>  4 5 6  3 3 4
==> x y z -x y z 
==> 
ring R2 = 32003,(x(1..10)),dp;
poly w6=1;
print(w6);
==> 1
netPoly(w6);
==>  
==> 1
==> 
poly w7=-1;
print(w7);
==> -1
netPoly(w7);
==>   
==> -1
==> 
poly w2=-x(1)-(2)-x(3);
print(w2);
==> -x(1)-x(3)-2
netPoly(w2);
==>             
==> -x(1)-x(3)-2
==> 
poly w3=x(1)*x(2)+x(1)*x(2)+x(2)*x(3);
print(w3);
==> 2*x(1)*x(2)+x(2)*x(3)
netPoly(w3);
==>                   
==> 2x(1)x(2)+x(2)x(3)
==> 
poly w4=x(1)*x(2)-x(1)*x(2)-x(2)*x(3);
print(w4);
==> -x(2)*x(3)
netPoly(w4);
==>          
==> -x(2)x(3)
==> 
poly w5=x(1)^2*x(2)^3*x(3)^4;
print(w5);
==> x(1)^2*x(2)^3*x(3)^4
netPoly(w5);
==>     2    3    4
==> x(1) x(2) x(3) 
==> 
poly w8=x(1)+x(2)+x(3);
print(w8);
==> x(1)+x(2)+x(3)
netPoly(w8);
==>               
==> x(1)+x(2)+x(3)
==> 
poly w9=x(1)+x(2)+x(3);
print(w9);
==> x(1)+x(2)+x(3)
netPoly(w9);
==>               
==> x(1)+x(2)+x(3)
==> 
ring R3 = 32003,(x(1..5)(1..8)),dp;
poly e1=x(1)(1)+x(2)(2)+x(3)(3);
print(e1);
==> x(1)(1)+x(2)(2)+x(3)(3)
netPoly(e1);
==>                        
==> x(1)(1)+x(2)(2)+x(3)(3)
==> 
poly e2=x(1)(1)*x(2)(2)*x(3)(3);
print(e2);
==> x(1)(1)*x(2)(2)*x(3)(3)
netPoly(e2);
==>                      
==> x(1)(1)x(2)(2)x(3)(3)
==> 
poly e3=x(1)(1)^2*x(2)(2)^3*x(3)(3)^4;
print(e3);
==> x(1)(1)^2*x(2)(2)^3*x(3)(3)^4
netPoly(e3);
==>        2       3       4
==> x(1)(1) x(2)(2) x(3)(3) 
==> 
poly e4=-x(1)(1)^2*x(2)(2)^3*x(3)(3)^4-x(1)(1)^3*x(2)(2)^3*x(3)(3)^4;
print(e4);
==> -x(1)(1)^3*x(2)(2)^3*x(3)(3)^4-x(1)(1)^2*x(2)(2)^3*x(3)(3)^4
netPoly(e4);
==>         3       3       4        2       3       4
==> -x(1)(1) x(2)(2) x(3)(3) -x(1)(1) x(2)(2) x(3)(3) 
==> 
ring r=32003,(x,y,z),lp;
poly p=x4+4y4+4z4-x3-3y3-3z3+1x2+2y2+z2-x-1y-z1;
p;
==> x4-x3+x2-x+4y4-3y3+2y2-y+4z4-3z3+z2-z
netPoly(p);
==>  4  3  2     4   3   2     4   3  2  
==> x -x +x -x+4y -3y +2y -y+4z -3z +z -z
==> 
poly p2=x3yz+xy3z+xyz3-2x2yz-2xy2z-2xyz2+1xyz+x1yzxy1z;
p2;
==> x3yz+x2y2z2-2x2yz+xy3z-2xy2z+xyz3-2xyz2+xyz
netPoly(p2);
==>  3    2 2 2   2     3     2     3     2    
==> x yz+x y z -2x yz+xy z-2xy z+xyz -2xyz +xyz
==> 
poly p3=x+y+z-x2-3y-4z4+xy+xz+2xy-x2y-xz2-y2z2;
p3;
==> -x2y-x2+3xy-xz2+xz+x-y2z2-2y-4z4+z
netPoly(p3);
==>   2   2       2       2 2      4  
==> -x y-x +3xy-xz +xz+x-y z -2y-4z +z
==> 
ring r2=32003,(x(1..10)),lp;
poly p=x(1)*x(2)*x(3)+2*x(1)^2+2*x(1)*x(2);
p;
==> 2*x(1)^2+x(1)*x(2)*x(3)+2*x(1)*x(2)
netPoly(p);
==>      2                       
==> 2x(1) +x(1)x(2)x(3)+2x(1)x(2)
==> 
poly p2=x(1)^2*x(2)^3*x(3)^4-2*x(1)^1*x(2)^2+2*x(1)*x(2)*x(10);
p2;
==> x(1)^2*x(2)^3*x(3)^4-2*x(1)*x(2)^2+2*x(1)*x(2)*x(10)
netPoly(p2);
==>     2    3    4          2               
==> x(1) x(2) x(3) -2x(1)x(2) +2x(1)x(2)x(10)
==> 
ring r3=7,(x,y,z),lp;
poly p=17x2+24y;
p;
==> 3x2+3y
netPoly(p);
==>   2   
==> 3x +3y
==> 
ring r4=(7,a,b,c),(x,y,z),Dp;
poly p=2ax2+by-cz3;
p;
==> (-c)*z3+(2a)*x2+(b)*y
netPoly(p);
==>      3      2     
==> (-c)z +(2a)x +(b)y
==> 
ring r5=(7,a),(x,y,z),dp;
minpoly = a^2+a+3;
poly p=2ax2+y-az3;
p;
==> (-a)*z3+(2a)*x2+y
netPoly(p);
==>      3      2  
==> (-a)z +(2a)x +y
==> 
ring r6 = (complex,30,j),(x,y,z),dp;
poly p=2x2+y-z3+20*j;
p;
==> -z3+2*x2+y+(j*20)
netPoly(p);
==>   3   2         
==> -z +2x +y+(j*20)
==>