1 | // |
---|
2 | // solve_s.tst - short tests for |
---|
3 | |
---|
4 | LIB "tst.lib"; |
---|
5 | tst_init(); |
---|
6 | tst_ignore("CVS ID $Id: solve_l.tst,v 1.2 1999-11-18 16:38:35 obachman Exp $"); |
---|
7 | |
---|
8 | LIB "solve.lib"; |
---|
9 | |
---|
10 | //////////////////////////// |
---|
11 | |
---|
12 | tst_ignore( "ring rs1 = 0,(x,y,z),lp;" ); |
---|
13 | ring rs1 = 0,(h,x,y,z),lp; |
---|
14 | |
---|
15 | poly f0= x+y+z+1; |
---|
16 | poly f1= x^2 + 6*x + 3*y + 6*z - 4; |
---|
17 | poly f2= y^2 + 2*x -7*y + 5 + 2*z; |
---|
18 | poly f3= x^2 + y^2 + z^2 - 1; |
---|
19 | ideal i=f1,f2,f3; |
---|
20 | ideal im=f0,f1,f2,f3; |
---|
21 | |
---|
22 | ures_solve(homog(i,h),1); |
---|
23 | mp_res_mat(homog(im,h),1); |
---|
24 | |
---|
25 | tst_ignore( "ring rs2 = 0,(x,y,z),lp;" ); |
---|
26 | ring rs2 = 0,(x,y,z),lp; |
---|
27 | |
---|
28 | poly f0= x+y+z; |
---|
29 | poly f1= x^2 + 6*x + 3*y + 6*z - 4; |
---|
30 | poly f2= y^2 + 2*x -7*y + 5 + 2*z; |
---|
31 | poly f3= x^2 + y^2 + z^2 - 1; |
---|
32 | ideal i=f1,f2,f3; |
---|
33 | ideal im=f0,f1,f2,f3; |
---|
34 | |
---|
35 | ures_solve(i); |
---|
36 | mp_res_mat(im); |
---|
37 | |
---|
38 | fglm_solve(i,30); |
---|
39 | rlist; |
---|
40 | |
---|
41 | setring rs2; |
---|
42 | triangL_solve(i,30); |
---|
43 | rlist; |
---|
44 | |
---|
45 | setring rs2; |
---|
46 | triangLf_solve(i,30); |
---|
47 | rlist; |
---|
48 | |
---|
49 | setring rs2; |
---|
50 | triangM_solve(i,30); |
---|
51 | rlist; |
---|
52 | |
---|
53 | //////////////////////////// |
---|
54 | |
---|
55 | tst_ignore( "ring rs3 = 0,(x1,x2,x3),lp;" ); |
---|
56 | ring rs3 = 0,(x0,x1,x2,x3),lp; |
---|
57 | |
---|
58 | poly f0= x1+x2+x3+1; |
---|
59 | poly f1= -1 + 6*x1^2 - 4*x1*x2 + 3*x2^2 - 8*x1*x3 + 10*x2*x3 + 13*x3^2; |
---|
60 | poly f2= -2*x1 - 2*x1^2 + x2 - 2*x2^2 + 3*x1 - 4*x1*x3 - 4*x2*x3 - 4*x3^2; |
---|
61 | poly f3= x1 - 5*x1^2 - x2 + 2*x1*x2 - 2*x2^2 + 8*x1*x3 - 10*x2*x3 - 13*x3^2; |
---|
62 | ideal i=f1,f2,f3; |
---|
63 | ideal im=f0,f1,f2,f3; |
---|
64 | |
---|
65 | ures_solve(homog(i,x0),1); |
---|
66 | mp_res_mat(homog(im,x0),1); |
---|
67 | |
---|
68 | tst_ignore( "ring rs4 = 0,(x1,x2,x3),lp;" ); |
---|
69 | ring rs4 = 0,(x1,x2,x3),lp; |
---|
70 | |
---|
71 | poly f0= x1+x2+x3; |
---|
72 | poly f1= -1 + 6*x1^2 - 4*x1*x2 + 3*x2^2 - 8*x1*x3 + 10*x2*x3 + 13*x3^2; |
---|
73 | poly f2= -2*x1 - 2*x1^2 + x2 - 2*x2^2 + 3*x1 - 4*x1*x3 - 4*x2*x3 - 4*x3^2; |
---|
74 | poly f3= x1 - 5*x1^2 - x2 + 2*x1*x2 - 2*x2^2 + 8*x1*x3 - 10*x2*x3 - 13*x3^2; |
---|
75 | ideal i=f1,f2,f3; |
---|
76 | ideal im=f0,f1,f2,f3; |
---|
77 | |
---|
78 | ures_solve(i); |
---|
79 | mp_res_mat(im); |
---|
80 | |
---|
81 | fglm_solve(i,30); |
---|
82 | rlist; |
---|
83 | |
---|
84 | setring rs4; |
---|
85 | triangL_solve(i,30); |
---|
86 | rlist; |
---|
87 | |
---|
88 | setring rs4; |
---|
89 | triangLf_solve(i,30); |
---|
90 | rlist; |
---|
91 | |
---|
92 | setring rs4; |
---|
93 | triangM_solve(i,30); |
---|
94 | rlist; |
---|
95 | |
---|
96 | //////////////////////////// |
---|
97 | |
---|
98 | tst_ignore( "ring rs6= 0,(x,y),lp;" ); |
---|
99 | ring rs6= 0,(x,y),lp; |
---|
100 | poly f = 15x5 + x3 + x2 - 10; |
---|
101 | laguerre_solve(f); |
---|
102 | |
---|
103 | laguerre_solve(f,10); |
---|
104 | |
---|
105 | tst_ignore( "ring rsc= (real,20,I),x,lp;" ); |
---|
106 | ring rsc= (real,20,I),x,lp; |
---|
107 | poly f = (15.4+I*5)*x^5 + (25.0e-2+I*2)*x^3 + x2 - 10*I; |
---|
108 | laguerre_solve(f); |
---|
109 | |
---|
110 | //////////////////////////// |
---|
111 | |
---|
112 | ring rs7 = 0,(x),lp; |
---|
113 | ideal v=16,0,11376,1046880,85949136; |
---|
114 | interpolate( 3, v, 4 ); |
---|
115 | |
---|
116 | ring rs8 = 0,(x,y),dp; |
---|
117 | ideal p = 2,3; |
---|
118 | ideal v= 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16; |
---|
119 | poly ip= interpolate( p,v,3 ); |
---|
120 | ip; |
---|
121 | |
---|
122 | //////////////////////////// |
---|
123 | |
---|
124 | tst_status(1);$ |
---|
125 | |
---|