source: git/Tst/Manual/Long_coefficients.tst @ e74bb4

fieker-DuValspielwiese
Last change on this file since e74bb4 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: 933 bytes
Line 
1LIB "tst.lib"; tst_init();
2timer = 1;                              // activate the timer
3ring R0 = 0,(x,y),lp;
4poly f = x5+y11+xy9+x3y9;
5ideal i = jacob(f);
6ideal i1 = i,i[1]*i[2];                 // undeformed ideal
7ideal i2 = i,i[1]*i[2]+1/1000000*x5y8;  // deformation of i1
8i1; i2;
9ideal j = std(i1);
10j;
11// Compute average coefficient length (=51) by
12//   - converting j[2] to a string in order to compute the number
13//   of characters
14//   - divide this by the number of monomials:
15size(string(j[2])) div size(j[2]);
16vdim(j);
17// For a better representation normalize the long coefficients
18// of the polynomial j[2] and map it to real:
19poly p=(1/12103947791971846719838321886393392913750065060875)*j[2];
20ring R1=real,(x,y),lp;
21short=0; // force the long output format
22poly p=imap(R0,p);
23p;
24// Compute a standard basis for the deformed ideal:
25setring R0; // return to the original ring R0
26j = std(i2);
27j;
28vdim(j);
29tst_status(1);$
Note: See TracBrowser for help on using the repository browser.