Changeset 30bb07 in git
- Timestamp:
- May 29, 2009, 12:07:01 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 667a9c0d30591ae4298e16548bf5886508bd3968
- Parents:
- a2b50cb2b820afde605ed45cb52930a5913927cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/presolve.lib
ra2b50c r30bb07 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: presolve.lib,v 1.34 2009-05-29 09:26:48 Singular Exp $"; 2 //changed GMG 20.5.09: degreepart, linearpart, elimpart 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: presolve.lib,v 1.35 2009-05-29 10:07:01 Singular Exp $"; 3 5 category="Symbolic-numerical solving"; 4 6 info=" … … 92 94 (default: v = 1,...,1) 93 95 _[2]: remaining generators of id 96 NOTE: if id is of type int/number/poly it is converted to ideal, if id is 97 of type intmat/matrix/vector to module and then the corresponding 98 generators are computed 94 99 EXAMPLE: example degreepart; shows an example 95 100 " … … 144 149 _[1]: generators of id of total degree <= 1 145 150 _[2]: remaining generators of id 151 NOTE: all variables have degree 1 (independent of ordering of basering) 146 152 EXAMPLE: example linearpart; shows an example 147 153 " … … 179 185 " 180 186 { 181 int ii,n,k ;182 string o , newo;187 int ii,n,k,ringchange; 188 string o; 183 189 intvec getoption = option(get); 184 190 option(redSB); … … 194 200 if ( n < nvars(BAS) ) 195 201 { 196 rest = maxi[n+1..nvars(BAS)]; 202 rest = maxi[n+1..nvars(BAS)]; //variables which are not substituted 197 203 } 198 204 attrib(rest,"isSB",1); … … 205 211 //## gmg, gendert 9/2008: interred sehr lange z.B. bei Leonard1 in normal, 206 212 //daher interred ersetzt durch: std nur auf linearpart angewendet 207 //Ordnung muss global sein, sonst egal (da Lin affin linear) 208 209 //--------------- replace ordering by dp if it is not global ----------------- 210 if ( ord_test(BAS) <= 0 ) 211 { 213 //Wechsel zu dp Ordnung (da Lin affin linear) 214 215 //--------------- replace ordering different from dp by dp ------------------- 216 o = "dp("+string(n)+")"; 217 if( ! find(ordstr(BAS),o) or find(ordstr(BAS),"a") ) 218 { 219 ringchange = 1; //remember change of ring 212 220 intvec V; 213 221 V[n]=0; V=V+1; //weights for dp ordering … … 230 238 lin = lin,id1; 231 239 lin = std(lin); 232 id = simplify(NF(id,lin),2); //instead of subst 240 id = simplify(NF(id,lin),2); //instead of subst, (### is faster) 233 241 id1 = linearpart(id)[1]; 234 242 } … … 275 283 //------------------ go back to original ring end return --------------------- 276 284 277 if ( ord_test(BAS) <= 0 )//i.e there was a ring change285 if ( ringchange ) //i.e there was a ring change 278 286 { 279 287 setring BAS; … … 347 355 348 356 list L = elimlinearpart(i,n); 357 ideal lin, eva, sub, neva, phi = L[1], L[2], L[3], L[4], L[5]; 349 358 if ( e == 0 ) 350 359 { 351 360 return(L); 352 361 } 353 ideal lin, eva, sub, neva, phi = L[1], L[2], L[3], L[4], L[5]; 362 354 363 //-------- direct substitution of variables if possible and if e!=0 ----------- 355 364 // first find terms lin1 in lin of pure degree 1 in each polynomial of lin … … 382 391 -z ergibt ich auch i[2]-z*i[3] mit option(redThrough) 383 392 statt interred kann man hier auch NF(i,i[3])+i[3] verwenden 384 hier li efert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))393 hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i)) 385 394 aber 3 (x,y,z) 386 395 Da interred oder NF aber die Laenge der polys vergroessern kann, nicht gemacht … … 421 430 //kin = polys of lin which contained a pure degree 1 part. 422 431 kin = simplify(kin,2); 423 l = ncols(kin);//l != 0 since lin1 != 0432 l = size(kin); //l != 0 since lin1 != 0 424 433 poly p,kip,vip, cand; 425 434 int count=1; … … 432 441 { 433 442 p = kin[kk]/var(ii); 434 if ( deg(p) == 0 ) //this means that kin[kk]= p*var(ii) + h, 435 //with p=const and h not depending on var(ii) 443 //if ( deg(p) == 0 ) 444 //old test, does not work if some var has deg 0 445 //geaendert Mai 09 gmg 446 447 if( p!=0 & p == jet(p,0) ) 448 //this means that kin[kk]= p*var(ii) + h, 449 //with p=const !=0 and h not depending on var(ii) 436 450 { 437 451 //we look for the shortest candidate to substitute var(ii) … … 448 462 } 449 463 } 450 } 464 } 451 465 if ( cand != 0 ) 452 466 { 453 467 p = cand/var(ii); 454 kip = cand/p; 468 kip = cand/p; //normalized polynomial of kin w.r.t var(ii) 455 469 eva = eva+var(ii); //var(ii) added to list of elimin. vars 456 470 neva[ii] = 0;
Note: See TracChangeset
for help on using the changeset viewer.