Changeset a41623 in git
- Timestamp:
- May 27, 2011, 3:52:46 PM (12 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 410ea0fb1e22ebcb52e33b6789cf294a2d1f663b
- Parents:
- 6e80ab1defd5ab31610bce94c4f375be2fec8d0e
- Location:
- kernel
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/clapconv.cc
r6e80ab ra41623 29 29 void out_cf(char *s1,const CanonicalForm &f,char *s2); 30 30 31 static void convRec( const CanonicalForm & f, int * exp, poly & result );32 33 static void convRecAlg( const CanonicalForm & f, int * exp, napoly & result );34 35 31 static void conv_RecPP ( const CanonicalForm & f, int * exp, sBucket_pt result, ring r ); 36 32 -
kernel/clapsing.cc
r6e80ab ra41623 616 616 } 617 617 618 static int primepower(int c)619 {620 int p=1;621 int cc=c;622 while(cc!= rInternalChar(currRing)) { cc*=c; p++; }623 return p;624 }625 626 618 BOOLEAN count_Factors(ideal I, intvec *v,int j, poly &f, poly fac) 627 619 { … … 923 915 for ( ; J.hasItem(); J++, j++ ) 924 916 { 925 poly p;926 917 if (with_exps!=1) (**v)[j] = J.getItem().exp(); 927 918 if (rField_is_Zp() || rField_is_Q()) /* Q, Fp */ … … 1233 1224 for ( ; J.hasItem(); J++, j++ ) 1234 1225 { 1235 poly p;1236 1226 if (rField_is_Zp() || rField_is_Q()) /* Q, Fp */ 1237 1227 //count_Factors(res,*v,f, j, convFactoryPSingP( J.getItem().factor() ); -
kernel/feResource.cc
r6e80ab ra41623 215 215 while (feResourceConfigs[i].key != NULL) 216 216 { 217 if (feResourceConfigs[i].value != "")217 if (feResourceConfigs[i].value[0] != '\0') 218 218 { 219 219 if (feResourceConfigs[i].value != NULL) -
kernel/febase.cc
r6e80ab ra41623 81 81 FILE *feFilePending; /*temp. storage for grammar.y */ 82 82 83 static const char * BT_name[]={"BT_none","BT_break","BT_proc","BT_example",84 "BT_file","BT_execute","BT_if","BT_else"};83 //static const char * BT_name[]={"BT_none","BT_break","BT_proc","BT_example", 84 // "BT_file","BT_execute","BT_if","BT_else"}; 85 85 /*2 86 86 * the name of the current 'Voice': the procname (or filename) … … 1057 1057 #ifdef HAVE_VSNPRINTF 1058 1058 l = vsnprintf(s, ls+511, fmt, ap); 1059 if ((l==-1)||(s[l]!='\0')||(l!= strlen(s)))1059 if ((l==-1)||(s[l]!='\0')||(l!=(int)strlen(s))) 1060 1060 { 1061 1061 printf("Print problem: l=%d, fmt=>>%s<<\n",l,fmt); -
kernel/gring.cc
r6e80ab ra41623 242 242 { 243 243 poly res=NULL; 244 poly ghost=NULL;245 244 poly qq,pp; 246 245 if (copy) … … 589 588 } 590 589 591 number n1=n_Init(1,r);592 590 int *Prv=(int *)omAlloc0((rN+1)*sizeof(int)); 593 591 int *Nxt=(int *)omAlloc0((rN+1)*sizeof(int)); … … 1049 1047 t=MATELEM(cMT,a,b); 1050 1048 assume( t != NULL ); 1051 1049 1052 1050 t= nc_p_CopyGet(t,r); 1053 1051 #ifdef PDEBUG … … 2096 2094 { 2097 2095 poly pp = nc_mm_Mult_pp(m,p,currRing); 2098 number c2 ,cc;2096 number c2 /*,cc*/; 2099 2097 p_Cleardenom_n(pp,currRing,c2); 2100 2098 pDelete(&m); … … 2129 2127 { 2130 2128 poly pp = nc_mm_Mult_pp(m,p,currRing); 2131 number c2 ,cc;2129 number c2; 2132 2130 p_Cleardenom_n(pp,currRing,c2); 2133 2131 pDelete(&m); … … 2300 2298 poly Q=NULL; 2301 2299 number coef=NULL; 2302 poly res=NULL;2303 2300 poly pres=NULL; 2304 2301 int UseBuckets=1; 2305 if ((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2) || TEST_OPT_NOT_BUCKETS) UseBuckets=0; 2302 if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2)) 2303 || TEST_OPT_NOT_BUCKETS) 2304 UseBuckets=0; 2306 2305 2307 2306 … … 2904 2903 assume( curr != NULL ); 2905 2904 2906 if( !bSetupQuotient) 2905 if( !bSetupQuotient) 2907 2906 assume( (r->qideal == NULL) ); // The basering must NOT be a qring!?? 2908 2907 … … 3054 3053 idTest((ideal)C); 3055 3054 #endif 3056 3055 3057 3056 } else 3058 3057 if ( (CN == NULL) && (CC != NULL) ) /* copy matrix C */ … … 3419 3418 int *PRE = (int *)omAlloc0((rN+1)*sizeof(int)); 3420 3419 int *SUF = (int *)omAlloc0((rN+1)*sizeof(int)); 3421 int i, j,pow;3420 int i,pow; 3422 3421 number C; 3423 3422 poly suf,pre; … … 3473 3472 #endif 3474 3473 ideal t = idCopy(T); 3475 int j,rs=idRankFreeModule(s) ,rt=idRankFreeModule(t);3474 int j,rs=idRankFreeModule(s); 3476 3475 poly p,q; 3477 3476 … … 3518 3517 int flag, flagcnt=0, syzcnt=0; 3519 3518 int syzcomp = 0; 3520 int k=1; /* for ideals not modules */3521 3519 ideal I = kStd(L, currQuotient,testHomog,NULL,NULL,0,0,NULL); 3522 3520 idSkipZeroes(I); 3523 3521 ideal s_I; 3524 3522 int idI = idElem(I); 3525 ideal trickyQuotient ,s_trickyQuotient;3523 ideal trickyQuotient; 3526 3524 if (currQuotient !=NULL) 3527 3525 { … … 3538 3536 poly x=pOne(); 3539 3537 var[0]=x; 3540 ideal h2, h3,s_h2, s_h3;3541 poly p,q ,qq;3538 ideal h2, s_h2, s_h3; 3539 poly p,q; 3542 3540 /* init vars */ 3543 3541 for (i=1; i<=N; i++ ) -
kernel/linearAlgebra.cc
r6e80ab ra41623 1 1 /*****************************************************************************\ 2 * Computer Algebra System SINGULAR 2 * Computer Algebra System SINGULAR 3 3 \*****************************************************************************/ 4 4 /** @file lineareAlgebra.cc … … 108 108 int* permut = new int[rr + 1]; 109 109 for (int i = 1; i <= rr; i++) permut[i] = i; 110 110 111 111 /* fill lMat with the (rr x rr) unit matrix */ 112 112 unitMatrix(rr, lMat); … … 234 234 luDecomp(aMat, pMat, lMat, uMat); 235 235 int result = rankFromRowEchelonForm(uMat); 236 236 237 237 /* clean-up */ 238 238 idDelete((ideal*)&pMat); 239 239 idDelete((ideal*)&lMat); 240 240 idDelete((ideal*)&uMat); 241 241 242 242 return result; 243 243 } … … 348 348 const matrix uMat, matrix &iMat) 349 349 { /* uMat is guaranteed to be quadratic */ 350 int d = uMat->rows();350 //int d = uMat->rows(); 351 351 352 352 matrix lMatInverse; /* for storing the inverse of lMat; … … 361 361 lowerLeftTriangleInverse(lMat, lMatInverse, true); 362 362 iMat = mpMult(mpMult(uMatInverse, lMatInverse), pMat); 363 363 364 364 /* clean-up */ 365 365 idDelete((ideal*)&lMatInverse); … … 399 399 pNormalize(MATELEM(yVec, r, 1)); 400 400 } 401 401 402 402 /* determine whether uMat * xVec = yVec is solvable */ 403 403 bool isSolvable = true; … … 541 541 ) 542 542 { 543 number ten = complexNumber(10.0, 0.0); 543 number ten = complexNumber(10.0, 0.0); 544 544 number result = complexNumber(1.0, 0.0); 545 545 number tmp; … … 710 710 number absValue(poly p) 711 711 { 712 713 712 if (p == NULL) return nInit(0); 713 number result = nCopy(pGetCoeff(p)); 714 714 if (!nGreaterZero(result)) result = nNeg(result); 715 715 return result; … … 1044 1044 not zero */ 1045 1045 if ((MATELEM(c,1,1) != NULL) && 1046 ((MATELEM(c,2,1) != NULL) || (MATELEM(c,3,1) != NULL))) 1046 ((MATELEM(c,2,1) != NULL) || (MATELEM(c,3,1) != NULL))) 1047 1047 { 1048 1048 matrix uVec; matrix hMat; … … 1082 1082 ) 1083 1083 { 1084 1085 1086 1084 bool deflationFound = true; 1085 /* we loop until the working queue is empty, 1086 provided we always find deflation */ 1087 1087 while (deflationFound && (queueL > 0)) 1088 1088 { … … 1092 1092 if (m == 1) 1093 1093 { 1094 1095 1094 number newEigenvalue; 1095 /* the entry at [1, 1] is the eigenvalue */ 1096 1096 if (MATELEM(currentMat, 1, 1) == NULL) newEigenvalue = nInit(0); 1097 1097 else newEigenvalue = nCopy(pGetCoeff(MATELEM(currentMat, 1, 1))); … … 1100 1100 else if (m == 2) 1101 1101 { 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1102 /* there are two eigenvalues which come as zeros of the characteristic 1103 polynomial */ 1104 poly p; charPoly(currentMat, p); 1105 number s1; number s2; 1106 int nSol = quadraticSolve(p, s1, s2, tol2); pDelete(&p); 1107 assume(nSol >= 2); 1108 eigenValues[eigenValuesL++] = s1; 1109 /* if nSol = 2, then s1 is a double zero, and s2 is invalid: */ 1110 if (nSol == 2) s2 = nCopy(s1); 1111 eigenValues[eigenValuesL++] = s2; 1112 1112 } 1113 1113 else /* m > 2 */ 1114 1114 { 1115 1116 1117 1118 1119 1120 1121 1122 { 1123 1124 1125 1126 1127 1128 test1 = absValue(MATELEM(currentMat, k + 1, k));1115 /* bring currentMat into Hessenberg form to fasten computations: */ 1116 matrix mm1; matrix mm2; 1117 hessenberg(currentMat, mm1, mm2, tol2); 1118 idDelete((ideal*)¤tMat); idDelete((ideal*)&mm1); 1119 currentMat = mm2; 1120 int it = 1; bool doLoop = true; 1121 while (doLoop && (it <= 30 * m)) 1122 { 1123 /* search for deflation */ 1124 number w1; number w2; 1125 number test1; number test2; bool stopCriterion = false; int k; 1126 for (k = 1; k < m; k++) 1127 { 1128 test1 = absValue(MATELEM(currentMat, k + 1, k)); 1129 1129 w1 = absValue(MATELEM(currentMat, k, k)); 1130 1130 w2 = absValue(MATELEM(currentMat, k + 1, k + 1)); 1131 1131 test2 = nMult(tol1, nAdd(w1, w2)); 1132 1132 nDelete(&w1); nDelete(&w2); … … 1134 1134 nDelete(&test1); nDelete(&test2); 1135 1135 if (stopCriterion) break; 1136 }1136 } 1137 1137 if (k < m) /* found deflation at position (k + 1, k) */ 1138 1138 { 1139 1140 1139 pDelete(&MATELEM(currentMat, k + 1, k)); /* make this entry zero */ 1140 subMatrix(currentMat, 1, k, 1, k, queue[queueL++]); 1141 1141 subMatrix(currentMat, k + 1, m, k + 1, m, queue[queueL++]); 1142 1142 doLoop = false; … … 1144 1144 else /* no deflation found yet */ 1145 1145 { 1146 1147 1146 mpTrafo(currentMat, it, tol2); 1147 it++; /* try again */ 1148 1148 } 1149 1149 } 1150 1150 if (doLoop) /* could not find deflation for currentMat */ 1151 1151 { 1152 1152 deflationFound = false; 1153 1153 } 1154 1154 idDelete((ideal*)¤tMat); … … 1176 1176 ) 1177 1177 { 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1178 int result = -1; 1179 number tt = nMult(tolerance, tolerance); 1180 number nr = (number)new gmp_complex(((gmp_complex*)n)->real()); 1181 number ni = (number)new gmp_complex(((gmp_complex*)n)->imag()); 1182 number rr; number ii; 1183 number w1; number w2; number w3; number w4; number w5; 1184 for (int i = 0; i < nnLength; i++) 1185 { 1186 rr = (number)new gmp_complex(((gmp_complex*)nn[i])->real()); 1187 ii = (number)new gmp_complex(((gmp_complex*)nn[i])->imag()); 1188 w1 = nSub(nr, rr); w2 = nMult(w1, w1); 1189 w3 = nSub(ni, ii); w4 = nMult(w3, w3); 1190 w5 = nAdd(w2, w4); 1191 if (!nGreater(w5, tt)) result = i; 1192 nDelete(&w1); nDelete(&w2); nDelete(&w3); nDelete(&w4); 1193 1193 nDelete(&w5); nDelete(&rr); nDelete(&ii); 1194 1195 1196 1197 1194 if (result != -1) break; 1195 } 1196 nDelete(&tt); nDelete(&nr); nDelete(&ni); 1197 return result; 1198 1198 } 1199 1199 … … 1210 1210 if (!worked) 1211 1211 { 1212 1213 1214 1215 1216 1217 1218 1219 1220 1212 for (int i = 0; i < eigenL; i++) 1213 nDelete(&eigenVs[i]); 1214 delete [] eigenVs; 1215 for (int i = 0; i < queueL; i++) 1216 idDelete((ideal*)&queue[i]); 1217 delete [] queue; 1218 result->Init(1); 1219 result->m[0].rtyp = INT_CMD; 1220 result->m[0].data = (void*)0; /* a list with a single entry 1221 1221 which is the int zero */ 1222 1222 } 1223 1223 else 1224 1224 { 1225 1226 1227 1228 1229 1230 { 1231 1232 1233 1234 1235 1236 1237 1238 1225 /* now eigenVs[0..eigenL-1] contain all eigenvalues; among them, there 1226 may be equal entries */ 1227 number* distinctEVs = new number[n]; int distinctC = 0; 1228 int* mults = new int[n]; 1229 for (int i = 0; i < eigenL; i++) 1230 { 1231 int index = similar(distinctEVs, distinctC, eigenVs[i], tol3); 1232 if (index == -1) /* a new eigenvalue */ 1233 { 1234 distinctEVs[distinctC] = nCopy(eigenVs[i]); 1235 mults[distinctC++] = 1; 1236 } 1237 else mults[index]++; 1238 nDelete(&eigenVs[i]); 1239 1239 } 1240 1240 delete [] eigenVs; 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1241 1242 lists eigenvalues = (lists)omAlloc(sizeof(slists)); 1243 eigenvalues->Init(distinctC); 1244 lists multiplicities = (lists)omAlloc(sizeof(slists)); 1245 multiplicities->Init(distinctC); 1246 for (int i = 0; i < distinctC; i++) 1247 { 1248 eigenvalues->m[i].rtyp = NUMBER_CMD; 1249 eigenvalues->m[i].data = (void*)nCopy(distinctEVs[i]); 1250 multiplicities->m[i].rtyp = INT_CMD; 1251 multiplicities->m[i].data = (void*)mults[i]; 1252 nDelete(&distinctEVs[i]); 1253 } 1254 delete [] distinctEVs; delete [] mults; 1255 1256 result->Init(2); 1257 result->m[0].rtyp = LIST_CMD; 1258 result->m[0].data = (char*)eigenvalues; 1259 result->m[1].rtyp = LIST_CMD; 1260 result->m[1].data = (char*)multiplicities; 1261 1261 } 1262 1262 return result; … … 1273 1273 matrix pMat; matrix lMat; matrix uMat; /* for the decomposition of A */ 1274 1274 f = pCopy(f0); g = pCopy(g0); /* initially: h = f*g mod <x^1> */ 1275 1275 1276 1276 /* initial step: read off coefficients of f0, and g0 */ 1277 1277 poly p = f0; poly matEntry; number c; … … 1310 1310 for (int col = row; col <= m + n; col++) 1311 1311 MATELEM(aMat, row, col) = pCopy(MATELEM(aMat, row - 1, col - 1)); 1312 1312 1313 1313 /* constructing the LU-decomposition of A */ 1314 1314 luDecomp(aMat, pMat, lMat, uMat); 1315 1315 1316 1316 /* Before the xExp-th loop, we know that h = f*g mod <x^xExp>. 1317 1317 Afterwards the algorithm ensures h = f*g mod <x^(xExp + 1)>. … … 1326 1326 matrix bVec = mpNew(n + m, 1); /* b */ 1327 1327 matrix xVec = mpNew(n + m, 1); /* x */ 1328 1328 1329 1329 p = pCopy(fg); 1330 1330 p = pAdd(pCopy(h), pNeg(p)); /* p = h - f*g */ … … 1382 1382 idDelete((ideal*)&bVec); idDelete((ideal*)&xVec); 1383 1383 } 1384 1384 1385 1385 /* clean-up matrices A, P, L and U, and polynomial fg */ 1386 1386 idDelete((ideal*)&aMat); idDelete((ideal*)&pMat); … … 1407 1407 MATELEM(uMat, r, c) = pCopy(MATELEM(aMat, r, c)); 1408 1408 u = pOne(); l = pOne(); 1409 1409 1410 1410 int col = 1; int row = 1; 1411 1411 while ((col <= cc) & (row < rr)) … … 1455 1455 l = pMult(l, pCopy(MATELEM(lMat, row, row))); 1456 1456 u = pMult(u, pCopy(MATELEM(uMat, row, col))); 1457 1457 1458 1458 for (int r = row + 1; r <= rr; r++) 1459 1459 { … … 1494 1494 if (col <= cc) u = pMult(u, pCopy(MATELEM(uMat, row, col))); 1495 1495 } 1496 1496 1497 1497 /* building the permutation matrix from 'permut' and computing l */ 1498 1498 pMat = mpNew(rr, rr); … … 1500 1500 MATELEM(pMat, r, permut[r]) = pOne(); 1501 1501 delete[] permut; 1502 1502 1503 1503 lTimesU = ppMult_qq(l, u); 1504 1504 } … … 1535 1535 q = pNSet(nInvers(pGetCoeff(MATELEM(lMat, r, r)))); 1536 1536 MATELEM(yVec, r, 1) = pMult(pNeg(p), q); 1537 pNormalize(MATELEM(yVec, r, 1)); 1538 } 1539 1537 pNormalize(MATELEM(yVec, r, 1)); 1538 } 1539 1540 1540 /* compute u * dMat * yVec and put result into yVec */ 1541 1541 for (int r = 1; r <= m; r++) … … 1544 1544 MATELEM(yVec, r, 1) = pMult(p, MATELEM(yVec, r, 1)); 1545 1545 } 1546 1546 1547 1547 /* determine whether uMat * xVec = yVec is solvable */ 1548 1548 bool isSolvable = true; … … 1609 1609 lastNonZeroC = nonZeroC; 1610 1610 } 1611 1611 1612 1612 /* divide xVec by l*u = lTimesU and put result in xVec */ 1613 1613 number z = nInvers(pGetCoeff(lTimesU)); … … 1618 1618 } 1619 1619 nDelete(&z); 1620 1620 1621 1621 if (dim == 0) 1622 1622 { -
kernel/p_polys.cc
r6e80ab ra41623 302 302 303 303 #ifndef NDEBUG 304 Print("p_Setm_General: is(-Temp-) :: c: %d, limit: %d, [st:%d] ===>>> % d\n", c, limit, start, p->exp[start]);304 Print("p_Setm_General: is(-Temp-) :: c: %d, limit: %d, [st:%d] ===>>> %ld\n", c, limit, start, p->exp[start]); 305 305 #endif 306 306 -
kernel/ring.cc
r6e80ab ra41623 5505 5505 r->block0[j]=rOppVar(r, src->block1[i]); 5506 5506 r->block1[j]=rOppVar(r, src->block0[i]); 5507 r->wvhdl[j]=r->wvhdl[j+1]; r->wvhdl[j+1]= r->wvhdl[j+1]=NULL;5507 r->wvhdl[j]=r->wvhdl[j+1]; r->wvhdl[j+1]=NULL; 5508 5508 rOppWeight(r->wvhdl[j], r->block1[j]-r->block0[j]); 5509 5509 j++; -
kernel/shiftgb.cc
r6e80ab ra41623 60 60 poly s = p_mLPshift(p, sh, uptodeg, lV, r); // lm in currRing 61 61 poly pp = pNext(p); 62 62 63 63 while (pp != NULL) 64 64 { … … 119 119 120 120 int j; 121 // for (j=1; j<=r->N; j++) 121 // for (j=1; j<=r->N; j++) 122 122 // L*lV gives the last position of the last block 123 123 for (j=1; j<= L*lV ; j++) … … 131 131 } 132 132 #ifdef PDEBUG 133 else 133 else 134 134 { 135 135 if (e[j]!=0) 136 136 { 137 137 // Print("p_mLPshift: ex[%d]=%d\n",j,e[j]); 138 138 } 139 139 } … … 149 149 // p_SetCoeff0(m,p_GetCoeff(p,r),r); 150 150 p_SetComp(m,p_GetComp(p,r),r); // component is preserved 151 p_SetCoeff0(m,p_GetCoeff(p,r),r); // coeff is preserved 151 p_SetCoeff0(m,p_GetCoeff(p,r),r); // coeff is preserved 152 152 return(m); 153 153 } … … 226 226 /* the 0th block is the 1st one */ 227 227 poly q = p; //p_Copy(p,currRing); /* need it ? */ 228 int ans = 0; 228 int ans = 0; 229 229 int ansnew = 0; 230 230 while (q!=NULL) … … 251 251 j = currRing->N; 252 252 while ( (!e[j]) && (j>=1) ) j--; 253 if (j==0) 253 if (j==0) 254 254 { 255 255 #ifdef PDEBUG 256 256 PrintS("pmLastVblock: unexpected zero exponent vector\n"); 257 #endif 257 #endif 258 258 return(j); 259 259 } … … 273 273 274 274 int ans = p_mLastVblock(p, lV, r); // Block of LM 275 poly q = pNext(p); 275 poly q = pNext(p); 276 276 int ansnew = 0; 277 277 while (q != NULL) … … 291 291 /* the 0th block is the 1st one */ 292 292 poly q = p; //p_Copy(p,currRing); /* need it ? */ 293 int ans = 0; 293 int ans = 0; 294 294 int ansnew = 0; 295 295 while (q!=NULL) … … 316 316 j = r->N; 317 317 while ( (!e[j]) && (j>=1) ) j--; 318 if (j==0) 318 if (j==0) 319 319 { 320 320 #ifdef PDEBUG 321 321 PrintS("pmLastVblock: unexpected zero exponent vector\n"); 322 #endif 322 #endif 323 323 return(j); 324 324 } … … 334 334 /* the 0th block is the 1st one */ 335 335 poly q = p; //p_Copy(p,currRing); /* need it ? */ 336 int ans = 0; 336 int ans = 0; 337 337 int ansnew = 0; 338 338 while (q!=NULL) … … 359 359 j = 1; 360 360 while ( (!e[j]) && (j<=currRing->N-1) ) j++; 361 if (j==currRing->N + 1) 361 if (j==currRing->N + 1) 362 362 { 363 363 #ifdef PDEBUG 364 364 PrintS("pmFirstVblock: unexpected zero exponent vector\n"); 365 #endif 365 #endif 366 366 return(j); 367 367 } … … 384 384 int *e = (int *)omAlloc0((currRing->N+1)*sizeof(int)); 385 385 int b = (int)((currRing->N +lV-1)/lV); /* the number of blocks */ 386 //int b = (int)(currRing->N)/lV; 386 //int b = (int)(currRing->N)/lV; 387 387 int *B = (int *)omAlloc0((b+1)*sizeof(int)); /* the num of elements in a block */ 388 388 pGetExpV(p,e); … … 413 413 // } 414 414 /* now B[j] != 0 and we test place-squarefreeness */ 415 for ( j; j>=1; j--)415 for (; j>=1; j--) 416 416 { 417 417 if (B[j]!=1) … … 472 472 i = si_max(i, p_LastVblock(pNext(p), lV, r) ); 473 473 } 474 // i = uptodeg - i +1; 475 i = uptodeg - i; 474 // i = uptodeg - i +1; 475 i = uptodeg - i; 476 476 // p_wrp(p,currRing,r); Print("----i:%d",i); PrintLn(); 477 477 return(i); … … 495 495 poly s = p_mShrink(p, lV, r); // lm in currRing 496 496 poly pp = pNext(p); 497 497 498 498 while (pp != NULL) 499 499 { … … 517 517 poly q = NULL; 518 518 poly pp = p; 519 519 520 520 while (pp != NULL) 521 521 { … … 546 546 for (i=(j-1)*lV + 1; i<= j*lV; i++) 547 547 { 548 if (e[i]==1) 548 if (e[i]==1) 549 549 { 550 550 // B[j] = B[j]+1; // for control in V? 551 551 S[(cnt-1)*lV + (i - (j-1)*lV)] = e[i]; 552 552 /* assuming we are in V, can interrupt here */ … … 568 568 /* p_Setm(s,r); // done by p_SetExpV */ 569 569 p_SetComp(s,p_GetComp(p,r),r); // component is preserved 570 p_SetCoeff(s,p_GetCoeff(p,r),r); // coeff is preserved 570 p_SetCoeff(s,p_GetCoeff(p,r),r); // coeff is preserved 571 571 #ifdef PDEBUG 572 572 // Print("p_mShrink: from "); p_wrp(p,r); Print(" to "); p_wrp(s,r); PrintLn(); -
kernel/tgb.cc
r6e80ab ra41623 76 76 int e=p_GetExp(m,i,r); 77 77 if (e>1) 78 78 { 79 79 p_SetExp(m,i,1,r); 80 80 changed=TRUE; … … 99 99 poly iter=h; 100 100 while(iter) 101 101 { 102 102 pExpVectorSub(iter,div_by); 103 103 pIter(iter); … … 351 351 int i; 352 352 for(i=1;i<c->lastDpBlockStart;i++) 353 353 { 354 354 if (p_GetExp(p,i,r)!=0) 355 355 { 356 356 break; 357 357 } … … 376 376 int i; 377 377 for(i=1;i<c->lastDpBlockStart;i++) 378 378 { 379 379 if (p_GetExp(p,i,r)!=0) 380 380 { 381 381 break; 382 382 } … … 605 605 } 606 606 607 #if 0 //currently unused 607 608 static void finalize_reduction_step(reduction_step* r) 608 609 { 609 610 delete r; 610 611 } 612 #endif 613 #if 0 //currently unused 611 614 static int LObject_better_gen(const void* ap, const void* bp) 612 615 { … … 615 618 return(pLmCmp(a->p,b->p)); 616 619 } 620 #endif 617 621 static int red_object_better_gen(const void* ap, const void* bp) 618 622 { … … 620 624 } 621 625 626 #if 0 //currently unused 622 627 static int pLmCmp_func_inverted(const void* ap1, const void* ap2) 623 628 { … … 627 632 return -pLmCmp(p1,p2); 628 633 } 634 #endif 629 635 630 636 int tgb_pair_better_gen2(const void* ap,const void* bp) … … 853 859 P.p=strat->S[i]; 854 860 P.sev=strat->sevS[i]; 855 int dummy=strat->sl;861 //int dummy=strat->sl; 856 862 //if(kFindDivisibleByInS(strat,&dummy,&P)!=i) 857 863 if (kFindDivisibleByInS_easy(strat,P.p,P.sev)!=i) … … 1057 1063 1058 1064 if (connected[connected_length-1]==to) 1059 1065 { 1060 1066 if (connected_length<c->n) 1061 1067 { 1062 1068 connected[connected_length]=-1; 1063 1069 } … … 1074 1080 { 1075 1081 if (last_cans_pos==c->n) 1076 1082 { 1077 1083 if (connected_length<c->n) 1078 1084 { 1079 1085 connected[connected_length]=-1; 1080 1086 } … … 1085 1091 continue; 1086 1092 if(p_LmShortDivisibleBy(I->m[last_cans_pos],c->short_Exps[last_cans_pos],bound,neg_bounds_short,c->r)) 1087 1093 { 1088 1094 cans[cans_length]=last_cans_pos; 1089 1095 cans_length++; … … 1095 1101 { 1096 1102 if (has_t_rep(connected[i],last_cans_pos,c)) 1097 1103 { 1098 1104 connected[connected_length]=last_cans_pos; 1099 1105 connected_length++; … … 1101 1107 --not_yet_found; 1102 1108 if (connected[connected_length-1]==to) 1103 1109 { 1104 1110 if (connected_length<c->n) 1105 1111 { 1106 1112 connected[connected_length]=-1; 1107 1113 } … … 1192 1198 { 1193 1199 if (c->T_deg_full!=NULL) 1194 1200 { 1195 1201 int s1=c->T_deg_full[j_con[m]]+syz_deg-c->T_deg[j_con[m]]; 1196 1202 if (s1>sugar) continue;} … … 1292 1298 // slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r); 1293 1299 if(!(TEST_V_COEFSTRAT)) 1294 1300 { 1295 1301 wlen_type cs= 1296 1302 coeff_mult_size_estimate( … … 1300 1306 (wlen_type)cs;} 1301 1307 else 1302 1308 { 1303 1309 1304 1310 wlen_type cs= … … 1332 1338 poly iter=h; 1333 1339 while(iter) 1334 1340 { 1335 1341 pExpVectorSub(iter,div_by); 1336 1342 pIter(iter); … … 1344 1350 #define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type)) 1345 1351 // BOOLEAN corr=lenS_correct(c->strat); 1346 BOOLEAN R_found=FALSE;1347 void* hp;1348 1352 int sugar; 1349 1353 int ecart=0; … … 1479 1483 // } 1480 1484 if (c->lengths[i]+c->lengths[j]==3) 1481 1485 { 1482 1486 1483 1487 … … 1508 1512 { 1509 1513 if (c->strat->lenS[iS]>1) 1510 1514 { 1511 1515 //PrintS("O"); 1512 1516 if (TRUE) { … … 1514 1518 add_later(short_s,"O",c); 1515 1519 } 1516 1520 else p_Delete(&short_s,currRing); 1517 1521 } 1518 1522 else … … 1735 1739 loop 1736 1740 { 1737 int dummy=strat->sl;1741 //int dummy=strat->sl; 1738 1742 j=kFindDivisibleByInS_easy(strat,P.p,P.sev); 1739 1743 //j=kFindDivisibleByInS(strat,&dummy,&P); … … 1798 1802 bit_reduce(pNext(h), strat->tailRing); 1799 1803 } 1800 int sl=strat->sl;1801 1804 int i; 1802 1805 int len=pLength(h); … … 1917 1920 return -pLmCmp(*((poly*) a),*((poly*) b)); 1918 1921 } 1922 #if 0 // currently unused 1919 1923 static void unify_terms(poly* terms,int & sum) 1920 1924 { … … 1932 1936 sum=last+1; 1933 1937 } 1938 #endif 1939 #if 0 // currently unused 1934 1940 static void export_mat(number* number_array,int pn, int tn,const char* format_str, int mat_nr) 1935 1941 { … … 1958 1964 fclose(out); 1959 1965 } 1966 #endif 1960 1967 //typedef unsigned short number_type; 1961 1968 … … 2166 2173 { 2167 2174 while(ref_begin!=ref_end) 2168 2175 { 2169 2176 2170 2177 *my_pos=npAddM(*my_pos,npMult(coef,*ref_begin)); … … 2176 2183 { 2177 2184 while(ref_begin!=ref_end) 2178 2185 { 2179 2186 2180 2187 *my_pos=npAddM(*my_pos,*ref_begin); … … 2377 2384 { 2378 2385 if (npIsOne(red.coef)) 2379 2386 { 2380 2387 t=p_Copy(red.p,currRing); 2381 2388 } 2382 2389 else 2383 2390 t=pp_Mult_nn(red.p,red.coef,currRing); 2384 2391 } … … 2617 2624 free_sorted_pair_node(s,c->r); 2618 2625 if(!h) continue; 2619 int len=pLength(h);2620 2626 p[i]=h; 2621 2627 i++; … … 2650 2656 { 2651 2657 if (npPrimeM<65000) 2652 2658 { 2653 2659 noro_step<tgb_uint16>(p,pn,c); 2654 2660 } 2655 2656 2661 else 2662 { 2657 2663 noro_step<tgb_uint32>(p,pn,c); 2658 2664 } … … 2805 2811 loop 2806 2812 { 2807 int dummy=strat->sl;2813 //int dummy=strat->sl; 2808 2814 j=kFindDivisibleByInS_easy(strat,P.p,P.sev);//kFindDivisibleByInS(strat,&dummy,&P); 2809 2815 if (j>=0) … … 2826 2832 #ifdef HAVE_PLURAL 2827 2833 if (nc) 2828 2834 { 2829 2835 nc_BucketPolyRed_Z(P.bucket, strat->S[j], &coef); 2830 2836 } 2831 2837 else 2832 2838 #endif 2833 2839 coef=kBucketPolyRed(P.bucket,strat->S[j], … … 2939 2945 sorted_pair_node** si_array=(sorted_pair_node**) omalloc(s* sizeof(sorted_pair_node*)); 2940 2946 2941 for( unsignedint i = 0; i < s; i++ )2947 for( int i = 0; i < s; i++ ) 2942 2948 { 2943 2949 sorted_pair_node* si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node)); … … 3001 3007 // Print("is homog:%d",c->is_homog); 3002 3008 void* h; 3003 poly hp; 3004 int i,j; 3009 int i; 3005 3010 to_destroy=NULL; 3006 3011 easy_product_crit=0; … … 3097 3102 else 3098 3103 strat->lenSw=NULL; 3099 sorted_pair_node* si;3100 3104 assume(n>0); 3101 3105 add_to_basis_ideal_quotient(I->m[0],this,NULL); … … 3164 3168 sorted_pair_node* s=apairs[piter]; 3165 3169 if (s->i<0) 3166 3170 { 3167 3171 //delayed element 3168 3172 if (s->lcm_of_lm!=NULL) 3169 3173 { 3170 3174 add[pos]=s->lcm_of_lm; 3171 3175 pos++; … … 3273 3277 Print("\nNF:%i product criterion:%i, ext_product criterion:%i \n", c->normal_forms, c->easy_product_crit, c->extended_product_crit); 3274 3278 } 3275 int deleted_form_c_s=0;3276 3279 3277 3280 for(i=0;i<=c->strat->sl;i++) … … 3357 3360 /*int i; 3358 3361 for(i=0;i<IDELEMS(s_h);i++) 3359 3362 { 3360 3363 poly p=s_h->m[i]; 3361 3364 while(p) 3362 3365 { 3363 3366 p_Setm(p,new_ring); 3364 3367 pIter(p); … … 3481 3484 } 3482 3485 } 3486 3487 #if 0 // unused 3483 3488 static int pLcmDeg(poly a, poly b) 3484 3489 { … … 3491 3496 return n; 3492 3497 } 3498 #endif 3493 3499 3494 3500 static void shorten_tails(slimgb_alg* c, poly monom) … … 3558 3564 } 3559 3565 3566 #if 0 // currently unused 3560 3567 static sorted_pair_node* pop_pair(slimgb_alg* c) 3561 3568 { … … 3565 3572 else return (c->apairs[c->pair_top--]); 3566 3573 } 3574 #endif 3567 3575 3568 3576 void slimgb_alg::cleanDegs(int lower, int upper) … … 3602 3610 int j; 3603 3611 for(j=0;j<=strat->sl;j++) 3604 3612 { 3605 3613 if (h==strat->S[j]) 3606 3614 { 3607 3615 int new_pos=simple_posInS(strat, h,len, wlen); 3608 3616 if (strat->lenS) 3609 3617 { 3610 3618 strat->lenS[j]=len; 3611 3619 } 3612 3620 if (strat->lenSw) 3613 3621 { 3614 3622 strat->lenSw[j]=wlen; 3615 3623 } 3616 3624 if (new_pos<j) 3617 3625 { 3618 3626 move_forward_in_S(j,new_pos,strat); 3619 3627 } 3620 3621 3628 else 3629 { 3622 3630 if (new_pos>j) 3623 3631 new_pos=new_pos-1;//is identical with one element … … 3638 3646 { 3639 3647 if (T_deg[i]+T_deg[j]<=upper) 3640 3648 { 3641 3649 now_t_rep(i,j,this); 3642 3650 } … … 3828 3836 } 3829 3837 3838 #if 0 //currently unused 3830 3839 static poly kBucketGcd(kBucket* b, ring r) 3831 3840 { … … 3864 3873 return m; 3865 3874 } 3875 #endif 3866 3876 3867 3877 static inline wlen_type quality_of_pos_in_strat_S(int pos, slimgb_alg* c) … … 3893 3903 if(pLmEqual(c->strat->S[erg.reduce_by],los[erg.to_reduce_u].p)) 3894 3904 { 3895 int i;3896 3905 wlen_type quality_a=quality_of_pos_in_strat_S(erg.reduce_by,c); 3897 3906 int best=erg.to_reduce_u+1; … … 3935 3944 if (erg.to_reduce_u>erg.to_reduce_l) 3936 3945 { 3937 int i;3938 3946 wlen_type quality_a=quality_of_pos_in_strat_S(erg.reduce_by,c); 3939 3947 #ifdef HAVE_PLURAL … … 3950 3958 int b_pos=kBucketCanonicalize(los[best].bucket); 3951 3959 los[best].p=los[best].bucket->buckets[b_pos]; 3952 qc= =pQuality(los[best].bucket->buckets[b_pos],c);3960 qc=pQuality(los[best].bucket->buckets[b_pos],c); 3953 3961 //(best!=erg.to_reduce_u+1) 3954 3962 if(qc<quality_a) … … 4023 4031 best=find_best(los,erg.to_reduce_l,erg.to_reduce_u,qc,c); 4024 4032 4025 int i;4026 4033 if(qc<quality_a) 4027 4034 { … … 4060 4067 PrintS("b"); 4061 4068 poly clear_into; 4062 int dummy_len;4063 4069 int new_length; 4064 4070 int bp=erg.to_reduce_u;//bucket_positon … … 4392 4398 } 4393 4399 4394 kStrategy strat=c->strat;4395 4400 int curr_pos=losl-1; 4396 4401 … … 4404 4409 poly* p_noro=(poly*) omalloc(pn_noro*sizeof(poly)); 4405 4410 for(i=0;i<pn_noro;i++) 4406 4411 { 4407 4412 int dummy_len; 4408 4413 poly p; … … 4412 4417 } 4413 4418 if (npPrimeM<255) 4414 4419 { 4415 4420 noro_step<tgb_uint8>(p_noro,pn_noro,c); 4416 4421 } 4417 4418 4422 else 4423 { 4419 4424 if (npPrimeM<65000) 4420 4425 { 4421 4426 noro_step<tgb_uint16>(p_noro,pn_noro,c); 4422 4427 } 4423 4424 4428 else 4429 { 4425 4430 noro_step<tgb_uint32>(p_noro,pn_noro,c); 4426 4431 } 4427 4432 } 4428 4433 for(i=0;i<pn_noro;i++) 4429 4434 { 4430 4435 los[i].p=p_noro[i]; 4431 4436 los[i].sev=pGetShortExpVector(los[i].p); … … 4445 4450 4446 4451 erg.expand=NULL; 4447 int d=erg.to_reduce_u-erg.to_reduce_l+1;4448 4452 4449 4453 multi_reduction_lls_trick(los,losl,c,erg); 4450 4454 4451 4455 int i; 4452 int len;4453 4456 // wrp(los[erg.to_reduce_u].p); 4454 4457 //PrintLn(); … … 4466 4469 if(los[i].guess_quality(c) 4467 4470 >1.5*delay_factor*max_initial_quality) 4468 4471 { 4469 4472 if (TEST_OPT_PROT) 4470 4473 PrintS("v"); … … 4472 4475 if(los[i].guess_quality(c) 4473 4476 >delay_factor*max_initial_quality) 4474 4477 { 4475 4478 if (TEST_OPT_PROT) 4476 4479 PrintS("."); … … 4591 4594 int i; 4592 4595 //debug start 4593 int im;4594 4596 4595 4597 if(c->eliminationProblem) … … 4705 4707 // pDelete(&m); 4706 4708 } 4707 int i;4708 4709 4709 4710 assume(red_len==pLength(red)); -
kernel/tgb_internal.h
r6e80ab ra41623 314 314 //SOONTREP 315 315 }; 316 static BOOLEAN pair_cmp(sorted_pair_node* a,sorted_pair_node* b);316 //static BOOLEAN pair_cmp(sorted_pair_node* a,sorted_pair_node* b); 317 317 template <class len_type, class set_type> int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set); 318 318 static int add_to_reductors(slimgb_alg* c, poly h, int len, int ecart, BOOLEAN simplified=FALSE); … … 324 324 static void replace_pair(int & i, int & j, slimgb_alg* c); 325 325 //static sorted_pair_node** add_to_basis(poly h, int i, int j,slimgb_alg* c, int* ip=NULL); 326 static void do_this_spoly_stuff(int i,int j,slimgb_alg* c);326 //static void do_this_spoly_stuff(int i,int j,slimgb_alg* c); 327 327 //ideal t_rep_gb(ring r,ideal arg_I); 328 328 ideal do_t_rep_gb(ring r,ideal arg_I, int syz_comp, BOOLEAN F4_mode,int deg_pos); 329 329 static BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, slimgb_alg* state); 330 static int* make_connections(int from, poly bound, slimgb_alg* c);330 //static int* make_connections(int from, poly bound, slimgb_alg* c); 331 331 static int* make_connections(int from, int to, poly bound, slimgb_alg* c); 332 332 void now_t_rep(const int & arg_i, const int & arg_j, slimgb_alg* c); 333 static void soon_t_rep(const int & arg_i, const int & arg_j, slimgb_alg* c);334 static int pLcmDeg(poly a, poly b);333 //static void soon_t_rep(const int & arg_i, const int & arg_j, slimgb_alg* c); 334 //static int pLcmDeg(poly a, poly b); 335 335 static int simple_posInS (kStrategy strat, poly p,int len, wlen_type wlen); 336 static BOOLEAN find_next_pair(slimgb_alg* c, BOOLEAN go_higher=TRUE);337 338 static sorted_pair_node* pop_pair(slimgb_alg* c);339 static BOOLEAN no_pairs(slimgb_alg* c);336 //static BOOLEAN find_next_pair(slimgb_alg* c, BOOLEAN go_higher=TRUE); 337 338 //static sorted_pair_node* pop_pair(slimgb_alg* c); 339 //static BOOLEAN no_pairs(slimgb_alg* c); 340 340 void clean_top_of_pair_list(slimgb_alg* c); 341 341 static void super_clean_top_of_pair_list(slimgb_alg* c); … … 346 346 static poly gcd_of_terms(poly p, ring r); 347 347 static BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, slimgb_alg* c); 348 static poly kBucketGcd(kBucket* b, ring r);348 //static poly kBucketGcd(kBucket* b, ring r); 349 349 static void multi_reduction(red_object* los, int & losl, slimgb_alg* c); 350 350 int slim_nsize(number n, ring r); … … 409 409 410 410 static void multi_reduce_step(find_erg & erg, red_object* r, slimgb_alg* c); 411 static void finalize_reduction_step(reduction_step* r);411 //static void finalize_reduction_step(reduction_step* r); 412 412 413 413 template <class len_type, class set_type> int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set) … … 1008 1008 { 1009 1009 //int j; 1010 const number_type* const coef_array=row;1010 //const number_type* const coef_array=row; 1011 1011 //int* const idx_array=row->idx_array; 1012 1012 //const int len=temp_size; 1013 tgb_uint32 buffer[256];1014 const tgb_uint32 prime=npPrimeM;1013 //tgb_uint32 buffer[256]; 1014 //const tgb_uint32 prime=npPrimeM; 1015 1015 //const tgb_uint32 c=F4mat_to_number_type(coef); 1016 1016 … … 1027 1027 { 1028 1028 //int j; 1029 const number_type* const coef_array=row;1029 //const number_type* const coef_array=row; 1030 1030 //int* const idx_array=row->idx_array; 1031 1031 //const int len=temp_size; 1032 tgb_uint32 buffer[256];1033 const tgb_uint32 prime=npPrimeM;1032 //tgb_uint32 buffer[256]; 1033 //const tgb_uint32 prime=npPrimeM; 1034 1034 //const tgb_uint32 c=F4mat_to_number_type(coef); 1035 1035 … … 1091 1091 SparseRow<number_type>* row=red.ref->row; 1092 1092 number coef=red.coef; 1093 int j;1094 1093 if (row->idx_array) 1095 1094 { … … 1285 1284 CoefIdx<number_type>* pairs=(CoefIdx<number_type>*) cache->tempBuffer; //omalloc(together*sizeof(CoefIdx<number_type>)); 1286 1285 int pos=0; 1287 int j;1288 1286 const number one=npInit(1, currRing); 1289 1287 const number minus_one=npInit(-1, currRing); … … 1393 1391 template<class number_type> SparseRow<number_type> * noro_red_to_non_poly_t(poly p, int &len, NoroCache<number_type>* cache,slimgb_alg* c){ 1394 1392 assume(len==pLength(p)); 1395 poly orig_p=p;1396 1393 if (p==NULL) 1397 1394 { … … 1400 1397 } 1401 1398 1402 number zero=npInit(0,currRing);1403 1399 MonRedResNP<number_type>* mon=(MonRedResNP<number_type>*) omalloc(len*sizeof(MonRedResNP<number_type>)); 1404 1400 int i=0; … … 1410 1406 pNext(t)=NULL; 1411 1407 1412 #ifndef NDEBUG1413 number coef_debug=p_GetCoeff(t,currRing);1414 #endif1415 1408 MonRedResNP<number_type> red=noro_red_mon_to_non_poly(t,cache,c); 1416 if ((red.ref) && (red.ref->row)){ 1409 if ((red.ref) && (red.ref->row)) 1410 { 1417 1411 double act_density=(double) red.ref->row->len; 1418 1412 act_density/=(double) cache->nIrreducibleMonomials; … … 1812 1806 1813 1807 int* old_to_new_indices=(int*) omalloc(cache.nIrreducibleMonomials*sizeof(int)); 1814 for(j=0;j<n;j++){ 1808 for(j=0;j<n;j++) 1809 { 1815 1810 old_to_new_indices[term_nodes[j].node->term_index]=j; 1816 1811 term_nodes[j].node->term_index=j; … … 1823 1818 number_type* number_array=(number_type*) omalloc(n*pn*sizeof(number_type)); 1824 1819 memset(number_array,0,sizeof(number_type)*n*pn); 1825 number zero=npInit(0, currRing); 1826 1827 for(j=0;j<pn;j++){1820 1821 for(j=0;j<pn;j++) 1822 { 1828 1823 int i; 1829 1824 number_type* row=number_array+n*j; 1830 /*for(i=0;i<n;i++){ 1825 /*for(i=0;i<n;i++) 1826 { 1831 1827 row[i]=zero; 1832 1828 }*/ … … 1834 1830 SparseRow<number_type>* srow=srows[j]; 1835 1831 1836 if (srow){ 1832 if (srow) 1833 { 1837 1834 int* const idx_array=srow->idx_array; 1838 1835 number_type* const coef_array=srow->coef_array; 1839 1836 const int len=srow->len; 1840 if (srow->idx_array){ 1841 for(i=0;i<len;i++){ 1837 if (srow->idx_array) 1838 { 1839 for(i=0;i<len;i++) 1840 { 1842 1841 int idx=old_to_new_indices[idx_array[i]]; 1843 1842 row[idx]=F4mat_to_number_type(coef_array[i]); 1844 1843 } 1845 1844 } 1846 else { 1847 for(i=0;i<len;i++){ 1845 else 1846 { 1847 for(i=0;i<len;i++) 1848 { 1848 1849 row[old_to_new_indices[i]]=F4mat_to_number_type(coef_array[i]); 1849 1850 } … … 1853 1854 } 1854 1855 1855 static int export_n=0;1856 //static int export_n=0; 1856 1857 //export_mat(number_array,pn,n,"mat%i.py",++export_n); 1857 1858 simplest_gauss_modp(number_array,pn,n); … … 1885 1886 assume(level>=0); 1886 1887 if (node==NULL) return; 1887 if (level<pVariables){ 1888 int i,sum; 1889 for(i=0;i<node->branches_len;i++){ 1888 if (level<pVariables) 1889 { 1890 int i; 1891 for(i=0;i<node->branches_len;i++) 1892 { 1890 1893 collectIrreducibleMonomials(level+1,node->branches[i],res); 1891 1894 } 1892 } else { 1895 } 1896 else 1897 { 1893 1898 DataNoroCacheNode<number_type>* dn=(DataNoroCacheNode<number_type>*) node; 1894 if (dn->value_len==backLinkCode){ 1899 if (dn->value_len==backLinkCode) 1900 { 1895 1901 res.push_back(dn); 1896 1902 } -
kernel/tgbgauss.cc
r6e80ab ra41623 644 644 mp=(mac_poly*) omalloc(i*sizeof (mac_poly));; 645 645 int z; 646 int z2;647 646 for(z=0;z<i;z++) 648 647 { … … 832 831 while (m!=NULL) 833 832 { 833 #ifndef NDEBUG 834 834 if (currRing==r) {nTest(m->coef);} 835 #endif 835 836 n_Normalize(m->coef,r); 836 837 m=m->next;
Note: See TracChangeset
for help on using the changeset viewer.