source: git/Tst/Manual/solve.tst @ 6fb723

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 
1LIB "tst.lib"; tst_init();
2LIB "solve.lib";
3// Find all roots of a multivariate ideal using triangular sets:
4int d,t,s = 4,3,2 ;
5int i;
6ring A=0,x(1..d),dp;
7poly p=-1;
8for (i=d; i>0; i--) { p=p+x(i)^s; }
9ideal I = x(d)^t-x(d)^s+p;
10for (i=d-1; i>0; i--) { I=x(i)^t-x(i)^s+p,I; }
11I;
12// the multiplicity is
13vdim(std(I));
14def 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)
16setring AC;
17size(SOL);               // number of different solutions
18SOL[5];                  // the 5th solution
19// you must start with char. 0
20setring A;
21def AC1=solve(I,6,1,"nodisplay");
22setring AC1;
23size(SOL);               // number of different multiplicities
24SOL[1][1][1];            // a solution with
25SOL[1][2];               // multiplicity 1
26SOL[2][1][1];            // a solution with
27SOL[2][2];               // multiplicity 12
28// the number of different solutions is equal to
29size(SOL[1][1])+size(SOL[2][1]);
30// the number of complex solutions (counted with multiplicities) is
31size(SOL[1][1])*SOL[1][2]+size(SOL[2][1])*SOL[2][2];
32tst_status(1);$
Note: See TracBrowser for help on using the repository browser.