spielwiese
Last change
on this file since 6fb723 was
894057,
checked in by Oleksandr Motsak <motsak@…>, 13 years ago
|
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | LIB "tst.lib"; tst_init(); |
---|
2 | LIB "solve.lib"; |
---|
3 | // Find all roots of a multivariate ideal using triangular sets: |
---|
4 | int d,t,s = 4,3,2 ; |
---|
5 | int i; |
---|
6 | ring A=0,x(1..d),dp; |
---|
7 | poly p=-1; |
---|
8 | for (i=d; i>0; i--) { p=p+x(i)^s; } |
---|
9 | ideal I = x(d)^t-x(d)^s+p; |
---|
10 | for (i=d-1; i>0; i--) { I=x(i)^t-x(i)^s+p,I; } |
---|
11 | I; |
---|
12 | // the multiplicity is |
---|
13 | vdim(std(I)); |
---|
14 | def AC=solve(I,6,0,"nodisplay"); // solutions should not be displayed |
---|
15 | // list of solutions is stored in AC as the list SOL (default name) |
---|
16 | setring AC; |
---|
17 | size(SOL); // number of different solutions |
---|
18 | SOL[5]; // the 5th solution |
---|
19 | // you must start with char. 0 |
---|
20 | setring A; |
---|
21 | def AC1=solve(I,6,1,"nodisplay"); |
---|
22 | setring AC1; |
---|
23 | size(SOL); // number of different multiplicities |
---|
24 | SOL[1][1][1]; // a solution with |
---|
25 | SOL[1][2]; // multiplicity 1 |
---|
26 | SOL[2][1][1]; // a solution with |
---|
27 | SOL[2][2]; // multiplicity 12 |
---|
28 | // the number of different solutions is equal to |
---|
29 | size(SOL[1][1])+size(SOL[2][1]); |
---|
30 | // the number of complex solutions (counted with multiplicities) is |
---|
31 | size(SOL[1][1])*SOL[1][2]+size(SOL[2][1])*SOL[2][2]; |
---|
32 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.