Changeset f9591a in git
- Timestamp:
- Aug 3, 2011, 3:52:14 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 567abae6e8087f803d5e7dc28c7fda93123381ce
- Parents:
- 79ea4809aa81094eb116bd40570e1ef79259ab31
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-08-03 15:52:14+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:14:17+01:00
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ideals.cc
r79ea48 rf9591a 696 696 { 697 697 if (p_MinComp(s_h3->m[j],syz_ring) > k) 698 p_Shift(&s_h3->m[j], -k, currRing);698 p_Shift(&s_h3->m[j], -k,syz_ring); 699 699 else 700 p Delete(&s_h3->m[j]);700 p_Delete(&s_h3->m[j],syz_ring); 701 701 } 702 702 } … … 727 727 e->m[j] = s_h3->m[j]; 728 728 isMonomial=isMonomial && (pNext(s_h3->m[j])==NULL); 729 p Delete(&pNext(s_h3->m[j]));729 p_Delete(&pNext(s_h3->m[j]),syz_ring); 730 730 s_h3->m[j] = NULL; 731 731 } … … 918 918 } 919 919 else 920 p Delete(&(s_h3->m[j]));920 p_Delete(&(s_h3->m[j]),currRing); 921 921 } 922 922 } … … 1099 1099 { 1100 1100 if ((s_h3->m[j] != NULL) && (pMinComp(s_h3->m[j]) > k)) 1101 p Delete(&(s_h3->m[j]));1101 p_Delete(&(s_h3->m[j]),currRing); 1102 1102 } 1103 1103 } … … 1265 1265 pNormalize(p); 1266 1266 if((w==NULL)&&(pDeg(p0)>n)||(w!=NULL)&&(pDegW(p0,w)>n)) 1267 p Delete(&p0);1267 p_Delete(&p0,currRing); 1268 1268 else 1269 1269 MATELEM(T,j+1,i+1)=pAdd(MATELEM(T,j+1,i+1),p0); … … 1279 1279 if(((w==NULL)&&(pDeg(p0)>n)) 1280 1280 ||((w!=NULL)&&(pDegW(p0,w)>n))) 1281 p Delete(&p0);1281 p_Delete(&p0,currRing); 1282 1282 else 1283 1283 R->m[i]=pAdd(R->m[i],p0); … … 1476 1476 } 1477 1477 else 1478 p Delete(&s_h3->m[i]);1478 p_Delete(&s_h3->m[i],currRing); 1479 1479 } 1480 1480 if (resultIsIdeal) … … 1782 1782 q = p; 1783 1783 p = kNF(R,currQuotient,q); 1784 p Delete(&q);1784 p_Delete(&q,currRing); 1785 1785 } 1786 1786 /*delete the matrix tmp*/ … … 1846 1846 q = p; 1847 1847 p = kNF(R,currQuotient,q); 1848 p Delete(&q);1848 p_Delete(&q,currRing); 1849 1849 } 1850 1850 if (p!=NULL) … … 1952 1952 if (p != NULL) 1953 1953 { 1954 p Delete(&p);1954 p_Delete(&p,currRing); 1955 1955 return FALSE; 1956 1956 } … … 2219 2219 && (pGetComp(s_temp1->m[i])<=length)) 2220 2220 { 2221 p Delete(&(s_temp1->m[i]));2221 p_Delete(&(s_temp1->m[i]),currRing); 2222 2222 } 2223 2223 else … … 2342 2342 *pos = idIndexOfKBase(base,kbase); 2343 2343 if (*pos<0) 2344 p Delete(&coeff);2345 p Delete(&base);2344 p_Delete(&coeff,currRing); 2345 p_Delete(&base,currRing); 2346 2346 return coeff; 2347 2347 } … … 2383 2383 } 2384 2384 else 2385 p Delete(&q);2385 p_Delete(&q,currRing); 2386 2386 pIter(p); 2387 2387 } … … 2470 2470 idDelete(&S); 2471 2471 poly gcd_p=singclap_pdivide(f,gg,r); 2472 p Delete(&gg);2472 p_Delete(&gg,r); 2473 2473 rChangeCurrRing(save_r); 2474 2474 return gcd_p; … … 2484 2484 */ 2485 2485 #ifdef HAVE_FACTORY 2486 ideal id ChineseRemainder(ideal *xx, number *q, int rl)2486 ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring R) 2487 2487 { 2488 2488 int cnt=IDELEMS(xx[0])*xx[0]->nrows; … … 2503 2503 h=xx[j]->m[i]; 2504 2504 if ((h!=NULL) 2505 &&((r==NULL)||(p LmCmp(r,h)==-1)))2505 &&((r==NULL)||(p_LmCmp(r,h,R)==-1))) 2506 2506 r=h; 2507 2507 } 2508 2508 if (r==NULL) break; 2509 h=p Head(r);2509 h=p_Head(r,R); 2510 2510 for(j=rl-1;j>=0;j--) 2511 2511 { 2512 2512 hh=xx[j]->m[i]; 2513 if ((hh!=NULL) && (p LmCmp(r,hh)==0))2513 if ((hh!=NULL) && (p_LmCmp(r,hh,R)==0)) 2514 2514 { 2515 2515 x[j]=pGetCoeff(hh); 2516 hh=p LmFreeAndNext(hh);2516 hh=p_LmFreeAndNext(hh,R); 2517 2517 xx[j]->m[i]=hh; 2518 2518 } 2519 2519 else 2520 x[j]=n lInit(0, currRing);2521 } 2522 number n=n lChineseRemainder(x,q,rl);2520 x[j]=n_Init(0, R->cf); 2521 } 2522 number n=n_ChineseRemainder(x,q,rl,R->cf); 2523 2523 for(j=rl-1;j>=0;j--) 2524 2524 { 2525 2525 x[j]=NULL; // nlInit(0...) takes no memory 2526 2526 } 2527 if (n lIsZero(n)) pDelete(&h);2527 if (n_IsZero(n,R->cf)) p_Delete(&h,R); 2528 2528 else 2529 2529 { 2530 p SetCoeff(h,n);2530 p_SetCoeff(h,n,R); 2531 2531 //Print("new mon:");pWrite(h); 2532 res_p=p Add(res_p,h);2532 res_p=p_Add_q(res_p,h,R); 2533 2533 } 2534 2534 } … … 2536 2536 } 2537 2537 omFree(x); 2538 for(i=rl-1;i>=0;i--) id Delete(&(xx[i]));2538 for(i=rl-1;i>=0;i--) id_Delete(&(xx[i]),R); 2539 2539 omFree(xx); 2540 2540 return result; … … 2557 2557 * lift ideal with coeffs over Z (mod N) to Q via Farey 2558 2558 */ 2559 ideal id Farey(ideal x, number N)2559 ideal id_Farey(ideal x, number N, const ring r) 2560 2560 { 2561 2561 int cnt=IDELEMS(x)*x->nrows; … … 2567 2567 for(i=cnt-1;i>=0;i--) 2568 2568 { 2569 poly h=p Copy(x->m[i]);2569 poly h=p_Copy(x->m[i],r); 2570 2570 result->m[i]=h; 2571 2571 while(h!=NULL) 2572 2572 { 2573 2573 number c=pGetCoeff(h); 2574 pSetCoeff0(h,n lFarey(c,N));2575 n Delete(&c);2574 pSetCoeff0(h,n_Farey(c,N,r->cf)); 2575 n_Delete(&c,r->cf); 2576 2576 pIter(h); 2577 2577 } 2578 while((result->m[i]!=NULL)&&(n IsZero(pGetCoeff(result->m[i]))))2579 { 2580 p LmDelete(&(result->m[i]));2578 while((result->m[i]!=NULL)&&(n_IsZero(pGetCoeff(result->m[i]),r->cf))) 2579 { 2580 p_LmDelete(&(result->m[i]),r); 2581 2581 } 2582 2582 h=result->m[i]; 2583 2583 while((h!=NULL) && (pNext(h)!=NULL)) 2584 2584 { 2585 if(n IsZero(pGetCoeff(pNext(h))))2586 { 2587 p LmDelete(&pNext(h));2585 if(n_IsZero(pGetCoeff(pNext(h)),r->cf)) 2586 { 2587 p_LmDelete(&pNext(h),r); 2588 2588 } 2589 2589 else pIter(h); -
kernel/ideals.h
r79ea48 rf9591a 188 188 poly id_GCD(poly f, poly g, const ring r); 189 189 190 ideal id ChineseRemainder(ideal *x, number *q, int rl);190 ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R); 191 191 //ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */ 192 ideal id Farey(ideal x, number N);192 ideal id_Farey(ideal x, number N, const ring r); 193 193 194 194 ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG -
libpolys/coeffs/coeffs.h
r79ea48 rf9591a 566 566 } 567 567 568 static inline number n_ farey(number a, number b, const coeffs r)568 static inline number n_Farey(number a, number b, const coeffs r) 569 569 { 570 570 assume(r != NULL);
Note: See TracChangeset
for help on using the changeset viewer.