1 | /////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version modwalk.lib 4.0.0.0 Jun_2013 "; |
---|
3 | category = "Commutative Algebra"; |
---|
4 | info=" |
---|
5 | LIBRARY: modwalk.lib Groebner basis convertion |
---|
6 | |
---|
7 | AUTHORS: S. Oberfranz oberfran@mathematik.uni-kl.de |
---|
8 | |
---|
9 | OVERVIEW: |
---|
10 | |
---|
11 | A library for converting Groebner bases of an ideal in the polynomial |
---|
12 | ring over the rational numbers using modular methods. The procedures are |
---|
13 | inspired by the following paper: |
---|
14 | Elizabeth A. Arnold: Modular algorithms for computing Groebner bases. |
---|
15 | Journal of Symbolic Computation 35, 403-419 (2003). |
---|
16 | |
---|
17 | PROCEDURES: |
---|
18 | |
---|
19 | modWalk(I,#); standard basis conversion of I by Groebner Walk using modular methods |
---|
20 | modrWalk(I,radius,pertdeg,#); standard basis conversion of I by Random Walk using modular methods |
---|
21 | modfWalk(I,#); standard basis conversion of I by Fractal Walk using modular methods |
---|
22 | modfrWalk(I,radius,#); standard basis conversion of I by Random Fractal Walk using modular methods |
---|
23 | "; |
---|
24 | |
---|
25 | LIB "rwalk.lib"; |
---|
26 | LIB "grwalk.lib"; |
---|
27 | LIB "modular.lib"; |
---|
28 | |
---|
29 | proc modWalk(ideal I, list #) |
---|
30 | "USAGE: modWalk(I, [, v, w]); I ideal, v intvec, w intvec |
---|
31 | RETURN: a standard basis of I |
---|
32 | NOTE: The procedure computes a standard basis of I (over the rational |
---|
33 | numbers) by using modular methods. |
---|
34 | SEE ALSO: modular |
---|
35 | EXAMPLE: example modWalk; shows an example" |
---|
36 | { |
---|
37 | /* read optional parameter */ |
---|
38 | if (size(#) > 0) { |
---|
39 | if (size(#) == 1) { |
---|
40 | intvec w = #[1]; |
---|
41 | } |
---|
42 | if (size(#) == 2) { |
---|
43 | intvec v = #[1]; |
---|
44 | intvec w = #[2]; |
---|
45 | } |
---|
46 | if (size(#) > 2 || typeof(#[1]) != "intvec") { |
---|
47 | ERROR("wrong optional parameter"); |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | /* save options */ |
---|
52 | intvec opt = option(get); |
---|
53 | option(redSB); |
---|
54 | |
---|
55 | /* set additional parameters */ |
---|
56 | int reduction = 1; |
---|
57 | int printout = 0; |
---|
58 | |
---|
59 | /* call modular() */ |
---|
60 | if (size(#) > 0) { |
---|
61 | I = modular("gwalk", list(I,reduction,printout,#)); |
---|
62 | } |
---|
63 | else { |
---|
64 | I = modular("gwalk", list(I,reduction,printout)); |
---|
65 | } |
---|
66 | |
---|
67 | /* return the result */ |
---|
68 | attrib(I, "isSB", 1); |
---|
69 | option(set, opt); |
---|
70 | return(I); |
---|
71 | } |
---|
72 | example |
---|
73 | { |
---|
74 | "EXAMPLE:"; |
---|
75 | echo = 2; |
---|
76 | ring R1 = 0, (x,y,z,t), dp; |
---|
77 | ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4; |
---|
78 | I = std(I); |
---|
79 | ring R2 = 0, (x,y,z,t), lp; |
---|
80 | ideal I = fetch(R1, I); |
---|
81 | ideal J = modWalk(I); |
---|
82 | J; |
---|
83 | } |
---|
84 | |
---|
85 | proc modrWalk(ideal I, int radius, int pertdeg, list #) |
---|
86 | "USAGE: modrWalk(I, radius, pertdeg[, v, w]); |
---|
87 | I ideal, radius int, pertdeg int, v intvec, w intvec |
---|
88 | RETURN: a standard basis of I |
---|
89 | NOTE: The procedure computes a standard basis of I (over the rational |
---|
90 | numbers) by using modular methods. |
---|
91 | SEE ALSO: modular |
---|
92 | EXAMPLE: example modrWalk; shows an example" |
---|
93 | { |
---|
94 | /* read optional parameter */ |
---|
95 | if (size(#) > 0) { |
---|
96 | if (size(#) == 1) { |
---|
97 | intvec w = #[1]; |
---|
98 | } |
---|
99 | if (size(#) == 2) { |
---|
100 | intvec v = #[1]; |
---|
101 | intvec w = #[2]; |
---|
102 | } |
---|
103 | if (size(#) > 2 || typeof(#[1]) != "intvec") { |
---|
104 | ERROR("wrong optional parameter"); |
---|
105 | } |
---|
106 | } |
---|
107 | |
---|
108 | /* save options */ |
---|
109 | intvec opt = option(get); |
---|
110 | option(redSB); |
---|
111 | |
---|
112 | /* set additional parameters */ |
---|
113 | int reduction = 1; |
---|
114 | int printout = 0; |
---|
115 | |
---|
116 | /* call modular() */ |
---|
117 | if (size(#) > 0) { |
---|
118 | I = modular("rwalk", list(I,radius,pertdeg,reduction,printout,#)); |
---|
119 | } |
---|
120 | else { |
---|
121 | I = modular("rwalk", list(I,radius,pertdeg,reduction,printout)); |
---|
122 | } |
---|
123 | |
---|
124 | /* return the result */ |
---|
125 | attrib(I, "isSB", 1); |
---|
126 | option(set, opt); |
---|
127 | return(I); |
---|
128 | } |
---|
129 | example |
---|
130 | { |
---|
131 | "EXAMPLE:"; |
---|
132 | echo = 2; |
---|
133 | ring R1 = 0, (x,y,z,t), dp; |
---|
134 | ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4; |
---|
135 | I = std(I); |
---|
136 | ring R2 = 0, (x,y,z,t), lp; |
---|
137 | ideal I = fetch(R1, I); |
---|
138 | int radius = 2; |
---|
139 | int pertdeg = 3; |
---|
140 | ideal J = modrWalk(I,radius,pertdeg); |
---|
141 | J; |
---|
142 | } |
---|
143 | |
---|
144 | proc modfWalk(ideal I, list #) |
---|
145 | "USAGE: modfWalk(I, [, v, w]); I ideal, v intvec, w intvec |
---|
146 | RETURN: a standard basis of I |
---|
147 | NOTE: The procedure computes a standard basis of I (over the rational |
---|
148 | numbers) by using modular methods. |
---|
149 | SEE ALSO: modular |
---|
150 | EXAMPLE: example modfWalk; shows an example" |
---|
151 | { |
---|
152 | /* read optional parameter */ |
---|
153 | if (size(#) > 0) { |
---|
154 | if (size(#) == 1) { |
---|
155 | intvec w = #[1]; |
---|
156 | } |
---|
157 | if (size(#) == 2) { |
---|
158 | intvec v = #[1]; |
---|
159 | intvec w = #[2]; |
---|
160 | } |
---|
161 | if (size(#) > 2 || typeof(#[1]) != "intvec") { |
---|
162 | ERROR("wrong optional parameter"); |
---|
163 | } |
---|
164 | } |
---|
165 | |
---|
166 | /* save options */ |
---|
167 | intvec opt = option(get); |
---|
168 | option(redSB); |
---|
169 | |
---|
170 | /* set additional parameters */ |
---|
171 | int reduction = 1; |
---|
172 | int printout = 0; |
---|
173 | |
---|
174 | /* call modular() */ |
---|
175 | if (size(#) > 0) { |
---|
176 | I = modular("fwalk", list(I,reduction,printout,#)); |
---|
177 | } |
---|
178 | else { |
---|
179 | I = modular("fwalk", list(I,reduction,printout)); |
---|
180 | } |
---|
181 | |
---|
182 | /* return the result */ |
---|
183 | attrib(I, "isSB", 1); |
---|
184 | option(set, opt); |
---|
185 | return(I); |
---|
186 | } |
---|
187 | example |
---|
188 | { |
---|
189 | "EXAMPLE:"; |
---|
190 | echo = 2; |
---|
191 | ring R1 = 0, (x,y,z,t), dp; |
---|
192 | ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4; |
---|
193 | I = std(I); |
---|
194 | ring R2 = 0, (x,y,z,t), lp; |
---|
195 | ideal I = fetch(R1, I); |
---|
196 | ideal J = modfWalk(I); |
---|
197 | J; |
---|
198 | } |
---|
199 | |
---|
200 | proc modfrWalk(ideal I, int radius, list #) |
---|
201 | "USAGE: modfrWalk(I, radius [, v, w]); I ideal, radius int, v intvec, w intvec |
---|
202 | RETURN: a standard basis of I |
---|
203 | NOTE: The procedure computes a standard basis of I (over the rational |
---|
204 | numbers) by using modular methods. |
---|
205 | SEE ALSO: modular |
---|
206 | EXAMPLE: example modfrWalk; shows an example" |
---|
207 | { |
---|
208 | /* read optional parameter */ |
---|
209 | if (size(#) > 0) { |
---|
210 | if (size(#) == 1) { |
---|
211 | intvec w = #[1]; |
---|
212 | } |
---|
213 | if (size(#) == 2) { |
---|
214 | intvec v = #[1]; |
---|
215 | intvec w = #[2]; |
---|
216 | } |
---|
217 | if (size(#) > 2 || typeof(#[1]) != "intvec") { |
---|
218 | ERROR("wrong optional parameter"); |
---|
219 | } |
---|
220 | } |
---|
221 | |
---|
222 | /* save options */ |
---|
223 | intvec opt = option(get); |
---|
224 | option(redSB); |
---|
225 | |
---|
226 | /* set additional parameters */ |
---|
227 | int reduction = 1; |
---|
228 | int printout = 0; |
---|
229 | |
---|
230 | /* call modular() */ |
---|
231 | if (size(#) > 0) { |
---|
232 | I = modular("frandwalk", list(I,radius,reduction,printout,#)); |
---|
233 | } |
---|
234 | else { |
---|
235 | I = modular("frandwalk", list(I,radius,reduction,printout)); |
---|
236 | } |
---|
237 | |
---|
238 | /* return the result */ |
---|
239 | attrib(I, "isSB", 1); |
---|
240 | option(set, opt); |
---|
241 | return(I); |
---|
242 | } |
---|
243 | example |
---|
244 | { |
---|
245 | "EXAMPLE:"; |
---|
246 | echo = 2; |
---|
247 | ring R1 = 0, (x,y,z,t), dp; |
---|
248 | ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4; |
---|
249 | I = std(I); |
---|
250 | ring R2 = 0, (x,y,z,t), lp; |
---|
251 | ideal I = fetch(R1, I); |
---|
252 | int radius = 2; |
---|
253 | ideal J = modfrWalk(I,radius); |
---|
254 | J; |
---|
255 | } |
---|