Changeset b41ecb in git
- Timestamp:
- Jun 10, 2010, 5:29:35 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- d68d3048996d31d47c0ed73b4ac2d83e0661878a
- Parents:
- 604d8bb038d7aa985d50d55053096e60b087e614
- Location:
- Singular/LIB
- Files:
-
- 2 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 }}} -
Singular/LIB/zeroset.lib
r604d8b rb41ecb 98 98 int dbPrt = printlevel-voice+3; 99 99 100 ideal fff=sqrfree(f); 101 f=fff[1]; 102 for(int iii=2;iii<ncols(fff);iii++) { f=f*fff[iii]; } 100 103 // create a new ring where par(1) is replaced by the variable 101 104 // with the same name or, if basering does not contain a parameter, … … 225 228 Xchange[2] = var(1); // for the use of 'primitive' 226 229 227 if(nlinFactors == 1) {// one nl factor228 230 if(nlinFactors == 1) // one nl factor 231 { 229 232 // compute the roots of the nonlinear (irreducible, monic) factor f1 of f 230 233 // by extending the basefield by a' with minimal polynomial f1 … … 232 235 233 236 f1 = nlFactors[1]; 234 if(mpoly[1] != 0) { 237 if(mpoly[1] != 0) 238 { 235 239 mp = mpoly[1]; 236 240 minPolys = Xchange(mp), Xchange(f1); 237 primElem = primitive_extra(minPolys); // no random coord. change 241 if (deg(jet(minPolys[2],0,intvec(1,0)))==0) 242 { primElem = primitive(minPolys); } // random coord. change 243 else 244 { primElem = primitive_extra(minPolys); } // no random coord. change 238 245 mpoly = std(primElem[1]); 239 246 F = basering, maxideal(1);
Note: See TracChangeset
for help on using the changeset viewer.