Changeset 4732f8 in git for kernel/ratgring.cc
- Timestamp:
- Feb 21, 2009, 8:30:56 PM (15 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- cce4a2f69a8341c6b8fbb3f1e78b41bf26ed7970
- Parents:
- 28f16452ba2351e155e944280a5d83ffdfd1ffc8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ratgring.cc
r28f164 r4732f8 7 7 * Author: levandov (Viktor Levandovsky) 8 8 * Created: 8/00 - 11/00 9 * Version: $Id: ratgring.cc,v 1.1 3 2009-02-21 16:01:05 SingularExp $9 * Version: $Id: ratgring.cc,v 1.14 2009-02-21 19:30:56 levandov Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 75 75 /* TO TEST!!! */ 76 76 /* returns x-coeff of p, i.e. a poly in x, s.t. corresponding xd-monomials 77 have the same D-part */ 77 have the same D-part 78 does not destroy p 79 */ 78 80 79 81 poly p_GetCoeffRat(poly p, int ishift, ring r) … … 207 209 poly u = singclap_pdivide(q,g); //q/g 208 210 poly v = singclap_pdivide(p,g); //p/g 211 v = p_Neg(v,r); 209 212 p_Delete(&p,r); 210 213 p_Delete(&q,r); … … 366 369 // } 367 370 371 372 /*4 - follow the numbering of gring.cc 373 * creates the S-polynomial of p1 and p2 374 * do not destroy p1 and p2 375 */ 376 poly nc_rat_CreateSpoly(poly pp1, poly pp2, int ishift, const ring r) 377 { 378 379 poly p1 = p_Copy(pp1,r); 380 poly p2 = p_Copy(pp2,r); 381 382 const long lCompP1 = p_GetComp(p1,r); 383 const long lCompP2 = p_GetComp(p2,r); 384 385 if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0)) 386 { 387 #ifdef PDEBUG 388 Werror("nc_rat_CreateSpoly: different non-zero components!"); 389 #endif 390 return(NULL); 391 } 392 393 /* note: prod. crit does not apply! */ 394 poly pL=pOne(); 395 poly m1=pOne(); 396 poly m2=pOne(); 397 int is = ishift; /* TODO */ 398 pLcmRat(p1,p2,pL,is); 399 p_Setm(pL,r); 400 #ifdef PDEBUG 401 p_Test(pL,r); 402 #endif 403 poly pr1 = p_GetExp_k_n(p1,1,ishift,r); /* rat D-exp of p1 */ 404 poly pr2 = p_GetExp_k_n(p2,1,ishift,r); /* rat D-exp of p2 */ 405 p_ExpVectorDiff(m1,pL,pr1,r); /* purely in D part by construction */ 406 p_ExpVectorDiff(m2,pL,pr2,r); /* purely in D part by construction */ 407 p_Delete(&pr1,r); 408 p_Delete(&pr2,r); 409 p_Delete(&pL,r); 410 #ifdef PDEBUG 411 p_Test(m1,r); 412 PrintS("d^{gamma-alpha} = "); p_wrp(m1,r); PrintLn(); 413 p_Test(m2,r); 414 PrintS("d^{gamma-beta} = "); p_wrp(m2,r); PrintLn(); 415 #endif 416 417 poly HF = NULL; 418 HF = p_HeadRat(p1,is,r); // lm_D(f) 419 HF = nc_mm_Mult_p(m1, HF, r); // // d^{gamma-alpha} lm_D(f) 420 poly C = p_GetCoeffRat(HF, is, r); // c = lc_D(h_f) in the paper 421 422 poly HG = NULL; 423 HG = p_HeadRat(p2,is,r); // lm_D(g) 424 HG = nc_mm_Mult_p(m2, HG, r); // // d^{gamma-beta} lm_D(g) 425 poly K = p_GetCoeffRat(HG, is, r); // k = lc_D(h_g) in the paper 426 427 #ifdef PDEBUG 428 PrintS("f: "); p_wrp(p1,r); PrintS("\n"); 429 PrintS("c: "); p_wrp(C,r); PrintS("\n"); 430 PrintS("g: "); p_wrp(p2,r); PrintS("\n"); 431 PrintS("k: "); p_wrp(K,r); PrintS("\n"); 432 #endif 433 434 ideal ncsyz = ncGCD(C,K,r); 435 poly KK = ncsyz->m[0]; ncsyz->m[0]=NULL; //p_Copy(ncsyz->m[0],r); // k' 436 poly CC = ncsyz->m[1]; ncsyz->m[1]= NULL; //p_Copy(ncsyz->m[1],r); // c' 437 id_Delete(&ncsyz,r); 438 439 p_LmDeleteAndNextRat(&p1, is+1, r); // t_f 440 p_LmDeleteAndNextRat(&HF, is+1, r); // r_f = h_f - lt_D(h_f) 441 442 p_LmDeleteAndNextRat(&p2, is+1, r); // t_g 443 p_LmDeleteAndNextRat(&HG, is+1, r); // r_g = h_g - lt_D(h_g) 444 445 446 #ifdef PDEBUG 447 PrintS(" t_f: "); p_wrp(p1,r); PrintS("\n"); 448 PrintS(" t_g: "); p_wrp(p2,r); PrintS("\n"); 449 PrintS(" r_f: "); p_wrp(HF,r); PrintS("\n"); 450 PrintS(" r_g: "); p_wrp(HG,r); PrintS("\n"); 451 PrintS(" c': "); p_wrp(CC,r); PrintS("\n"); 452 PrintS(" k': "); p_wrp(KK,r); PrintS("\n"); 453 454 #endif 455 456 // k'(r_f + d^{gamma-alpha} t_f) 457 458 p1 = p_Mult_q(m1, p1, r); // p1 = d^{gamma-alpha} t_f 459 p1 = p_Add_q(p1,HF,r); // p1 = r_f + d^{gamma-alpha} t_f 460 p1 = p_Mult_q(KK,p1,r); // p1 = k'(r_f + d^{gamma-alpha} t_f) 461 462 // c'(r_f + d^{gamma-beta} t_g) 463 464 p2 = p_Mult_q(m2, p2, r); // p2 = d^{gamma-beta} t_g 465 p2 = p_Add_q(p2,HG,r); // p2 = r_g + d^{gamma-beta} t_g 466 p2 = p_Mult_q(CC,p2,r); // p2 = c'(r_g + d^{gamma-beta} t_g) 467 468 #ifdef PDEBUG 469 p_Test(p1,r); 470 p_Test(p2,r); 471 PrintS(" k'(r_f + d^{gamma-alpha} t_f): "); p_wrp(p1,r); 472 PrintS(" c'(r_g + d^{gamma-beta} t_g): "); p_wrp(p2,r); 473 #endif 474 475 poly out = p_Add_q(p1,p2,r); // delete p1, p2; // the sum 476 477 #ifdef PDEBUG 478 p_Test(out,r); 479 #endif 480 481 if ( out!=NULL ) pContent(out); 482 return(out); 483 } 484 485 368 486 /*2 369 487 * reduction of p2 with p1
Note: See TracChangeset
for help on using the changeset viewer.