source: git/Singular/LIB/ringgb.lib @ c33727

fieker-DuValspielwiese
Last change on this file since c33727 was 3a1238, checked in by Oliver Wienand <wienand@…>, 18 years ago
optionale Protokol vollständige Reduktion git-svn-id: file:///usr/local/Singular/svn/trunk@8910 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 KB
Line 
1//(GMG/BM, last modified 22.06.96)
2///////////////////////////////////////////////////////////////////////////////
3version="$Id: ringgb.lib,v 1.16 2001/01/16 13:48:40 Singular Exp $";
4category="Beta Testing";
5info="
6LIBRARY:  ringgb.lib     Examples and tests for ringgb development
7
8PROCEDURES:
9 findZeroPoly(f);        finds a zero polynomial for reducing f
10 zeroReduce(f);          normal form of f concerning the ideal of zero polynomials
11 zeroReduceProt(f);          normal form of f concerning the ideal of zero polynomials
12";
13
14LIB "general.lib";
15///////////////////////////////////////////////////////////////////////////////
16
17proc findZeroPoly (poly f)
18"USAGE:   findZeroPoly(f); f - a polynomial
19RETURN:  zero polynomial with the same leading term as f if exists, otherwise 0
20NOTE:    just a wrapper
21EXAMPLE: example findZeroPoly; shows an example
22"
23{
24   return(system("findZeroPoly", f));
25}
26example
27{ "EXAMPLE:"; echo = 2;
28  option(teach);
29  ring r = 65536, (y,x), dp;
30  poly f = 1024*x^8*y^2+11264*x^8*y+28672*x^8+45056*x^7*y^2+36864*x^7*y+16384*x^7+40960*x^6*y^2+57344*x^6*y+32768*x^6+30720*x^5*y^2+10240*x^5*y+8192*x^5+35840*x^4*y^2+1024*x^4*y+20480*x^4+30720*x^3*y^2+10240*x^3*y+8192*x^3+4096*x^2*y^2+45056*x^2*y+49152*x^2+40960*x*y^2+57344*x*y+32768*x;
31  findZeroPoly(f);
32}
33
34proc zeroReduceExt (poly f , int i)
35"USAGE:   zeroReduceExt(f, i); f - a polynomial, i - noisy level
36RETURN:  reduced normal form of f modulo zero polynomials
37EXAMPLE: example zeroReduceExt; shows an example
38"
39{
40   poly h = f;
41   poly n = 0;
42   poly g = findZeroPoly(h);
43   while ( h <> 0 ) {
44      while ( g <> 0 ) {
45         h = h - g;
46         if (i == 1) {
47            printf("reduce with: %s", g);
48            printf("to: %s", h);
49         }
50         g = findZeroPoly(h);
51      }
52      n = lead(h) + n;
53      h = h - lead(h);
54      g = findZeroPoly(h);
55   }
56   return(n);
57}
58example
59{ "EXAMPLE:"; echo = 2;
60  option(teach);
61  ring r = 65536, (y,x), dp;
62  poly f = 1024*x^8*y^2+11264*x^8*y+28672*x^8+45056*x^7*y^2+36864*x^7*y+16384*x^7+40960*x^6*y^2+57344*x^6*y+32768*x^6+30720*x^5*y^2+10240*x^5*y+8192*x^5+35840*x^4*y^2+1024*x^4*y+20480*x^4+30720*x^3*y^2+10240*x^3*y+8192*x^3+4096*x^2*y^2+45056*x^2*y+49152*x^2+40960*x*y^2+57344*x*y+32768*x;
63  zeroReduceExt(f,0);
64  zeroReduceExt(f,1);
65}
66
67proc zeroReduce (poly f)
68"USAGE:   zeroReduce(f); f - a polynomial
69RETURN:  reduced normal form of f modulo zero polynomials
70EXAMPLE: example zeroReduce; shows an example
71"
72{
73   return(zeroReduceExt(f, 0));
74}
75example
76{ "EXAMPLE:"; echo = 2;
77  option(teach);
78  ring r = 65536, (y,x), dp;
79  poly f = 1024*x^8*y^2+11264*x^8*y+28672*x^8+45056*x^7*y^2+36864*x^7*y+16384*x^7+40960*x^6*y^2+57344*x^6*y+32768*x^6+30720*x^5*y^2+10240*x^5*y+8192*x^5+35840*x^4*y^2+1024*x^4*y+20480*x^4+30720*x^3*y^2+10240*x^3*y+8192*x^3+4096*x^2*y^2+45056*x^2*y+49152*x^2+40960*x*y^2+57344*x*y+32768*x;
80  zeroReduce(f);
81}
82
83proc zeroReduceProt (poly f)
84"USAGE:   zeroReduceProt(f); f - a polynomial
85RETURN:  reduced normal form of f modulo zero polynomials and describes the way *g*
86EXAMPLE: example zeroReduceProt; shows an example
87"
88{
89   return(zeroReduceExt(f, 1));
90}
91example
92{ "EXAMPLE:"; echo = 2;
93  option(teach);
94  ring r = 65536, (y,x), dp;
95  poly f = 1024*x^8*y^2+11264*x^8*y+28672*x^8+45056*x^7*y^2+36864*x^7*y+16384*x^7+40960*x^6*y^2+57344*x^6*y+32768*x^6+30720*x^5*y^2+10240*x^5*y+8192*x^5+35840*x^4*y^2+1024*x^4*y+20480*x^4+30720*x^3*y^2+10240*x^3*y+8192*x^3+4096*x^2*y^2+45056*x^2*y+49152*x^2+40960*x*y^2+57344*x*y+32768*x;
96  zeroReduceProt(f);
97}
Note: See TracBrowser for help on using the repository browser.