Changeset 1f637e in git
- Timestamp:
- Jul 19, 2011, 5:11:57 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 1c4e9a5798bda4bc92d0013041b99005a50a7d7c
- Parents:
- 6ed8c424bfe6fd9dc397bfdde3e8acf884469342
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-07-19 17:11:57+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:52:40+01:00
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/fast_mult.cc
r6ed8c4 r1f637e 441 441 n_Delete(&y,r); 442 442 p_SetCoeff0(p,x,r); 443 //for (i= pVariables; i!=0; i--)443 //for (i=(currRing->N); i!=0; i--) 444 444 //{ 445 445 // pAddExp(p,i, pGetExp(q,i)); -
kernel/fglmcomb.cc
r6ed8c4 r1f637e 99 99 100 100 poly m = pOne(); 101 for ( i= pVariables; i > 0; i-- )101 for ( i= (currRing->N); i > 0; i-- ) 102 102 { 103 103 diff= pGetExp( *pptr, i ) - pGetExp( p2, i ); -
kernel/fglmhom.cc
r6ed8c4 r1f637e 139 139 generateMonoms( poly m, int var, int deg, homogData * dat ) 140 140 { 141 if ( var == pVariables) {141 if ( var == (currRing->N) ) { 142 142 BOOLEAN inSource = FALSE; 143 143 BOOLEAN inDest = FALSE; -
kernel/fglmzero.cc
r6ed8c4 r1f637e 310 310 fglmSelem::fglmSelem( poly p, int var ) : monom( p ), numVars( 0 ) 311 311 { 312 for ( int k = pVariables; k > 0; k-- )312 for ( int k = (currRing->N); k > 0; k-- ) 313 313 if ( pGetExp( monom, k ) > 0 ) 314 314 numVars++; … … 367 367 theIdeal= thisIdeal; 368 368 idelems= IDELEMS( theIdeal ); 369 varpermutation = (int*)omAlloc( ( pVariables+1)*sizeof(int) );369 varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) ); 370 370 // Sort ring variables by increasing values (because of weighted orderings) 371 371 ideal perm = idMaxIdeal(1); 372 372 intvec *iv = idSort(perm,TRUE); 373 373 idDelete(&perm); 374 for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];374 for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1]; 375 375 delete iv; 376 376 … … 394 394 fglmSdata::~fglmSdata() 395 395 { 396 omFreeSize( (ADDRESS)varpermutation, ( pVariables+1)*sizeof(int) );396 omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) ); 397 397 for ( int k = basisSize; k > 0; k-- ) 398 398 pLmDelete( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize] … … 474 474 poly m = basis[basisSize]; 475 475 poly newmonom = NULL; 476 int k = pVariables;476 int k = (currRing->N); 477 477 BOOLEAN done = FALSE; 478 478 int state = 0; … … 585 585 poly temp = border[num].monom; 586 586 if ( pDivisibleBy( temp, m ) ) { 587 var = pVariables;587 var = (currRing->N); 588 588 while ( var > 0 ) { 589 589 if ( (pGetExp( m, var ) - pGetExp( temp, var )) == 1 ) … … 692 692 monom= m; 693 693 m= NULL; 694 for ( int k = pVariables; k > 0; k-- )694 for ( int k = (currRing->N); k > 0; k-- ) 695 695 if ( pGetExp( monom, k ) > 0 ) 696 696 insertions++; … … 797 797 perm= (int *)omAlloc( (dimen+1)*sizeof( int ) ); 798 798 basis= (polyset)omAlloc( (dimen+1)*sizeof( poly ) ); 799 varpermutation = (int*)omAlloc( ( pVariables+1)*sizeof(int) );799 varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) ); 800 800 // Sort ring variables by increasing values (because of weighted orderings) 801 801 ideal perm_id = idMaxIdeal(1); 802 802 intvec *iv = idSort(perm_id,TRUE); 803 803 idDelete(&perm_id); 804 for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];804 for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1]; 805 805 delete iv; 806 806 … … 831 831 pLmDelete( basis[k]); 832 832 omFreeSize( (ADDRESS)basis, (dimen+1)*sizeof( poly ) ); 833 omFreeSize( (ADDRESS)varpermutation, ( pVariables+1)*sizeof(int) );833 omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) ); 834 834 } 835 835 … … 884 884 ListIterator<fglmDelem> list = nlist; 885 885 poly newmonom = NULL; 886 int k = pVariables;886 int k = (currRing->N); 887 887 BOOLEAN done = FALSE; 888 888 int state = 0; … … 1109 1109 fglmVector v; 1110 1110 fglmVector p; 1111 ideal destIdeal = idInit( pVariables, 1 );1111 ideal destIdeal = idInit( (currRing->N), 1 ); 1112 1112 1113 1113 int i; 1114 1114 BOOLEAN isZero; 1115 int *varpermutation = (int*)omAlloc( ( pVariables+1)*sizeof(int) );1115 int *varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) ); 1116 1116 ideal perm = idMaxIdeal(1); 1117 1117 intvec *iv = idSort(perm,TRUE); 1118 1118 idDelete(&perm); 1119 for(i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];1119 for(i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1]; 1120 1120 delete iv; 1121 1121 1122 for (i= 1; i <= pVariables; i++ )1122 for (i= 1; i <= (currRing->N); i++ ) 1123 1123 { 1124 1124 // main loop … … 1169 1169 } 1170 1170 STICKYPROT( "\n" ); 1171 omFreeSize( (ADDRESS)varpermutation, ( pVariables+1)*sizeof(int) );1171 omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) ); 1172 1172 return destIdeal; 1173 1173 } … … 1185 1185 currRingHdl=NULL; 1186 1186 } 1187 idealFunctionals L( 100, pVariables);1187 idealFunctionals L( 100, (currRing->N) ); 1188 1188 fglmok = CalculateFunctionals( sourceIdeal, L ); 1189 1189 if ( deleteIdeal == TRUE ) … … 1206 1206 fglmVector v; 1207 1207 1208 idealFunctionals L( 100, pVariables);1208 idealFunctionals L( 100, (currRing->N) ); 1209 1209 // STICKYPROT("calculating normal form\n"); 1210 1210 // poly p = kNF( sourceIdeal, currRing->qideal, quot ); … … 1223 1223 BOOLEAN fglmok; 1224 1224 1225 idealFunctionals L( 100, pVariables);1225 idealFunctionals L( 100, (currRing->N) ); 1226 1226 fglmok = CalculateFunctionals( source, L ); 1227 1227 if ( fglmok == TRUE ) { -
kernel/gfan.cc
r6ed8c4 r1f637e 254 254 const int64vec *fIntP = f->getRef2InteriorPoint(); 255 255 const int64vec *gIntP = g->getRef2InteriorPoint(); 256 for(int ii=0;ii< pVariables;ii++)256 for(int ii=0;ii<(currRing->N);ii++) 257 257 { 258 258 if( (*fIntP)[ii] != (*gIntP)[ii] ) … … 1559 1559 n--; 1560 1560 }while(exchanged==TRUE && n>=0); 1561 }*///if pVariables>21561 }*///if (currRing->N)>2 1562 1562 // delete fNormal; 1563 1563 fAct = fAct->next; … … 2385 2385 { 2386 2386 int res=0; 2387 for (int i=0;i< pVariables;i++)2387 for (int i=0;i<(currRing->N);i++) 2388 2388 { 2389 2389 // #ifndef NDEBUG … … 2783 2783 { 2784 2784 bool res=TRUE; 2785 for(int ii=0;ii< pVariables;ii++)2785 for(int ii=0;ii<(currRing->N);ii++) 2786 2786 { 2787 2787 if(a[ii]!=b[ii]) … … 4239 4239 { 4240 4240 int64vec *ivTmp=iv64Copy(gc->gcRays[ii]); 4241 for(int jj=0;jj< pVariables;jj++)4241 for(int jj=0;jj<(currRing->N);jj++) 4242 4242 (*res)[offset+jj]=(int)(*ivTmp)[jj]; 4243 offset += pVariables;4243 offset += (currRing->N); 4244 4244 delete ivTmp; 4245 4245 } … … 4358 4358 { 4359 4359 lists lResList; //this is the object we return 4360 gfan::ZFan *zResFan = new gfan::ZFan( pVariables);4360 gfan::ZFan *zResFan = new gfan::ZFan((currRing->N)); 4361 4361 4362 4362 if(rHasGlobalOrdering(currRing)) 4363 4363 { 4364 // int numvar = pVariables;4364 // int numvar = (currRing->N); 4365 4365 gfanHeuristic = h; 4366 4366 … … 4382 4382 gcone *gcAct; 4383 4383 gcAct = gcRoot; 4384 gcone::numVars= pVariables;4385 //gcAct->numVars= pVariables;//NOTE is now static4384 gcone::numVars=(currRing->N); 4385 //gcAct->numVars=(currRing->N);//NOTE is now static 4386 4386 gcAct->getGB(inputIdeal); 4387 4387 /*Check whether input is homogeneous … … 4396 4396 else 4397 4397 { 4398 gcone::ivZeroVector = new int64vec( pVariables);4399 for(int ii=0;ii< pVariables;ii++)4398 gcone::ivZeroVector = new int64vec((currRing->N)); 4399 for(int ii=0;ii<(currRing->N);ii++) 4400 4400 (*gcone::ivZeroVector)[ii]=0; 4401 4401 } … … 4450 4450 // for(int jj=0;jj<5;jj++) 4451 4451 // { 4452 // int64vec *iv=new int64vec( pVariables);4452 // int64vec *iv=new int64vec((currRing->N)); 4453 4453 // fPtr->setFacetNormal(iv); 4454 4454 // delete(iv); -
kernel/gr_kstd2.cc
r6ed8c4 r1f637e 6 6 * ABSTRACT - Kernel: noncomm. alg. of Buchberger 7 7 */ 8 9 #include <kernel/mod2.h> 8 #define PLURAL_INTERNAL_DECLARATIONS 9 10 #include "mod2.h" 10 11 11 12 #ifdef HAVE_PLURAL 12 13 13 #define PLURAL_INTERNAL_DECLARATIONS14 14 15 15 #include <omalloc/omalloc.h> 16 #include <misc/options.h> 17 #include <misc/intvec.h> 18 19 #include <polys/weight.h> 16 20 #include <polys/polys.h> 21 22 #include <polys/nc/nc.h> 23 #include <polys/nc/sca.h> 24 25 26 #include <kernel/febase.h> 17 27 #include <kernel/ideals.h> 18 #include <kernel/febase.h>19 #include <misc/options.h>20 #include <kernel/kutil.h>21 28 #include <kernel/kstd1.h> 22 29 #include <kernel/khstd.h> 23 #include <kernel/kutil.h>24 30 //#include "spolys.h" 25 31 //#include "cntrlc.h" 26 #include <polys/weight.h>27 #include <misc/intvec.h>28 #include <polys/nc/nc.h>29 #include <polys/nc/sca.h>30 32 #include <kernel/ratgring.h> 33 34 #include <kernel/kutil.h> 31 35 32 36 #if 0 … … 1026 1030 // else 1027 1031 { 1028 ecartWeights=(short *)omAlloc(( pVariables+1)*sizeof(short));1032 ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short)); 1029 1033 /*uses automatic computation of the ecartWeights to set them*/ 1030 1034 kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights); … … 1032 1036 pFDeg=totaldegreeWecart; 1033 1037 pLDeg=maxdegreeWecart; 1034 for(i=1; i<= pVariables; i++)1038 for(i=1; i<=(currRing->N); i++) 1035 1039 Print(" %d",ecartWeights[i]); 1036 1040 PrintLn(); … … 1283 1287 if (ecartWeights) 1284 1288 { 1285 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));1289 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 1286 1290 ecartWeights=NULL; 1287 1291 } -
kernel/hdegree.cc
r6ed8c4 r1f637e 75 75 hexist = hInit(S, Q, &hNexist); 76 76 if (!hNexist) 77 return pVariables;77 return (currRing->N); 78 78 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon)); 79 hvar = (varset)omAlloc(( pVariables+ 1) * sizeof(int));80 hpure = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));79 hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 80 hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 81 81 mc = hisModule; 82 82 if (!mc) … … 87 87 else 88 88 hrad = (scfmon)omAlloc(hNexist * sizeof(scmon)); 89 radmem = hCreate( pVariables- 1);90 hCo = pVariables+ 1;89 radmem = hCreate((currRing->N) - 1); 90 hCo = (currRing->N) + 1; 91 91 loop 92 92 { … … 95 95 if (hNrad) 96 96 { 97 hNvar = pVariables;97 hNvar = (currRing->N); 98 98 hRadical(hrad, &hNrad, hNvar); 99 99 hSupp(hrad, hNrad, hvar, &hNvar); 100 100 if (hNvar) 101 101 { 102 memset(hpure, 0, ( pVariables+ 1) * sizeof(int));102 memset(hpure, 0, ((currRing->N) + 1) * sizeof(int)); 103 103 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure); 104 104 hLexR(hrad, hNrad, hvar, hNvar); … … 115 115 break; 116 116 } 117 hKill(radmem, pVariables- 1);118 omFreeSize((ADDRESS)hpure, (1 + ( pVariables * pVariables)) * sizeof(int));119 omFreeSize((ADDRESS)hvar, ( pVariables+ 1) * sizeof(int));117 hKill(radmem, (currRing->N) - 1); 118 omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 119 omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int)); 120 120 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon)); 121 121 hDelete(hexist, hNexist); 122 122 if (hisModule) 123 123 omFreeSize((ADDRESS)hrad, hNexist * sizeof(scmon)); 124 return pVariables- hCo;124 return (currRing->N) - hCo; 125 125 } 126 126 … … 140 140 { 141 141 hCo = dn; 142 for (iv= pVariables; iv; iv--)142 for (iv=(currRing->N); iv; iv--) 143 143 { 144 144 if (pure[iv]) … … 196 196 { 197 197 hCo = Npure + 1; 198 for (x= pVariables; x; x--)198 for (x=(currRing->N); x; x--) 199 199 { 200 200 if (pure[x]) … … 209 209 intvec * scIndIntvec(ideal S, ideal Q) 210 210 { 211 intvec *Set=new intvec( pVariables);211 intvec *Set=new intvec((currRing->N)); 212 212 int mc,i; 213 213 hexist = hInit(S, Q, &hNexist); 214 214 if (hNexist==0) 215 215 { 216 for(i=0; i< pVariables; i++)216 for(i=0; i<(currRing->N); i++) 217 217 (*Set)[i]=1; 218 218 return Set; 219 219 } 220 220 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon)); 221 hvar = (varset)omAlloc(( pVariables+ 1) * sizeof(int));222 hpure = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));223 hInd = (scmon)omAlloc((1 + pVariables) * sizeof(int));221 hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 222 hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 223 hInd = (scmon)omAlloc((1 + (currRing->N)) * sizeof(int)); 224 224 mc = hisModule; 225 225 if (mc==0) … … 230 230 else 231 231 hrad = (scfmon)omAlloc(hNexist * sizeof(scmon)); 232 radmem = hCreate( pVariables- 1);233 hCo = pVariables+ 1;232 radmem = hCreate((currRing->N) - 1); 233 hCo = (currRing->N) + 1; 234 234 loop 235 235 { … … 238 238 if (hNrad!=0) 239 239 { 240 hNvar = pVariables;240 hNvar = (currRing->N); 241 241 hRadical(hrad, &hNrad, hNvar); 242 242 hSupp(hrad, hNrad, hvar, &hNvar); 243 243 if (hNvar!=0) 244 244 { 245 memset(hpure, 0, ( pVariables+ 1) * sizeof(int));245 memset(hpure, 0, ((currRing->N) + 1) * sizeof(int)); 246 246 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure); 247 247 hLexR(hrad, hNrad, hvar, hNvar); … … 258 258 break; 259 259 } 260 for(i=0; i< pVariables; i++)260 for(i=0; i<(currRing->N); i++) 261 261 (*Set)[i] = hInd[i+1]; 262 hKill(radmem, pVariables- 1);263 omFreeSize((ADDRESS)hpure, (1 + ( pVariables * pVariables)) * sizeof(int));264 omFreeSize((ADDRESS)hInd, (1 + pVariables) * sizeof(int));265 omFreeSize((ADDRESS)hvar, ( pVariables+ 1) * sizeof(int));262 hKill(radmem, (currRing->N) - 1); 263 omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 264 omFreeSize((ADDRESS)hInd, (1 + (currRing->N)) * sizeof(int)); 265 omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int)); 266 266 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon)); 267 267 hDelete(hexist, hNexist); … … 293 293 intvec *Set; 294 294 295 Set = ISet->set = new intvec( pVariables);296 for (iv= pVariables; iv!=0 ; iv--)295 Set = ISet->set = new intvec((currRing->N)); 296 for (iv=(currRing->N); iv!=0 ; iv--) 297 297 { 298 298 if (pure[iv]) … … 393 393 { 394 394 Set = sm->set; 395 iv= pVariables;395 iv=(currRing->N); 396 396 loop 397 397 { … … 420 420 { 421 421 Set = sm->set; 422 iv= pVariables;422 iv=(currRing->N); 423 423 loop 424 424 { … … 453 453 { 454 454 hMu2++; 455 sm->set = new intvec( pVariables);455 sm->set = new intvec((currRing->N)); 456 456 sm->nx = (indset)omAlloc0Bin(indlist_bin); 457 457 return sm; … … 477 477 return; 478 478 Set = res->set; 479 for (iv= pVariables; iv; iv--)479 for (iv=(currRing->N); iv; iv--) 480 480 { 481 481 if (pure[iv]) … … 595 595 int i, i0, k; 596 596 i0 = 0; 597 for (i = 1; i <= pVariables; i++)597 for (i = 1; i <= (currRing->N); i++) 598 598 { 599 599 if (pure[i]) … … 608 608 if ((i0 > 2) && (i > 10)) 609 609 hOrdSupp(hwork, i, sel, i0); 610 memset(hpur0, 0, ( pVariables+ 1) * sizeof(int));610 memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int)); 611 611 hPure(hwork, 0, &i, sel, i0, hpur0, &k); 612 612 hLexS(hwork, i, sel, i0); … … 703 703 //hWeight(); 704 704 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon)); 705 hvar = (varset)omAlloc(( pVariables+ 1) * sizeof(int));706 hsel = (varset)omAlloc(( pVariables+ 1) * sizeof(int));707 hpure = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));708 hpur0 = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));705 hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 706 hsel = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 707 hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 708 hpur0 = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 709 709 mc = hisModule; 710 710 hrad = (scfmon)omAlloc(hNexist * sizeof(scmon)); … … 717 717 else 718 718 hstc = (scfmon)omAlloc(hNexist * sizeof(scmon)); 719 radmem = hCreate( pVariables- 1);720 stcmem = hCreate( pVariables- 1);721 hCo = pVariables+ 1;719 radmem = hCreate((currRing->N) - 1); 720 stcmem = hCreate((currRing->N) - 1); 721 hCo = (currRing->N) + 1; 722 722 di = hCo + 1; 723 723 loop … … 731 731 if (hNrad) 732 732 { 733 hNvar = pVariables;733 hNvar = (currRing->N); 734 734 hRadical(hrad, &hNrad, hNvar); 735 735 hSupp(hrad, hNrad, hvar, &hNvar); … … 737 737 { 738 738 hCo = hNvar; 739 memset(hpure, 0, ( pVariables+ 1) * sizeof(int));739 memset(hpure, 0, ((currRing->N) + 1) * sizeof(int)); 740 740 hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure); 741 741 hLexR(hrad, hNrad, hvar, hNvar); … … 755 755 if (hNvar && (hCo == di)) 756 756 { 757 if (di && (di < pVariables))757 if (di && (di < (currRing->N))) 758 758 hDimMult(hpure, hNpure, hrad, hNrad, hvar, hNvar); 759 759 else if (!di) … … 764 764 if ((hNvar > 2) && (hNstc > 10)) 765 765 hOrdSupp(hstc, hNstc, hvar, hNvar); 766 memset(hpur0, 0, ( pVariables+ 1) * sizeof(int));766 memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int)); 767 767 hPure(hstc, 0, &hNstc, hvar, hNvar, hpur0, &hNpure); 768 768 hLexS(hstc, hNstc, hvar, hNvar); … … 775 775 } 776 776 hCo = di; 777 hKill(stcmem, pVariables- 1);778 hKill(radmem, pVariables- 1);779 omFreeSize((ADDRESS)hpur0, (1 + ( pVariables * pVariables)) * sizeof(int));780 omFreeSize((ADDRESS)hpure, (1 + ( pVariables * pVariables)) * sizeof(int));781 omFreeSize((ADDRESS)hsel, ( pVariables+ 1) * sizeof(int));782 omFreeSize((ADDRESS)hvar, ( pVariables+ 1) * sizeof(int));777 hKill(stcmem, (currRing->N) - 1); 778 hKill(radmem, (currRing->N) - 1); 779 omFreeSize((ADDRESS)hpur0, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 780 omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 781 omFreeSize((ADDRESS)hsel, ((currRing->N) + 1) * sizeof(int)); 782 omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int)); 783 783 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon)); 784 784 omFreeSize((ADDRESS)hrad, hNexist * sizeof(scmon)); … … 796 796 void scPrintDegree(int co, int mu) 797 797 { 798 int di = pVariables-co;798 int di = (currRing->N)-co; 799 799 if (pOrdSgn == 1) 800 800 { … … 820 820 hDegreeSeries(hseries1, hseries2, &co, &mu); 821 821 if ((l == 1) &&(mu == 0)) 822 scPrintDegree( pVariables+1, 0);822 scPrintDegree((currRing->N)+1, 0); 823 823 else 824 824 scPrintDegree(co, mu); … … 840 840 hMu = 0; 841 841 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon)); 842 hvar = (varset)omAlloc(( pVariables+ 1) * sizeof(int));843 hpur0 = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));842 hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 843 hpur0 = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 844 844 mc = hisModule; 845 845 if (!mc) … … 850 850 else 851 851 hstc = (scfmon)omAlloc(hNexist * sizeof(scmon)); 852 stcmem = hCreate( pVariables- 1);852 stcmem = hCreate((currRing->N) - 1); 853 853 loop 854 854 { … … 862 862 } 863 863 } 864 hNvar = pVariables;864 hNvar = (currRing->N); 865 865 for (int i = hNvar; i; i--) 866 866 hvar[i] = i; 867 867 hStaircase(hstc, &hNstc, hvar, hNvar); 868 868 hSupp(hstc, hNstc, hvar, &hNvar); 869 if ((hNvar == pVariables) && (hNstc >= pVariables))869 if ((hNvar == (currRing->N)) && (hNstc >= (currRing->N))) 870 870 { 871 871 if ((hNvar > 2) && (hNstc > 10)) 872 872 hOrdSupp(hstc, hNstc, hvar, hNvar); 873 memset(hpur0, 0, ( pVariables+ 1) * sizeof(int));873 memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int)); 874 874 hPure(hstc, 0, &hNstc, hvar, hNvar, hpur0, &hNpure); 875 875 if (hNpure == hNvar) … … 887 887 break; 888 888 } 889 hKill(stcmem, pVariables- 1);890 omFreeSize((ADDRESS)hpur0, (1 + ( pVariables * pVariables)) * sizeof(int));891 omFreeSize((ADDRESS)hvar, ( pVariables+ 1) * sizeof(int));889 hKill(stcmem, (currRing->N) - 1); 890 omFreeSize((ADDRESS)hpur0, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 891 omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int)); 892 892 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon)); 893 893 hDelete(hexist, hNexist); … … 983 983 int i; 984 984 int k = ak; 985 hNvar = pVariables;985 hNvar = (currRing->N); 986 986 hexist = hInit(S, Q, &hNexist, tailRing); 987 987 if (k!=0) … … 1311 1311 } 1312 1312 } 1313 stcmem = hCreate( pVariables- 1);1313 stcmem = hCreate((currRing->N) - 1); 1314 1314 hexist = hInit(s, Q, &hNexist); 1315 1315 p = last = pInit(); 1316 1316 /*pNext(p) = NULL;*/ 1317 act = (scmon)omAlloc(( pVariables+ 1) * sizeof(int));1317 act = (scmon)omAlloc(((currRing->N) + 1) * sizeof(int)); 1318 1318 *act = 0; 1319 1319 if (!hNexist) 1320 1320 { 1321 scAll( pVariables, deg);1321 scAll((currRing->N), deg); 1322 1322 goto ende; 1323 1323 } 1324 1324 if (!hisModule) 1325 1325 { 1326 if (deg < 0) scInKbase(hexist, hNexist, pVariables);1327 else scDegKbase(hexist, hNexist, pVariables, deg);1326 if (deg < 0) scInKbase(hexist, hNexist, (currRing->N)); 1327 else scDegKbase(hexist, hNexist, (currRing->N), deg); 1328 1328 } 1329 1329 else … … 1340 1340 if (hNstc) 1341 1341 { 1342 if (deg < 0) scInKbase(hstc, hNstc, pVariables);1343 else scDegKbase(hstc, hNstc, pVariables, deg_ei);1342 if (deg < 0) scInKbase(hstc, hNstc, (currRing->N)); 1343 else scDegKbase(hstc, hNstc, (currRing->N), deg_ei); 1344 1344 } 1345 1345 else 1346 scAll( pVariables, deg_ei);1346 scAll((currRing->N), deg_ei); 1347 1347 } 1348 1348 } … … 1351 1351 ende: 1352 1352 hDelete(hexist, hNexist); 1353 omFreeSize((ADDRESS)act, ( pVariables+ 1) * sizeof(int));1354 hKill(stcmem, pVariables- 1);1353 omFreeSize((ADDRESS)act, ((currRing->N) + 1) * sizeof(int)); 1354 hKill(stcmem, (currRing->N) - 1); 1355 1355 pLmDelete(&p); 1356 1356 if (p == NULL) … … 1380 1380 } 1381 1381 di = scDimInt(s, Q); 1382 stcmem = hCreate( pVariables- 1);1382 stcmem = hCreate((currRing->N) - 1); 1383 1383 hexist = hInit(s, Q, &hNexist); 1384 1384 p = last = pInit(); 1385 1385 /*pNext(p) = NULL;*/ 1386 act = (scmon)omAlloc(( pVariables+ 1) * sizeof(int));1386 act = (scmon)omAlloc(((currRing->N) + 1) * sizeof(int)); 1387 1387 *act = 0; 1388 1388 if (!hNexist) 1389 1389 { 1390 scAll( pVariables, -1);1390 scAll((currRing->N), -1); 1391 1391 goto ende; 1392 1392 } 1393 1393 if (!hisModule) 1394 1394 { 1395 scInKbase(hexist, hNexist, pVariables);1395 scInKbase(hexist, hNexist, (currRing->N)); 1396 1396 } 1397 1397 else … … 1404 1404 if (hNstc) 1405 1405 { 1406 scInKbase(hstc, hNstc, pVariables);1406 scInKbase(hstc, hNstc, (currRing->N)); 1407 1407 } 1408 1408 else 1409 scAll( pVariables, -1);1409 scAll((currRing->N), -1); 1410 1410 } 1411 1411 omFreeSize((ADDRESS)hstc, hNexist * sizeof(scmon)); … … 1413 1413 ende: 1414 1414 hDelete(hexist, hNexist); 1415 omFreeSize((ADDRESS)act, ( pVariables+ 1) * sizeof(int));1416 hKill(stcmem, pVariables- 1);1415 omFreeSize((ADDRESS)act, ((currRing->N) + 1) * sizeof(int)); 1416 hKill(stcmem, (currRing->N) - 1); 1417 1417 pDeleteLm(&p); 1418 1418 idDelete(&s); … … 1437 1437 nDelete(&pGetCoeff(hEdge)); 1438 1438 pGetCoeff(hEdge)=NULL; 1439 for(i= pVariables;i>0;i--)1439 for(i=(currRing->N);i>0;i--) 1440 1440 pIncrExp(hEdge,i); 1441 1441 pSetm(hEdge); -
kernel/hilb.cc
r6ed8c4 r1f637e 199 199 int x; 200 200 201 for (i= pVariables; i; i--)201 for (i=(currRing->N); i; i--) 202 202 { 203 203 x = (*wdegree)[i-1]; … … 239 239 p0 = 1; 240 240 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon)); 241 hvar = (varset)omAlloc(( pVariables+ 1) * sizeof(int));242 hpure = (scmon)omAlloc((1 + ( pVariables * pVariables)) * sizeof(int));243 stcmem = hCreate( pVariables- 1);244 Qpol = (int **)omAlloc(( pVariables+ 1) * sizeof(int *));245 Ql = (int *)omAlloc0(( pVariables+ 1) * sizeof(int));246 Q0 = (int *)omAlloc(( pVariables+ 1) * sizeof(int));241 hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int)); 242 hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 243 stcmem = hCreate((currRing->N) - 1); 244 Qpol = (int **)omAlloc(((currRing->N) + 1) * sizeof(int *)); 245 Ql = (int *)omAlloc0(((currRing->N) + 1) * sizeof(int)); 246 Q0 = (int *)omAlloc(((currRing->N) + 1) * sizeof(int)); 247 247 *Qpol = NULL; 248 248 hLength = k = j = 0; … … 269 269 if (hNstc!=0) 270 270 { 271 hNvar = pVariables;271 hNvar = (currRing->N); 272 272 for (i = hNvar; i>=0; i--) 273 273 hvar[i] = i; … … 280 280 hOrdSupp(hstc, hNstc, hvar, hNvar); 281 281 hHilbEst(hstc, hNstc, hvar, hNvar); 282 memset(hpure, 0, ( pVariables+ 1) * sizeof(int));282 memset(hpure, 0, ((currRing->N) + 1) * sizeof(int)); 283 283 hPure(hstc, 0, &hNstc, hvar, hNvar, hpure, &hNpure); 284 284 hLexS(hstc, hNstc, hvar, hNvar); … … 347 347 (*hseries1)[l-1] = mw; 348 348 } 349 for (i = 0; i <= pVariables; i++)349 for (i = 0; i <= (currRing->N); i++) 350 350 { 351 351 if (Ql[i]!=0) 352 352 omFreeSize((ADDRESS)Qpol[i], Ql[i] * sizeof(int)); 353 353 } 354 omFreeSize((ADDRESS)Q0, ( pVariables+ 1) * sizeof(int));355 omFreeSize((ADDRESS)Ql, ( pVariables+ 1) * sizeof(int));356 omFreeSize((ADDRESS)Qpol, ( pVariables+ 1) * sizeof(int *));357 hKill(stcmem, pVariables- 1);358 omFreeSize((ADDRESS)hpure, (1 + ( pVariables * pVariables)) * sizeof(int));359 omFreeSize((ADDRESS)hvar, ( pVariables+ 1) * sizeof(int));354 omFreeSize((ADDRESS)Q0, ((currRing->N) + 1) * sizeof(int)); 355 omFreeSize((ADDRESS)Ql, ((currRing->N) + 1) * sizeof(int)); 356 omFreeSize((ADDRESS)Qpol, ((currRing->N) + 1) * sizeof(int *)); 357 hKill(stcmem, (currRing->N) - 1); 358 omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int)); 359 omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int)); 360 360 omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon)); 361 361 hDelete(hexist, hNexist); … … 462 462 hPrintHilb(hseries2); 463 463 if ((l == 1) &&(mu == 0)) 464 scPrintDegree( pVariables+1, 0);464 scPrintDegree((currRing->N)+1, 0); 465 465 else 466 466 scPrintDegree(co, mu); -
kernel/hutil.cc
r6ed8c4 r1f637e 89 89 if (*si!=NULL) 90 90 { 91 *ek = (scmon) omAlloc(( pVariables+1)*sizeof(int));91 *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int)); 92 92 pGetExpV(*si, *ek); 93 93 ek++; … … 99 99 if (*qi!=NULL) 100 100 { 101 *ek = (scmon) omAlloc(( pVariables+1)*sizeof(int));101 *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int)); 102 102 pGetExpV(*qi, *ek); 103 103 ek++; … … 115 115 int x; 116 116 117 i = pVariables;117 i = (currRing->N); 118 118 loop 119 119 { … … 122 122 if (i == 0) return; 123 123 } 124 for (i= pVariables; i>0; i--)124 for (i=(currRing->N); i>0; i--) 125 125 { 126 126 x = pWeight(i); … … 143 143 { 144 144 for (i=ev_length-1;i>=0;i--) 145 omFreeSize(hsecure[i],( pVariables+1)*sizeof(int));145 omFreeSize(hsecure[i],((currRing->N)+1)*sizeof(int)); 146 146 omFreeSize(hsecure, ev_length*sizeof(scmon)); 147 147 omFreeSize(ev, ev_length*sizeof(scmon)); … … 1039 1039 * scmon p1, pn; 1040 1040 * p1 = p + 1; 1041 * pn = p1 + pVariables;1042 * memcpy(pn, p1, pVariables* sizeof(int));1041 * pn = p1 + (currRing->N); 1042 * memcpy(pn, p1, (currRing->N) * sizeof(int)); 1043 1043 * return pn - 1; 1044 1044 *} … … 1050 1050 p1++; 1051 1051 pn = p1; 1052 pn += pVariables;1053 memcpy(pn, p1, pVariables* sizeof(int));1052 pn += (currRing->N); 1053 memcpy(pn, p1, (currRing->N) * sizeof(int)); 1054 1054 return pn - 1; 1055 1055 } -
kernel/ideals.cc
r6ed8c4 r1f637e 32 32 #include <polys/prCopy.h> 33 33 #include <polys/nc/nc.h> 34 34 35 35 36 #include <kernel/ideals.h> … … 149 150 l = 1; 150 151 lex = pGetExp(p,l); 151 while ((l < pVariables) && (lex == 0))152 while ((l < (currRing->N)) && (lex == 0)) 152 153 { 153 154 l++; … … 193 194 pIter(qresult); 194 195 } 195 for (j= pVariables-1; j>0; j--)196 for (j=(currRing->N)-1; j>0; j--) 196 197 { 197 198 lex = pGetExp(qp,j); … … 1615 1616 { 1616 1617 block0[1] = 1; 1617 block1[1] = pVariables;1618 block1[1] = (currRing->N); 1618 1619 if (origR->OrdSgn==1) ord[1] = ringorder_wp; 1619 1620 else ord[1] = ringorder_ws; 1620 wv[1]=(int*)omAlloc0( pVariables*sizeof(int));1621 double wNsqr = (double)2.0 / (double) pVariables;1621 wv[1]=(int*)omAlloc0((currRing->N)*sizeof(int)); 1622 double wNsqr = (double)2.0 / (double)(currRing->N); 1622 1623 wFunctional = wFunctionalBuch; 1623 int *x= (int * )omAlloc(2 * ( pVariables+ 1) * sizeof(int));1624 int *x= (int * )omAlloc(2 * ((currRing->N) + 1) * sizeof(int)); 1624 1625 int sl=IDELEMS(h1) - 1; 1625 1626 wCall(h1->m, sl, x, wNsqr); 1626 for (sl = pVariables; sl!=0; sl--)1627 wv[1][sl-1] = x[sl + pVariables+ 1];1628 omFreeSize((ADDRESS)x, 2 * ( pVariables+ 1) * sizeof(int));1627 for (sl = (currRing->N); sl!=0; sl--) 1628 wv[1][sl-1] = x[sl + (currRing->N) + 1]; 1629 omFreeSize((ADDRESS)x, 2 * ((currRing->N) + 1) * sizeof(int)); 1629 1630 1630 1631 ord[2]=ringorder_C; … … 1735 1736 #endif 1736 1737 // change into the new ring 1737 //pChangeRing( pVariables,currRing->OrdSgn,ord,block0,block1,wv);1738 //pChangeRing((currRing->N),currRing->OrdSgn,ord,block0,block1,wv); 1738 1739 rChangeCurrRing(tmpR); 1739 1740 … … 1774 1775 for (k=0; k<=i; k++) 1775 1776 { 1776 l= pVariables;1777 l=(currRing->N); 1777 1778 while ((l>0) && (p_GetExp( hh->m[k],l,tmpR)*pGetExp(delVar,l)==0)) l--; 1778 1779 if (l==0) … … 2374 2375 while ((j>0) && (kbase->m[j-1]==NULL)) j--; 2375 2376 if (j==0) return -1; 2376 int i= pVariables;2377 int i=(currRing->N); 2377 2378 while (i>0) 2378 2379 { … … 2409 2410 poly coeff=pOne(), base=pOne(); 2410 2411 2411 for (i=1;i<= pVariables;i++)2412 for (i=1;i<=(currRing->N);i++) 2412 2413 { 2413 2414 if (pGetExp(how,i)>0) -
kernel/kpolys.cc
r6ed8c4 r1f637e 14 14 if (lcm==NULL) return FALSE; 15 15 16 for (j= pVariables; j; j--)16 for (j=(currRing->N); j; j--) 17 17 if ( pGetExp(p,j) > pGetExp(lcm,j)) return FALSE; 18 18 if ( pGetComp(p) != pGetComp(lcm)) return FALSE; 19 for (j= pVariables; j; j--)19 for (j=(currRing->N); j; j--) 20 20 { 21 21 if (pGetExp(p1,j)!=pGetExp(lcm,j)) … … 23 23 if (pGetExp(p,j)!=pGetExp(lcm,j)) 24 24 { 25 for (k= pVariables; k>j; k--)25 for (k=(currRing->N); k>j; k--) 26 26 { 27 27 if ((pGetExp(p,k)!=pGetExp(lcm,k)) … … 42 42 if (pGetExp(p,j)!=pGetExp(lcm,j)) 43 43 { 44 for (k= pVariables; k>j; k--)44 for (k=(currRing->N); k>j; k--) 45 45 { 46 46 if ((pGetExp(p,k)!=pGetExp(lcm,k)) … … 76 76 if (pGetExp(p,j)!=pGetExp(lcm,j)) 77 77 { 78 for (k= pVariables; k>j; k--)78 for (k=(currRing->N); k>j; k--) 79 79 for (k=currRing->real_var_end; k>j; k--) 80 80 { -
kernel/kspoly.cc
r6ed8c4 r1f637e 395 395 m2=p_Init(currRing); 396 396 x2: 397 for (i = pVariables; i; i--)397 for (i = (currRing->N); i; i--) 398 398 { 399 399 c = p_GetExpDiff(p1, p2,i, currRing); … … 447 447 m1=p_Init(currRing); 448 448 x1: 449 for (i = pVariables; i; i--)449 for (i = (currRing->N); i; i--) 450 450 { 451 451 c = p_GetExpDiff(p2, p1,i,currRing); … … 485 485 loop 486 486 { 487 for (i = pVariables; i; i--)487 for (i = (currRing->N); i; i--) 488 488 { 489 489 c = p_GetExpDiff(p1, p2,i,currRing); -
kernel/kstd1.cc
r6ed8c4 r1f637e 642 642 643 643 /*2 644 *looks whether exactly pVariables-1 axis are used644 *looks whether exactly (currRing->N)-1 axis are used 645 645 *returns last != 0 in this case 646 646 *last is the (first) unused axis … … 657 657 { 658 658 i++; 659 if (i > pVariables) break;659 if (i > (currRing->N)) break; 660 660 if (strat->NotUsedAxis[i]) 661 661 { … … 942 942 if (ecartWeights) 943 943 { 944 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));944 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 945 945 ecartWeights=NULL; 946 946 } … … 1088 1088 //else 1089 1089 { 1090 ecartWeights=(short *)omAlloc(( pVariables+1)*sizeof(short));1090 ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short)); 1091 1091 /*uses automatic computation of the ecartWeights to set them*/ 1092 1092 kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights); … … 1095 1095 if (TEST_OPT_PROT) 1096 1096 { 1097 for(i=1; i<= pVariables; i++)1097 for(i=1; i<=(currRing->N); i++) 1098 1098 Print(" %d",ecartWeights[i]); 1099 1099 PrintLn(); … … 1108 1108 idhdl h; 1109 1109 1110 strat->NotUsedAxis = (BOOLEAN *)omAlloc(( pVariables+1)*sizeof(BOOLEAN));1111 for (j= pVariables; j>0; j--) strat->NotUsedAxis[j] = TRUE;1110 strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN)); 1111 for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE; 1112 1112 strat->enterS = enterSMora; 1113 1113 strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/ … … 1146 1146 //else 1147 1147 { 1148 ecartWeights=(short *)omAlloc(( pVariables+1)*sizeof(short));1148 ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short)); 1149 1149 /*uses automatic computation of the ecartWeights to set them*/ 1150 1150 kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights); … … 1154 1154 if (TEST_OPT_PROT) 1155 1155 { 1156 for(i=1; i<= pVariables; i++)1156 for(i=1; i<=(currRing->N); i++) 1157 1157 Print(" %d",ecartWeights[i]); 1158 1158 PrintLn(); … … 1400 1400 strat->lastAxis = 0; //??? 1401 1401 pDelete(&strat->kNoether); 1402 omFreeSize((ADDRESS)strat->NotUsedAxis,( pVariables+1)*sizeof(BOOLEAN));1402 omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN)); 1403 1403 if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat); 1404 1404 if (TEST_OPT_WEIGHTM) … … 1407 1407 if (ecartWeights) 1408 1408 { 1409 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));1409 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 1410 1410 ecartWeights=NULL; 1411 1411 } … … 1517 1517 omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int)); 1518 1518 omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long)); 1519 omFreeSize((ADDRESS)strat->NotUsedAxis,( pVariables+1)*sizeof(BOOLEAN));1519 omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN)); 1520 1520 omfree(strat->sevT); 1521 1521 omfree(strat->S_2_R); … … 1535 1535 if (ecartWeights) 1536 1536 { 1537 omFreeSize((ADDRESS *)&ecartWeights,( pVariables+1)*sizeof(short));1537 omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short)); 1538 1538 ecartWeights=NULL; 1539 1539 } … … 1656 1656 omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int)); 1657 1657 omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long)); 1658 omFreeSize((ADDRESS)strat->NotUsedAxis,( pVariables+1)*sizeof(BOOLEAN));1658 omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN)); 1659 1659 omfree(strat->sevT); 1660 1660 omfree(strat->S_2_R); … … 1674 1674 if (ecartWeights) 1675 1675 { 1676 omFreeSize((ADDRESS *)&ecartWeights,( pVariables+1)*sizeof(short));1676 omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short)); 1677 1677 ecartWeights=NULL; 1678 1678 } … … 2205 2205 strat->ak = idRankFreeModule(tempF); 2206 2206 initBuchMoraCrit(strat); 2207 strat->NotUsedAxis = (BOOLEAN *)omAlloc(( pVariables+1)*sizeof(BOOLEAN));2208 for (j= pVariables; j>0; j--) strat->NotUsedAxis[j] = TRUE;2207 strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN)); 2208 for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE; 2209 2209 strat->enterS = enterSBba; 2210 2210 strat->posInT = posInT17; … … 2228 2228 omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int)); 2229 2229 omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long)); 2230 omFreeSize((ADDRESS)strat->NotUsedAxis,( pVariables+1)*sizeof(BOOLEAN));2230 omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN)); 2231 2231 omfree(strat->sevT); 2232 2232 omfree(strat->S_2_R); … … 2507 2507 if (ecartWeights) 2508 2508 { 2509 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));2509 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 2510 2510 ecartWeights=NULL; 2511 2511 } -
kernel/kstd2.cc
r6ed8c4 r1f637e 1284 1284 if (ecartWeights) 1285 1285 { 1286 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));1286 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 1287 1287 ecartWeights=NULL; 1288 1288 } … … 1796 1796 if (ecartWeights) 1797 1797 { 1798 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));1798 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 1799 1799 ecartWeights=NULL; 1800 1800 } … … 1999 1999 //else 2000 2000 { 2001 ecartWeights=(short *)omAlloc(( pVariables+1)*sizeof(short));2001 ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short)); 2002 2002 /*uses automatic computation of the ecartWeights to set them*/ 2003 2003 kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights); … … 2006 2006 if (TEST_OPT_PROT) 2007 2007 { 2008 for(i=1; i<= pVariables; i++)2008 for(i=1; i<=(currRing->N); i++) 2009 2009 Print(" %d",ecartWeights[i]); 2010 2010 PrintLn(); -
kernel/kstdfac.cc
r6ed8c4 r1f637e 887 887 if (ecartWeights) 888 888 { 889 omFreeSize((ADDRESS)ecartWeights,( pVariables+1)*sizeof(short));889 omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short)); 890 890 ecartWeights=NULL; 891 891 } -
kernel/kutil.cc
r6ed8c4 r1f637e 407 407 if (p!=0) strat->NotUsedAxis[p] = FALSE; 408 408 /*- the leading term of pp is a power of the p-th variable -*/ 409 for (j= pVariables;j>0; j--)409 for (j=(currRing->N);j>0; j--) 410 410 { 411 411 if (strat->NotUsedAxis[j]) … … 6242 6242 newNoether = pLmInit(strat->kHEdge); 6243 6243 j = pFDeg(newNoether,currRing); 6244 for (i=1; i<= pVariables; i++)6244 for (i=1; i<=(currRing->N); i++) 6245 6245 { 6246 6246 if (pGetExp(newNoether, i) > 0) pDecrExp(newNoether,i); -
kernel/kutil.h
r6ed8c4 r1f637e 640 640 KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k, 641 641 kStrategy strat); 642 #include <kernel/kInline.cc> 642 643 //// #include <kernel/kInline.cc> // This is really ugly!!! 643 644 644 645 /* shiftgb stuff */ -
kernel/ratgring.cc
r6ed8c4 r1f637e 31 31 /* rat_shift is the last exp one should count with */ 32 32 int i; 33 for (i= pVariables; i>=rat_shift; i--)33 for (i=(currRing->N); i>=rat_shift; i--) 34 34 { 35 35 pSetExp(m,i, si_max( pGetExp(a,i), pGetExp(b,i))); … … 48 48 p_Init(r); 49 49 50 const int pVariables= r->N;51 52 // for (int i = pVariables; i>=r->real_var_start; i--)50 const int (currRing->N) = r->N; 51 52 // for (int i = (currRing->N); i>=r->real_var_start; i--) 53 53 for (int i = r->real_var_end; i>=r->real_var_start; i--) 54 54 { … … 70 70 // /* shift is the exp of rational elements */ 71 71 // int i; 72 // for (i= pVariables; i; i--)72 // for (i=(currRing->N); i; i--) 73 73 // { 74 74 // if (!pGetExp(pshift,i)) -
kernel/stairc.h
r6ed8c4 r1f637e 17 17 18 18 intvec * scIndIntvec(ideal S, ideal Q=NULL); 19 lists scIndIndset(ideal S, BOOLEAN all, ideal Q=NULL); 19 20 // lists scIndIndset(ideal S, BOOLEAN all, ideal Q=NULL); // TODO: move to Singular/ 21 20 22 int scDimInt(ideal s,ideal Q=NULL); 21 23 int scMultInt(ideal s,ideal Q=NULL); -
kernel/syz.h
r6ed8c4 r1f637e 107 107 syStrategy syCopy(syStrategy syzstr); 108 108 void syPrint(syStrategy syzstr); 109 lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); 110 syStrategy syConvList(lists li,BOOLEAN toDel=FALSE); 111 syStrategy syForceMin(lists li); 109 110 // lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); // TODO: move to Singular/ 111 // syStrategy syConvList(lists li,BOOLEAN toDel=FALSE); // TODO: move to Singular/ 112 // syStrategy syForceMin(lists li); // TODO: move to Singular/ 113 112 114 syStrategy syMinimize(syStrategy syzstr); 113 115 void syKillEmptyEntres(resolvente res,int length); -
kernel/syz0.cc
r6ed8c4 r1f637e 90 90 if (mW!=NULL) 91 91 { 92 for(jj=1;jj<= pVariables;jj++)92 for(jj=1;jj<=(currRing->N);jj++) 93 93 pSetExp(q,jj,pGetExp(q,jj) -pGetExp(mW->m[pGetComp(q)-1],jj)); 94 94 pSetm(q); … … 97 97 if (mW!=NULL) 98 98 { 99 for(jj=1;jj<= pVariables;jj++)99 for(jj=1;jj<=(currRing->N);jj++) 100 100 pSetExp(p,jj,pGetExp(p,jj) +pGetExp(mW->m[pGetComp(p)-1],jj)); 101 101 pSetm(p); … … 470 470 if (mW!=NULL) 471 471 { 472 for(j=1;j<= pVariables;j++)472 for(j=1;j<=(currRing->N);j++) 473 473 pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j)); 474 474 } … … 484 484 if (mW!=NULL) 485 485 { 486 for(j=1;j<= pVariables;j++)486 for(j=1;j<=(currRing->N);j++) 487 487 pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j)); 488 488 } … … 749 749 if (res[syzIndex-1]->m[pGetComp(p)-1]!=NULL) 750 750 { 751 for(j=1;j<= pVariables;j++)751 for(j=1;j<=(currRing->N);j++) 752 752 { 753 753 pSetExp(p,j,pGetExp(p,j) … … 782 782 { 783 783 qq = p; 784 for(j=1;j<= pVariables;j++)784 for(j=1;j<=(currRing->N);j++) 785 785 { 786 786 pSetExp(p,j,pGetExp(p,j) … … 796 796 } 797 797 pp = pNext(p); 798 for(j=1;j<= pVariables;j++)798 for(j=1;j<=(currRing->N);j++) 799 799 { 800 800 pSetExp(pp,j,pGetExp(pp,j) -
kernel/syz1.cc
r6ed8c4 r1f637e 207 207 //if (o1>0) 208 208 { 209 int i = pVariables;209 int i = (currRing->N); 210 210 while ((i>1) && (pGetExp(p1,i)==pGetExp(p2,i))) 211 211 i--; 212 //(*orderingdepth)[ pVariables-i]++;212 //(*orderingdepth)[(currRing->N)-i]++; 213 213 if (i>1) 214 214 { … … 1707 1707 // pWrite(tq); 1708 1708 pTest(tq); 1709 for (l= pVariables;l>0;l--)1709 for (l=(currRing->N);l>0;l--) 1710 1710 { 1711 1711 if (origR!=NULL) … … 2132 2132 { 2133 2133 tq = pInit(); 2134 for(j= pVariables; j>0; j--)2134 for(j=(currRing->N); j>0; j--) 2135 2135 pSetExp(tq,j, pGetExp(p,j)-pGetExp(pisN,j)); 2136 2136 pSetComp(tq, 0); … … 2460 2460 //euler = -1; 2461 2461 redpol = pInit(); 2462 syzstr->length = *length = pVariables+2;2462 syzstr->length = *length = (currRing->N)+2; 2463 2463 2464 2464 // Creare dp,S ring and change to it … … 2598 2598 2599 2599 if( maxlength > 0 ) 2600 syzstr->length = maxlength; // = pVariables+2;2600 syzstr->length = maxlength; // = (currRing->N)+2; 2601 2601 else 2602 syzstr->length = maxlength = pVariables+2;2602 syzstr->length = maxlength = (currRing->N)+2; 2603 2603 2604 2604 // Creare dp,S ring and change to it -
kernel/syz2.cc
r6ed8c4 r1f637e 7 7 */ 8 8 9 #include <kernel/mod2.h> 10 #include <omalloc/mylimits.h> 9 #include "mod2.h" 10 11 #include <omalloc/omalloc.h> 12 13 #include <misc/mylimits.h> 11 14 #include <misc/options.h> 12 #include <omalloc/omalloc.h> 13 #include <kernel/syz.h> 15 #include <misc/intvec.h> 16 //#include "cntrlc.h" 17 18 #include <coeffs/coeffs.h> 19 #include <coeffs/numbers.h> 20 21 #include <polys/monomials/ring.h> 22 #include <polys/kbuckets.h> 23 #include <polys/prCopy.h> 24 14 25 #include <polys/polys.h> 26 27 // #include <kernel/modulop.h> 28 15 29 #include <kernel/febase.h> 16 30 #include <kernel/kstd1.h> 17 31 #include <kernel/kutil.h> 18 32 #include <kernel/stairc.h> 19 //#include "cntrlc.h" 20 #include <misc/intvec.h> 21 #include <coeffs/numbers.h> 22 #include <kernel/modulop.h> 33 34 #include <kernel/syz.h> 23 35 #include <kernel/ideals.h> 24 #include <misc/intvec.h> 25 #include <polys/monomials/ring.h> 26 #include <polys/kbuckets.h> 27 #include <polys/prCopy.h> 36 37 38 39 28 40 29 41 //#define SHOW_PROT … … 142 154 { 143 155 poly p1,p2; 144 int ip= pVariables;156 int ip= currRing->N; 145 157 p1 = pDivide(p,(syzstr->resPairs[index])[i].p); 146 158 p2 = pDivide(nP->m[j],(syzstr->resPairs[index])[j].p); … … 983 995 crit_fails = 0; 984 996 #endif 985 syzstr->length = *length = pVariables+2;997 syzstr->length = *length = currRing->N+2; 986 998 syzstr->Tl = new intvec(*length+1); 987 999 temp = idInit(IDELEMS(arg),arg->rank); -
kernel/syz3.cc
r6ed8c4 r1f637e 281 281 if (res[syzIndex-1]->m[pGetComp(p)-1]!=NULL) 282 282 { 283 for(j=1;j<= pVariables;j++)283 for(j=1;j<=(currRing->N);j++) 284 284 { 285 285 pSetExp(p,j,pGetExp(p,j) … … 386 386 { 387 387 poly p1,p2; 388 int ip= pVariables;388 int ip=(currRing->N); 389 389 p1 = pDivide(p,old_generators->m[jj]); 390 390 p2 = pDivide(prs[j1],old_generators->m[j1]); … … 1085 1085 { 1086 1086 poly p1,p2; 1087 int ip= pVariables;1087 int ip=(currRing->N); 1088 1088 p1 = pDivide(p,add_generators->m[j]); 1089 1089 p2 = pDivide(prs[j1],add_generators->m[j1]); … … 1211 1211 { 1212 1212 assume(pp1!=NULL); 1213 for(i=(int) pVariables; i; i--)1213 for(i=(int)(currRing->N); i; i--) 1214 1214 pSetExp(pp1,i, pGetExp(pp1,i)- pGetExp(deg_soc,i)); 1215 1215 pSetComp(pp1, 0); … … 1221 1221 { 1222 1222 assume(pp2!=NULL); 1223 for(i=(int) pVariables; i; i--)1223 for(i=(int)(currRing->N); i; i--) 1224 1224 pSetExp(pp2,i, pGetExp(pp2,i)- pGetExp(deg_soc,i)); 1225 1225 pSetComp(pp2, 0); … … 1768 1768 syzstr->syRing = rCurrRingAssure_C_dp(); 1769 1769 /*--- initializes the data structures---------------*/ 1770 syzstr->length = *length = pVariables+2;1770 syzstr->length = *length = (currRing->N)+2; 1771 1771 syzstr->regularity = -1; 1772 1772 if (origR!=syzstr->syRing) -
kernel/tgb.cc
r6ed8c4 r1f637e 379 379 if(p_GetComp (p, r) != 0) 380 380 return FALSE; 381 if(c->lastDpBlockStart <= pVariables)381 if(c->lastDpBlockStart <= (currRing->N)) 382 382 { 383 383 int i; … … 407 407 if(p_GetComp (p, r) != 0) 408 408 return FALSE; 409 if(c->lastDpBlockStart <= pVariables)409 if(c->lastDpBlockStart <= (currRing->N)) 410 410 { 411 411 int i; … … 446 446 if(r->order[last_block] == ringorder_dp) 447 447 return r->block0[last_block]; 448 return pVariables+ 1;448 return (currRing->N) + 1; 449 449 } 450 450 … … 827 827 if(pGetExp (p1, i) + pGetExp (p2, i) > pGetExp (bound, i)) 828 828 return FALSE; 829 if(i == pVariables)829 if(i == (currRing->N)) 830 830 { 831 831 //PrintS("trivial"); … … 845 845 return FALSE; 846 846 } 847 if(i == pVariables)847 if(i == (currRing->N)) 848 848 { 849 849 pDelete (&m); … … 1552 1552 ~(c->short_Exps[j]), c->r)); 1553 1553 1554 if(_ p_GetComp (c->S->m[i], c->r) !=_p_GetComp (c->S->m[j], c->r))1554 if(__p_GetComp (c->S->m[i], c->r) != __p_GetComp (c->S->m[j], c->r)) 1555 1555 { 1556 1556 //c->states[i][j]=UNCALCULATED; … … 1735 1735 p_Test (nodes[lower]->lcm_of_lm, c->r); 1736 1736 nodes[lower]->lcm_of_lm = pCopy (nodes[lower]->lcm_of_lm); 1737 assume (_ p_GetComp (c->S->m[nodes[lower]->i], c->r) ==1738 _ p_GetComp (c->S->m[nodes[lower]->j], c->r));1737 assume (__p_GetComp (c->S->m[nodes[lower]->i], c->r) == 1738 __p_GetComp (c->S->m[nodes[lower]->j], c->r)); 1739 1739 nodes_final[spc_final] = 1740 1740 (sorted_pair_node *) omalloc (sizeof (sorted_pair_node)); … … 2246 2246 if(node == NULL) 2247 2247 return; 2248 if(level < pVariables)2248 if(level < (currRing->N)) 2249 2249 { 2250 2250 int i, sum; … … 3355 3355 && (!(eliminationProblem)) && (npPrimeM <= 32003)); 3356 3356 use_noro_last_block = false; 3357 if((!(use_noro)) && (lastDpBlockStart <= pVariables))3357 if((!(use_noro)) && (lastDpBlockStart <= (currRing->N))) 3358 3358 { 3359 3359 use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r)) … … 3712 3712 int i; 3713 3713 int n = 0; 3714 for(i = pVariables; i; i--)3714 for(i = (currRing->N); i; i--) 3715 3715 { 3716 3716 n += si_max (pGetExp (a, i), pGetExp (b, i)); … … 4034 4034 poly m = pOne (); 4035 4035 poly t; 4036 for(i = pVariables; i; i--)4036 for(i = (currRing->N); i; i--) 4037 4037 { 4038 4038 pSetExp (m, i, pGetExp (p, i)); … … 4078 4078 && (pGetExp (p2, i) - pGetExp (m, i) > 0)) 4079 4079 return FALSE; 4080 if(i == pVariables)4080 if(i == (currRing->N)) 4081 4081 return TRUE; 4082 4082 i++; … … 4987 4987 pSetCoeff (m, nInit (1)); 4988 4988 pSetComp (m, 0); 4989 for(int i = 1; i <= pVariables; i++)4989 for(int i = 1; i <= (currRing->N); i++) 4990 4990 pSetExp (m, i, (pGetExp (r[erg.to_reduce_l].p, i) - pGetExp (red, i))); 4991 4991 pSetm (m); -
kernel/tgb_internal.h
r6ed8c4 r1f637e 729 729 int i; 730 730 nReducibleMonomials++; 731 int nvars= pVariables;731 int nvars=(currRing->N); 732 732 NoroCacheNode* parent=&root; 733 733 for(i=1;i<nvars;i++) … … 742 742 int i; 743 743 nReducibleMonomials++; 744 int nvars= pVariables;744 int nvars=(currRing->N); 745 745 NoroCacheNode* parent=&root; 746 746 for(i=1;i<nvars;i++) … … 754 754 { 755 755 int i; 756 int nvars= pVariables;756 int nvars=(currRing->N); 757 757 NoroCacheNode* parent=&root; 758 758 for(i=1;i<nvars;i++) … … 1887 1887 assume(level>=0); 1888 1888 if (node==NULL) return; 1889 if (level< pVariables)1889 if (level<(currRing->N)) 1890 1890 { 1891 1891 int i; … … 1908 1908 int i; 1909 1909 NoroCacheNode* parent=&root; 1910 for(i=1;i< pVariables;i++){1910 for(i=1;i<(currRing->N);i++){ 1911 1911 parent=parent->getBranch(p_GetExp(term,i,currRing)); 1912 1912 if (!(parent)){ … … 1920 1920 int i; 1921 1921 NoroCacheNode* parent=&root; 1922 for(i=1;i< pVariables;i++){1922 for(i=1;i<(currRing->N);i++){ 1923 1923 parent=parent->getBranch(p_GetExp(term,i,currRing)); 1924 1924 if (!(parent)){ -
kernel/walkProc.cc
r6ed8c4 r1f637e 44 44 // and order as parameters of the other 45 45 // 7) none of the rings are qrings 46 // vperm must be a vector of length pVariables+1, initialized by 0.46 // vperm must be a vector of length (currRing->N)+1, initialized by 0. 47 47 // If both rings are compatible, it stores the permutation of the 48 48 // variables if mapped from sringHdl to dringHdl. … … 200 200 // and order as parameters of the other 201 201 // 7) none of the rings are qrings 202 // vperm must be a vector of length pVariables+1, initialized by 0.202 // vperm must be a vector of length (currRing->N)+1, initialized by 0. 203 203 // If both rings are compatible, it stores the permutation of the 204 204 // variables if mapped from sringHdl to dringHdl. -
libpolys/polys/polys.h
r6ed8c4 r1f637e 12 12 13 13 extern ring currRing; 14 extern void rChangeCurrRing(ring r); 15 14 16 /*************************************************************** 15 17 * … … 26 28 27 29 // Component 28 #define pGetComp(p) _ p_GetComp(p, currRing)30 #define pGetComp(p) __p_GetComp(p, currRing) 29 31 #define pSetComp(p,v) p_SetComp(p,v, currRing) 30 32 … … 242 244 * 243 245 ***************************************************************/ 244 #define pWeight(c) p_Weight(c,currRing) 246 inline int pWeight(int i, const ring R = currRing){ return p_Weight(i,R); } 247 245 248 #define pDeg(p) p_Deg(p,currRing) 246 249 static inline long pTotaldegree(poly p) { return p_Totaldegree(p,currRing); }
Note: See TracChangeset
for help on using the changeset viewer.