Changeset b41ecb in git for Singular/LIB/primitiv.lib
- Timestamp:
- Jun 10, 2010, 5:29:35 PM (14 years ago)
- Branches:
- (u'spielwiese', '73c62e0961bcfc8f1a00420b41eec2ea3c0ef6e9')
- Children:
- d68d3048996d31d47c0ed73b4ac2d83e0661878a
- Parents:
- 604d8bb038d7aa985d50d55053096e60b087e614
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primitiv.lib
r604d8b rb41ecb 165 165 { 166 166 def altring=basering; 167 int grad1,grad2=deg(i[1]),deg(jet(i[2],0,intvec(1,0))); 167 int grad1=deg(i[1]); 168 int grad2=deg(jet(i[2],0,intvec(1,0))); 169 if (grad2==0) { ERROR("i[2] is not monic"); } 168 170 int countx,countz; 171 if (size(variables(i[1]))!=1) { ERROR("i[1] must be poly in x"); } 172 if (size(variables(i[2]))!=2) { ERROR("i[2] must be poly in x,a"); } 173 if (variables(i[2])[2]!=a) { ERROR("i[2] must be poly in x,a"); } 169 174 ring deglexring=char(altring),(x,y,z),dp; 170 175 map transfer=altring,x,z; 171 176 ideal i=transfer(i); 172 if (size(i)!=2) { 173 "//** Error -- either wrong number of given minimal polynomials"; 174 "//** or wrong choice of ring variables (must use the first two)"; 175 setring altring; 176 return(ideal(0)); 177 if (size(i)!=2) 178 { 179 ERROR("either wrong number of given minimal polynomials"+newline+ 180 "or wrong choice of ring variables (must use the first two)"); 177 181 } 178 182 matrix mat; … … 189 193 //---------------- Schleife zum Finden des primitiven Elements --------------- 190 194 //--- Schleife ist so angordnet, dass g in Charakteristik 0 linear bleibt ---- 191 while (found==0) { 195 while (found==0) 196 { 192 197 j=eliminate(i+ideal(g-y),z); 193 198 setring deglex2ring; … … 195 200 setring lexring; 196 201 j=fglm(deglex2ring,j); 197 if (size(j)==2) { 198 if (deg(j[1])==grad1*grad2) { 202 if (size(j)==2) 203 { 204 if (deg(j[1])==grad1*grad2) 205 { 199 206 j[2]=j[2]/leadcoef(j[2]); // Normierung 200 if (lead(j[2])==x) { // Alles ok 207 if (lead(j[2])==x) 208 { // Alles ok 201 209 found=1; 202 210 } … … 204 212 } 205 213 setring deglexring; 206 if (found==0) { 214 if (found==0) 215 { 207 216 //------------------ waehle ein neues Polynom g ------------------------------ 208 217 dbprint("Still searching for primitive element..."); 209 218 countx=0; 210 219 countz=0; 211 while (found==0) { 220 while (found==0) 221 { 212 222 countx++; 213 if (countx>=grad1) { 223 if (countx>=grad1) 224 { 214 225 countx=0; 215 226 countz++; 216 if (countz>=grad2) { 217 "//** Error: No primitive element found!! This should NEVER happen!"; 218 setring altring; 219 return(ideal(0)); 220 } 227 if (countz>=grad2) 228 { ERROR("No primitive element found!! This should NEVER happen!"); } 221 229 } 222 230 g = g +x^countx *z^countz; 223 231 mat=coeffs(g,z); 224 if (size(mat)>countz) { 232 if (size(mat)>countz) 233 { 225 234 mat=coeffs(mat[countz+1,1],x); 226 if (size(mat)>countx) { 227 if (mat[countx+1,1] != 0) { 235 if (size(mat)>countx) 236 { 237 if (mat[countx+1,1] != 0) 238 { 228 239 found=1; // d.h. hier: neues g gefunden 229 240 }}}
Note: See TracChangeset
for help on using the changeset viewer.