spielwiese
Last change
on this file since 891438c was
891438c,
checked in by Gerhard Pfister <pfister@…>, 23 years ago
|
*GP: initial release
git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
979 bytes
|
Line | |
---|
1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | proc invers(poly p, int k) |
---|
5 | { |
---|
6 | poly q=1/p[1]; |
---|
7 | poly re=q; |
---|
8 | p=q*(p[1]-jet(p,k)); |
---|
9 | poly s=p; |
---|
10 | while(p!=0) |
---|
11 | { |
---|
12 | re=re+q*p; |
---|
13 | p=jet(p*s,k); |
---|
14 | } |
---|
15 | return(re); |
---|
16 | } |
---|
17 | |
---|
18 | proc Weierstrass(poly f,poly g,int k) |
---|
19 | { |
---|
20 | int i; |
---|
21 | int n=nvars(basering); |
---|
22 | poly p=f; |
---|
23 | for(i=1;i<=n-1;i++) |
---|
24 | { |
---|
25 | p=subst(p,var(i),0); |
---|
26 | } |
---|
27 | if(p==0) |
---|
28 | { |
---|
29 | "the polynomial is not regular"; |
---|
30 | return(0); |
---|
31 | } |
---|
32 | int m=ord(p); |
---|
33 | poly hf=f/var(n)^m; |
---|
34 | poly rf=f-var(n)^m*hf; |
---|
35 | poly invhf=invers(f/var(n)^m,k); |
---|
36 | poly w=-invhf*rf; |
---|
37 | poly u=g/var(n)^m; |
---|
38 | poly v=u; |
---|
39 | poly H=jet((w*u)/var(n)^m,k); |
---|
40 | while(H!=0) |
---|
41 | { |
---|
42 | v=v+H; |
---|
43 | H=jet((w*H)/var(n)^m,k); |
---|
44 | } |
---|
45 | poly q=v*invhf; |
---|
46 | return(q); |
---|
47 | } |
---|
48 | |
---|
49 | ring R=0,(x,y),ds; |
---|
50 | poly f=y4+xy+x2y6+x7; |
---|
51 | poly g=y4; |
---|
52 | poly q=Weierstrass(f,g,10); |
---|
53 | poly w=jet(q*f,10); |
---|
54 | ring S=(0,x),y,ds; |
---|
55 | poly w=imap(R,w); |
---|
56 | w; |
---|
57 | |
---|
58 | setring R; |
---|
59 | q=Weierstrass(f,g,15); |
---|
60 | w=jet(q*f,15); |
---|
61 | setring S; |
---|
62 | w=imap(R,w); |
---|
63 | w; |
---|
64 | |
---|
65 | |
---|
66 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.