Changeset 34183a in git
- Timestamp:
- Jul 7, 2016, 3:08:59 PM (7 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- a1299c28602fe2bb5ab848f4dd82bb5d10a66412c66a53f1b58e7f846551ad48a7866b06bf852f5fcd79608c61d713b22b8e9ae861168cbd02e4fab9
- Parents:
- 382febc4b9c1d345489e23122c487898797e979d
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/flip.cc
r382feb r34183a 68 68 /* compute initial ideal and map it to the new ordering */ 69 69 ideal inIr = initial(I,r,interiorPoint); 70 int k = idSize(I); ideal inIsAdjusted = idInit(k);70 int k = IDELEMS(I); ideal inIsAdjusted = idInit(k); 71 71 for (int i=0; i<k; i++) 72 inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0); 72 { 73 if (inIr->m[i]!=NULL) 74 { 75 inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0); 76 } 77 } 73 78 id_Delete(&inIr,r); 74 79 … … 104 109 rTest(s); 105 110 identity = n_SetMap(sAdjusted->cf,s->cf); 106 k = idSize(IsAdjustedGB); ideal IsGB = idInit(k);111 k = IDELEMS(IsAdjustedGB); ideal IsGB = idInit(k); 107 112 for (int i=0; i<k; i++) 108 IsGB->m[i] = p_PermPoly(IsAdjustedGB->m[i],NULL,sAdjusted,s,identity,NULL,0); 113 { 114 if (IsAdjustedGB->m[i]!=NULL) 115 { 116 IsGB->m[i] = p_PermPoly(IsAdjustedGB->m[i],NULL,sAdjusted,s,identity,NULL,0); 117 } 118 } 109 119 id_Delete(&IsAdjustedGB,sAdjusted); 110 120 rDelete(sAdjusted); -
Singular/dyn_modules/gfanlib/groebnerComplex.cc
r382feb r34183a 31 31 number p = (number) v->Data(); 32 32 tropicalStrategy currentStrategy(I,p,currRing); 33 if ( idSize(I)==1)33 if ((I->m[0]!=NULL) && (idElem(I)==1)) 34 34 { 35 35 try -
Singular/dyn_modules/gfanlib/groebnerCone.cc
r382feb r34183a 143 143 gfan::ZVector tailexpw = gfan::ZVector(n); 144 144 gfan::ZMatrix inequalities = gfan::ZMatrix(0,n); 145 for (int i=0; i< idSize(polynomialIdeal); i++)145 for (int i=0; i<IDELEMS(polynomialIdeal); i++) 146 146 { 147 147 g = polynomialIdeal->m[i]; … … 193 193 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 194 194 int* expv = (int*) omAlloc((n+1)*sizeof(int)); 195 for (int i=0; i< idSize(polynomialIdeal); i++)195 for (int i=0; i<IDELEMS(polynomialIdeal); i++) 196 196 { 197 197 poly g = polynomialIdeal->m[i]; … … 251 251 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 252 252 int* expv = (int*) omAlloc((n+1)*sizeof(int)); 253 for (int i=0; i< idSize(polynomialIdeal); i++)253 for (int i=0; i<IDELEMS(polynomialIdeal); i++) 254 254 { 255 255 poly g = polynomialIdeal->m[i]; … … 303 303 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 304 304 int* expv = (int*) omAlloc((n+1)*sizeof(int)); 305 for (int i=0; i< idSize(inI); i++)305 for (int i=0; i<IDELEMS(inI); i++) 306 306 { 307 307 poly g = inI->m[i]; … … 319 319 } 320 320 gfan::ZMatrix inequalities = gfan::ZMatrix(0,n); 321 for (int i=0; i< idSize(polynomialIdeal); i++)321 for (int i=0; i<IDELEMS(polynomialIdeal); i++) 322 322 { 323 323 poly g = polynomialIdeal->m[i]; -
Singular/dyn_modules/gfanlib/groebnerFan.cc
r382feb r34183a 93 93 if (v==NULL) 94 94 { 95 if ( idSize(I)==1)95 if ((I->m[0]!=NULL) && (idElem(I)==1)) 96 96 { 97 97 try -
Singular/dyn_modules/gfanlib/initial.cc
r382feb r34183a 60 60 ideal initial(const ideal I, const ring r, const gfan::ZVector w) 61 61 { 62 int k = idSize(I); ideal inI = idInit(k);62 int k = IDELEMS(I); ideal inI = idInit(k); 63 63 for (int i=0; i<k; i++) 64 64 inI->m[i] = initial(I->m[i],r,w); … … 96 96 ideal initial(const ideal I, const ring r, const gfan::ZVector w, const gfan::ZMatrix W) 97 97 { 98 int k = idSize(I); ideal inI = idInit(k);98 int k = IDELEMS(I); ideal inI = idInit(k); 99 99 for (int i=0; i<k; i++) 100 100 inI->m[i] = initial(I->m[i],r,w,W); … … 144 144 { 145 145 ideal I = *IStar; 146 int k = idSize(I);146 int k = IDELEMS(I); 147 147 for (int i=0; i<k; i++) 148 148 initial(&I->m[i],r,w); … … 192 192 { 193 193 ideal I = *IStar; 194 int k = idSize(I);194 int k = IDELEMS(I); 195 195 for (int i=0; i<k; i++) 196 196 initial(&I->m[i],r,w,W); -
Singular/dyn_modules/gfanlib/lift.cc
r382feb r34183a 12 12 // { 13 13 // nMapFunc identity = n_SetMap(r->cf,s->cf); 14 // int k = idSize(I); ideal Is = idInit(k);14 // int k = IDELEMS(I); ideal Is = idInit(k); 15 15 // for (int i=0; i<k; i++) 16 16 // Is->m[i] = p_PermPoly(I->m[i],NULL,r,s,identity,NULL,0); … … 25 25 { 26 26 nMapFunc identity = n_SetMap(s->cf,r->cf); 27 int k = idSize(inI); ideal inIr = idInit(k);27 int k = IDELEMS(inI); ideal inIr = idInit(k); 28 28 for (int i=0; i<k; i++) 29 inIr->m[i] = p_PermPoly(inI->m[i],NULL,s,r,identity,NULL,0); 29 { 30 if(inI->m[i]!=NULL) 31 { 32 inIr->m[i] = p_PermPoly(inI->m[i],NULL,s,r,identity,NULL,0); 33 } 34 } 30 35 ideal Ir = witness(inIr,J,r); 31 36 … … 33 38 ideal Is = idInit(k); 34 39 for (int i=0; i<k; i++) 35 Is->m[i] = p_PermPoly(Ir->m[i],NULL,r,s,identity,NULL,0); 40 { 41 if(Ir->m[i]!=NULL) 42 { 43 Is->m[i] = p_PermPoly(Ir->m[i],NULL,r,s,identity,NULL,0); 44 } 45 } 36 46 37 47 id_Delete(&inIr,r); -
Singular/dyn_modules/gfanlib/ppinitialReduction.cc
r382feb r34183a 245 245 void ptNormalize(ideal I, const number p, const ring r) 246 246 { 247 for (int i=0; i< idSize(I); i++)247 for (int i=0; i<IDELEMS(I); i++) 248 248 ptNormalize(&(I->m[i]),p,r); 249 249 return; … … 301 301 void pReduce(ideal &I, const number p, const ring r) 302 302 { 303 int k = idSize(I);303 int k = IDELEMS(I); 304 304 for (int i=0; i<k; i++) 305 305 { … … 311 311 } 312 312 } 313 return;314 313 } 315 314 … … 395 394 bool ppreduceInitially(ideal I, const number p, const ring r) 396 395 { 397 int m=idSize(I),n=m; poly cache; 396 idSkipZeroes(I); 397 int m=IDELEMS(I),n=m; poly cache; 398 398 do 399 399 { … … 401 401 for (int i=1; i<n; i++) 402 402 { 403 if (p_LmCmp(I->m[i-1],I->m[i],r)<0) 403 if (p_LmCmp(I->m[i-1],I->m[i],r)<0) /*p_LmCmp(p,q): requires: p,q!=NULL*/ 404 404 { 405 405 cache=I->m[i-1]; … … 481 481 p_Test(g,r); 482 482 idInsertPoly(I,g); 483 int n=idSize(I); 483 idSkipZeroes(I); 484 int n=IDELEMS(I); 484 485 int j; 485 486 for (j=n-1; j>0; j--) 486 487 { 487 if (p_LmCmp(I->m[j], I->m[j-1],r)>0) 488 if (p_LmCmp(I->m[j], I->m[j-1],r)>0) /*p_LmCmp(p,q) requires: p,q!=NULL */ 488 489 { 489 490 poly cache = I->m[j]; … … 666 667 * T is sorted by the ordering on the temrs the pairs correspond to. 667 668 **/ 668 int m= idSize(H);669 int m=IDELEMS(H); 669 670 ideal I = idInit(m); 670 671 std::vector<mark> T; 671 672 for (int i=0; i<m; i++) 672 673 { 673 I->m[i]=H->m[i]; 674 if (pNext(I->m[i])!=NULL) 675 T.push_back(std::pair<int,int>(i,1)); 674 if(H->m[i]!=NULL) 675 { 676 I->m[i]=H->m[i]; 677 if (pNext(I->m[i])!=NULL) 678 T.push_back(std::pair<int,int>(i,1)); 679 } 676 680 } 677 681 … … 680 684 * by adding suitable elements to I and reducing it initially with respect to itself 681 685 **/ 682 int k= idSize(G);686 int k=IDELEMS(G); 683 687 while (T.size()>0) 684 688 { 685 689 sortMarks(I,r,T); 686 int i=0; for (; i<k; i++) 687 if (p_LeadmonomDivisibleBy(G->m[i],getTerm(I,T[0]),r)) break; 690 int i=0; 691 for (; i<k; i++) 692 { 693 if(G->m[i]!=NULL) 694 { 695 if (p_LeadmonomDivisibleBy(G->m[i],getTerm(I,T[0]),r)) break; 696 } 697 } 688 698 if (i<k) 689 699 { … … 705 715 * Step 4: cleanup, delete all polynomials in I which have been added in Step 3 706 716 **/ 707 k= idSize(I);717 k=IDELEMS(I); 708 718 for (int i=0; i<k; i++) 709 719 { 710 for (int j=0; j<m; j++) 711 { 712 if (p_LeadmonomDivisibleBy(H->m[j],I->m[i],r)) 713 { 714 I->m[i]=NULL; 715 break; 720 if(I->m[i]!=NULL) 721 { 722 for (int j=0; j<m; j++) 723 { 724 if ((H->m[j]!=NULL) 725 && (p_LeadmonomDivisibleBy(H->m[j],I->m[i],r))) 726 { 727 I->m[i]=NULL; 728 break; 729 } 716 730 } 717 731 } … … 765 779 * the lowest component should only contain p-t 766 780 **/ 767 std::map<long,ideal> H; int n = idSize(I);781 std::map<long,ideal> H; int n = IDELEMS(I); 768 782 for (int i=0; i<n; i++) 769 783 { 770 I->m[i] = p_Cleardenom(I->m[i],r); 771 long d = 0; 772 for (int j=2; j<=r->N; j++) 773 d += p_GetExp(I->m[i],j,r); 774 std::map<long,ideal>::iterator it = H.find(d); 775 if (it != H.end()) 776 idInsertPoly(it->second,I->m[i]); 777 else 778 { 779 std::pair<long,ideal> Hd(d,idInit(1)); 780 Hd.second->m[0] = I->m[i]; 781 H.insert(Hd); 784 if(I->m[i]!=NULL) 785 { 786 I->m[i] = p_Cleardenom(I->m[i],r); 787 long d = 0; 788 for (int j=2; j<=r->N; j++) 789 d += p_GetExp(I->m[i],j,r); 790 std::map<long,ideal>::iterator it = H.find(d); 791 if (it != H.end()) 792 idInsertPoly(it->second,I->m[i]); 793 else 794 { 795 std::pair<long,ideal> Hd(d,idInit(1)); 796 Hd.second->m[0] = I->m[i]; 797 H.insert(Hd); 798 } 782 799 } 783 800 } … … 794 811 **/ 795 812 if (ppreduceInitially(Hi,p,r)) return true; 813 idSkipZeroes(Hi); 796 814 id_Test(Hi,r); 797 815 id_Test(I,r); … … 803 821 for (it++; it!=H.end(); it++) 804 822 { 805 int l= idSize(Hi); int k=l; poly cache;823 int l=IDELEMS(Hi); int k=l; poly cache; 806 824 /** 807 825 * sorts Hi according to degree in t in descending order -
Singular/dyn_modules/gfanlib/startingCone.cc
r382feb r34183a 119 119 { 120 120 ideal I = (ideal) u->Data(); 121 if ( idSize(I)==1)121 if ((I->m[0]!=NULL) && (idElem(I)==1)) 122 122 { 123 123 tropicalStrategy currentStrategy(I,currRing); … … 154 154 { 155 155 ideal I = (ideal) u->Data(); 156 if ( idSize(I)==1)156 if ((I->m[0]!=NULL) && (idElem(I)==1)) 157 157 { 158 158 tropicalStrategy currentStrategy(I,currRing); … … 189 189 { 190 190 ideal I = (ideal) u->Data(); 191 if ( idSize(I)==1)191 if ((I->m[0]!=NULL) && (idElem(I)==1)) 192 192 { 193 193 tropicalStrategy currentStrategy(I,currRing); … … 225 225 { 226 226 ideal I = (ideal) u->Data(); 227 if ( idSize(I)==1)227 if ((I->m[0]!=NULL) && (idElem(I)==1)) 228 228 { 229 229 tropicalStrategy currentStrategy(I,currRing); … … 262 262 ideal I = (ideal) u->Data(); 263 263 tropicalStrategy currentStrategy(I,currRing); 264 if ( idSize(I)==1)264 if ((I->m[0]!=NULL) && (idElem(I)==1)) 265 265 { 266 266 poly g = I->m[0]; … … 311 311 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 312 312 int* expv = (int*) omAlloc((n+1)*sizeof(int)); 313 int k = idSize(I);313 int k = IDELEMS(I); 314 314 for (int i=0; i<k; i++) 315 315 { … … 344 344 // inI <- I 345 345 ring s = rCopy(r); 346 int k = idSize(I); ideal inI = idInit(k);346 int k = IDELEMS(I); ideal inI = idInit(k); 347 347 nMapFunc identityMap = n_SetMap(r->cf,s->cf); 348 348 for (int i=0; i<k; i++) 349 inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0); 349 { 350 if(I->m[i]!=NULL) 351 { 352 inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0); 353 } 354 } 350 355 351 356 // repeatedly computes a point in the tropical variety outside the lineality space, … … 408 413 // inJ <- I 409 414 ring s = rCopy(r); 410 int k = idSize(I); ideal inJ = idInit(k);415 int k = IDELEMS(I); ideal inJ = idInit(k); 411 416 nMapFunc identityMap = n_SetMap(r->cf,s->cf); 412 417 for (int i=0; i<k; i++) 413 inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0); 418 { 419 if(I->m[i]!=NULL) 420 { 421 inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0); 422 } 423 } 414 424 415 425 // and check whether the dimension of its homogeneity space … … 464 474 rComplete(rShortcut); 465 475 rTest(rShortcut); 466 k = idSize(inJ);476 k = IDELEMS(inJ); 467 477 ideal inJShortcut = idInit(k); 468 478 nMapFunc takingResidues = n_SetMap(s->cf,rShortcut->cf); 469 479 for (int i=0; i<k; i++) 470 inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0); 480 { 481 if(inJ->m[i]!=NULL) 482 { 483 inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0); 484 } 485 } 471 486 idSkipZeroes(inJShortcut); 472 487 id_Delete(&inJ,s); … … 496 511 rTest(s); 497 512 498 k = idSize(inJShortcut); // inJ will be overwritten with initial of inJ513 k = IDELEMS(inJShortcut); // inJ will be overwritten with initial of inJ 499 514 inJ = idInit(k+1); 500 515 inJ->m[0] = p_One(s); // with respect to that weight … … 503 518 nMapFunc findingRepresentatives = n_SetMap(sShortcut->cf,s->cf); 504 519 for (int i=0; i<k; i++) // and then come the rest 505 inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0); 520 { 521 if(inJShortcut->m[i]!=NULL) 522 { 523 inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0); 524 } 525 } 506 526 507 527 ideal J = currentStrategy.computeLift(inJ,s,inI,I,r); -
Singular/dyn_modules/gfanlib/tropical.cc
r382feb r34183a 164 164 165 165 gfan::ZMatrix inequalities = gfan::ZMatrix(0,n); 166 for (int i=0; i< idSize(I); i++)166 for (int i=0; i<IDELEMS(I); i++) 167 167 { 168 168 g = (poly) I->m[i]; … … 184 184 ideal inI = initial(I,currRing,w); 185 185 gfan::ZMatrix equations = gfan::ZMatrix(0,n); 186 for (int i=0; i< idSize(I); i++)186 for (int i=0; i<IDELEMS(I); i++) 187 187 { 188 188 g = (poly) inI->m[i]; -
Singular/dyn_modules/gfanlib/tropicalCurves.cc
r382feb r34183a 117 117 const tropicalStrategy* currentStrategy) 118 118 { 119 int k = idSize(inI);119 int k = IDELEMS(inI); 120 120 int d = currentStrategy->getExpectedDimension(); 121 121 … … 124 124 ZConesSortedByDimension C = tropicalVarietySortedByDimension(inI->m[0],r,currentStrategy); 125 125 for (int i=1; i<k; i++) 126 C = intersect(C,tropicalVarietySortedByDimension(inI->m[i],r,currentStrategy),d); 126 { 127 if(inI->m[i]!=NULL) 128 { 129 C = intersect(C,tropicalVarietySortedByDimension(inI->m[i],r,currentStrategy),d); 130 } 131 } 127 132 128 133 /* Cycle through all maximal cones of the refinement. -
Singular/dyn_modules/gfanlib/tropicalStrategy.cc
r382feb r34183a 48 48 static void swapElements(ideal I, ideal J) 49 49 { 50 assume( idSize(I)==idSize(J));51 52 for (int i= idSize(I)-1; i>=0; i--)50 assume(IDELEMS(I)==IDELEMS(J)); 51 52 for (int i=IDELEMS(I)-1; i>=0; i--) 53 53 { 54 54 poly cache = I->m[i]; … … 97 97 omFree(wvhdl); 98 98 99 int k = idSize(I);99 int k = IDELEMS(I); 100 100 ideal IShortcut = idInit(k); 101 101 nMapFunc intoShortcut = n_SetMap(r->cf,rShortcut->cf); 102 102 for (int i=0; i<k; i++) 103 IShortcut->m[i] = p_PermPoly(I->m[i],NULL,r,rShortcut,intoShortcut,NULL,0); 103 { 104 if(I->m[i]!=NULL) 105 { 106 IShortcut->m[i] = p_PermPoly(I->m[i],NULL,r,rShortcut,intoShortcut,NULL,0); 107 } 108 } 104 109 105 110 ideal JShortcut = gfanlib_kStd_wrapper(IShortcut,rShortcut); … … 226 231 227 232 // map originalIdeal from originalRing into startingRing 228 int k = idSize(originalIdeal);233 int k = IDELEMS(originalIdeal); 229 234 ideal J = idInit(k+1); 230 235 nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf); … … 234 239 shiftByOne[i]=i+1; 235 240 for (int i=0; i<k; i++) 236 J->m[i] = p_PermPoly(originalIdeal->m[i],shiftByOne,originalRing,startingRing,nMap,NULL,0); 241 { 242 if(originalIdeal->m[i]!=NULL) 243 { 244 J->m[i] = p_PermPoly(originalIdeal->m[i],shiftByOne,originalRing,startingRing,nMap,NULL,0); 245 } 246 } 237 247 omFreeSize(shiftByOne,(n+1)*sizeof(int)); 238 248 … … 375 385 poly pt = p_Add_q(p,p_Neg(t,r),r); 376 386 377 int k = idSize(I);387 int k = IDELEMS(I); 378 388 int l; 379 389 for (l=0; l<k; l++) … … 476 486 { 477 487 // quick check whether I already contains an ideal 478 int k = idSize(I);488 int k = IDELEMS(I); 479 489 for (int i=0; i<k; i++) 480 490 { 481 491 poly g = I->m[i]; 482 if (pNext(g)==NULL && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf))) 492 if (g!=NULL 493 && pNext(g)==NULL 494 && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf))) 483 495 return std::pair<poly,int>(g,i); 484 496 } … … 553 565 else 554 566 { 555 assume( idSize(inI)==idSize(I));567 assume(IDELEMS(inI)==IDELEMS(I)); 556 568 int uni = findPositionOfUniformizingBinomial(I,r); 557 569 assume(uni>=0); … … 562 574 ring rShortcut = copyAndChangeCoefficientRing(r); 563 575 564 int k = idSize(inJ);565 int l = idSize(I);576 int k = IDELEMS(inJ); 577 int l = IDELEMS(I); 566 578 ideal inJShortcut = idInit(k); 567 579 ideal inIShortcut = idInit(l); … … 634 646 ring rShortcut = copyAndChangeCoefficientRing(r); 635 647 nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf); 636 int k = idSize(inI);648 int k = IDELEMS(inI); 637 649 ideal inIShortcut = idInit(k); 638 650 for (int i=0; i<k; i++) … … 642 654 // and lift the result back to the ring with valuation 643 655 nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf); 644 k = idSize(inJShortcut);656 k = IDELEMS(inJShortcut); 645 657 ideal inJ = idInit(k+1); 646 658 inJ->m[0] = p_One(r); … … 658 670 ideal tropicalStrategy::computeLift(const ideal inJs, const ring s, const ideal inIr, const ideal Ir, const ring r) const 659 671 { 660 int k = idSize(inJs);672 int k = IDELEMS(inJs); 661 673 ideal inJr = idInit(k); 662 674 nMapFunc identitysr = n_SetMap(s->cf,r->cf); … … 765 777 ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal); 766 778 nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf); 767 int k = idSize(Ir);779 int k = IDELEMS(Ir); 768 780 ideal inIsAdjusted = idInit(k); 769 781 for (int i=0; i<k; i++) … … 773 785 // find witnesses of the new standard basis elements of the initial ideal 774 786 // with the help of the old standard basis of the ideal 775 k = idSize(inJsAdjusted);787 k = IDELEMS(inJsAdjusted); 776 788 ideal inJr = idInit(k); 777 789 identity = n_SetMap(sAdjusted->cf,r->cf); … … 816 828 poly pt = p_Add_q(p,p_Neg(t,r),r); 817 829 818 for (int i=0; i< idSize(I); i++)830 for (int i=0; i<IDELEMS(I); i++) 819 831 { 820 832 if (p_EqualPolys(I->m[i],pt,r)) … … 841 853 poly pt = p_Add_q(p,p_Neg(t,r),r); 842 854 843 for (int i=0; i< idSize(I); i++)855 for (int i=0; i<IDELEMS(I); i++) 844 856 { 845 857 if (p_EqualPolys(I->m[i],pt,r)) … … 867 879 p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r); 868 880 869 for (int i=0; i< idSize(inI); i++)881 for (int i=0; i<IDELEMS(inI); i++) 870 882 { 871 883 if (p_EqualPolys(inI->m[i],p,r)) -
Singular/dyn_modules/gfanlib/tropicalStrategy.h
r382feb r34183a 5 5 #include <gfanlib/gfanlib_zcone.h> 6 6 #include <polys/simpleideals.h> 7 #include <kernel/ideals.h> // for id Size7 #include <kernel/ideals.h> // for idElem 8 8 #include <set> 9 9 #include <callgfanlib_conversion.h> -
Singular/dyn_modules/gfanlib/tropicalVariety.cc
r382feb r34183a 100 100 leftv v = u->next; 101 101 102 if ( idSize(I)==1)102 if ((I->m[0]!=NULL) && (idElem(I)==1)) 103 103 { 104 104 poly g = I->m[0]; -
Singular/dyn_modules/gfanlib/witness.cc
r382feb r34183a 34 34 poly witness(const poly m, const ideal I, const ideal inI, const ring r) 35 35 { 36 assume( idSize(I)==idSize(inI));36 assume(IDELEMS(I)==IDELEMS(inI)); 37 37 matrix Q = divisionDiscardingRemainder(m,inI,r); 38 38 39 int k = idSize(I);39 int k = IDELEMS(I); 40 40 poly f = p_Mult_q(p_Copy(I->m[0],r),Q->m[0],r); 41 41 Q->m[0] = NULL; … … 59 59 rChangeCurrRing(origin); 60 60 61 int k = idSize(inI);61 int k = IDELEMS(inI); 62 62 ideal I = idInit(k); 63 63 for (int i=0; i<k; i++) -
Singular/dyn_modules/syzextra/mod_main.cc
r382feb r34183a 401 401 { \ 402 402 /* const ring rrr = (iLevel > 0) ? save : save; */ \ 403 Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \403 Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, IDELEMS(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \ 404 404 PrintLn(); \ 405 405 } \ -
Singular/iparith.cc
r382feb r34183a 4080 4080 //Anne's Idea for std(4,2x) = 0 bug 4081 4081 long dcurr = d; 4082 for(i=0;i< idSize(vv);i++)4082 for(i=0;i<IDELEMS(vv);i++) 4083 4083 { 4084 4084 if(vv->m[i] != NULL && !n_IsUnit(pGetCoeff(vv->m[i]),currRing->cf)) … … 4088 4088 pSetCoeff0(c,nCopy(pGetCoeff(vv->m[i]))); 4089 4089 idInsertPoly(vc,c); 4090 for(j = 0;j<idSize(vc)-1;j++) 4090 idSkipZeroes(vc); 4091 for(j = 0;j<IDELEMS(vc)-1;j++) 4091 4092 { 4092 if(n_DivBy(pGetCoeff(vc->m[j]),pGetCoeff(c),currRing->cf)) 4093 if((vc->m[j]!=NULL) 4094 && (n_DivBy(pGetCoeff(vc->m[j]),pGetCoeff(c),currRing->cf))) 4093 4095 { 4094 4096 pDelete(&vc->m[j]); -
kernel/GBEngine/nc.cc
r382feb r34183a 306 306 h2->m[j]=0; 307 307 } 308 // W[1.. idElems(I)]308 // W[1..IDELEMS(I)] 309 309 if (flag >0) 310 310 { -
kernel/GBEngine/syz1.cc
r382feb r34183a 1992 1992 while ((k<syzstr->length) && (rr[k]!=NULL)) 1993 1993 { 1994 (*resolution)[k+1] = id Size(rr[k]);1994 (*resolution)[k+1] = idElem(rr[k]); 1995 1995 k++; 1996 1996 } -
kernel/ideals.h
r382feb r34183a 38 38 //int id_PosConstant(ideal id, const ring r) 39 39 #define idPosConstant(I) id_PosConstant(I,currRing) 40 41 /// Count the effective size of an ideal42 /// (without the trailing allocated zero-elements)43 /// deprecated! (use IDELEMS)44 static inline int idSize(const ideal id)45 {46 int j = IDELEMS(id) - 1;47 poly* mm = id->m;48 while ((j >= 0) && (mm[j] == NULL)) j--;49 return (j + 1);50 }51 52 40 53 41 //BOOLEAN id_IsConstant(ideal id, const ring r); -
libpolys/polys/simpleideals.cc
r382feb r34183a 210 210 assume (F != NULL); 211 211 212 int i=0 ,j=IDELEMS(F)-1;213 214 while(j>=0)212 int i=0; 213 214 for(int j=IDELEMS(F)-1;j>=0;j--) 215 215 { 216 216 if ((F->m)[j]!=NULL) i++; 217 j--;218 217 } 219 218 return i;
Note: See TracChangeset
for help on using the changeset viewer.