Changeset a41623 in git


Ignore:
Timestamp:
May 27, 2011, 3:52:46 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
410ea0fb1e22ebcb52e33b6789cf294a2d1f663b
Parents:
6e80ab1defd5ab31610bce94c4f375be2fec8d0e
Message:
removed dead code, unused variables etc

git-svn-id: file:///usr/local/Singular/svn/trunk@14249 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • kernel/clapconv.cc

    r6e80ab ra41623  
    2929void out_cf(char *s1,const CanonicalForm &f,char *s2);
    3030
    31 static void convRec( const CanonicalForm & f, int * exp, poly & result );
    32 
    33 static void convRecAlg( const CanonicalForm & f, int * exp, napoly & result );
    34 
    3531static void conv_RecPP ( const CanonicalForm & f, int * exp, sBucket_pt result, ring r );
    3632
  • kernel/clapsing.cc

    r6e80ab ra41623  
    616616}
    617617
    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 
    626618BOOLEAN count_Factors(ideal I, intvec *v,int j, poly &f, poly fac)
    627619{
     
    923915    for ( ; J.hasItem(); J++, j++ )
    924916    {
    925       poly p;
    926917      if (with_exps!=1) (**v)[j] = J.getItem().exp();
    927918      if (rField_is_Zp() || rField_is_Q())           /* Q, Fp */
     
    12331224    for ( ; J.hasItem(); J++, j++ )
    12341225    {
    1235       poly p;
    12361226      if (rField_is_Zp() || rField_is_Q())           /* Q, Fp */
    12371227        //count_Factors(res,*v,f, j, convFactoryPSingP( J.getItem().factor() );
  • kernel/feResource.cc

    r6e80ab ra41623  
    215215  while (feResourceConfigs[i].key != NULL)
    216216  {
    217     if (feResourceConfigs[i].value != "")
     217    if (feResourceConfigs[i].value[0] != '\0')
    218218    {
    219219      if (feResourceConfigs[i].value != NULL)
  • kernel/febase.cc

    r6e80ab ra41623  
    8181FILE   *feFilePending; /*temp. storage for grammar.y */
    8282
    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"};
    8585/*2
    8686* the name of the current 'Voice': the procname (or filename)
     
    10571057#ifdef HAVE_VSNPRINTF
    10581058    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)))
    10601060    {
    10611061      printf("Print problem: l=%d, fmt=>>%s<<\n",l,fmt);
  • kernel/gring.cc

    r6e80ab ra41623  
    242242{
    243243  poly res=NULL;
    244   poly ghost=NULL;
    245244  poly qq,pp;
    246245  if (copy)
     
    589588  }
    590589
    591   number n1=n_Init(1,r);
    592590  int *Prv=(int *)omAlloc0((rN+1)*sizeof(int));
    593591  int *Nxt=(int *)omAlloc0((rN+1)*sizeof(int));
     
    10491047  t=MATELEM(cMT,a,b);
    10501048  assume( t != NULL );
    1051  
     1049
    10521050  t= nc_p_CopyGet(t,r);
    10531051#ifdef PDEBUG
     
    20962094  {
    20972095    poly pp = nc_mm_Mult_pp(m,p,currRing);
    2098     number c2,cc;
     2096    number c2 /*,cc*/;
    20992097    p_Cleardenom_n(pp,currRing,c2);
    21002098    pDelete(&m);
     
    21292127  {
    21302128    poly pp = nc_mm_Mult_pp(m,p,currRing);
    2131     number c2,cc;
     2129    number c2;
    21322130    p_Cleardenom_n(pp,currRing,c2);
    21332131    pDelete(&m);
     
    23002298  poly Q=NULL;
    23012299  number coef=NULL;
    2302   poly res=NULL;
    23032300  poly pres=NULL;
    23042301  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;
    23062305
    23072306
     
    29042903  assume( curr != NULL );
    29052904
    2906   if( !bSetupQuotient) 
     2905  if( !bSetupQuotient)
    29072906    assume( (r->qideal == NULL) ); // The basering must NOT be a qring!??
    29082907
     
    30543053    idTest((ideal)C);
    30553054#endif
    3056    
     3055
    30573056  } else
    30583057  if ( (CN == NULL) && (CC != NULL) ) /* copy matrix C */
     
    34193418  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
    34203419  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
    3421   int i,j,pow;
     3420  int i,pow;
    34223421  number C;
    34233422  poly suf,pre;
     
    34733472#endif
    34743473  ideal t = idCopy(T);
    3475   int j,rs=idRankFreeModule(s),rt=idRankFreeModule(t);
     3474  int j,rs=idRankFreeModule(s);
    34763475  poly p,q;
    34773476
     
    35183517  int flag, flagcnt=0, syzcnt=0;
    35193518  int syzcomp = 0;
    3520   int k=1; /* for ideals not modules */
    35213519  ideal I = kStd(L, currQuotient,testHomog,NULL,NULL,0,0,NULL);
    35223520  idSkipZeroes(I);
    35233521  ideal s_I;
    35243522  int idI = idElem(I);
    3525   ideal trickyQuotient,s_trickyQuotient;
     3523  ideal trickyQuotient;
    35263524  if (currQuotient !=NULL)
    35273525  {
     
    35383536  poly x=pOne();
    35393537  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;
    35423540  /* init vars */
    35433541  for (i=1; i<=N; i++ )
  • kernel/linearAlgebra.cc

    r6e80ab ra41623  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file lineareAlgebra.cc
     
    108108  int* permut = new int[rr + 1];
    109109  for (int i = 1; i <= rr; i++) permut[i] = i;
    110  
     110
    111111  /* fill lMat with the (rr x rr) unit matrix */
    112112  unitMatrix(rr, lMat);
     
    234234    luDecomp(aMat, pMat, lMat, uMat);
    235235    int result = rankFromRowEchelonForm(uMat);
    236  
     236
    237237    /* clean-up */
    238238    idDelete((ideal*)&pMat);
    239239    idDelete((ideal*)&lMat);
    240240    idDelete((ideal*)&uMat);
    241  
     241
    242242    return result;
    243243  }
     
    348348                           const matrix uMat, matrix &iMat)
    349349{ /* uMat is guaranteed to be quadratic */
    350   int d = uMat->rows();
     350  //int d = uMat->rows();
    351351
    352352  matrix lMatInverse; /* for storing the inverse of lMat;
     
    361361    lowerLeftTriangleInverse(lMat, lMatInverse, true);
    362362    iMat = mpMult(mpMult(uMatInverse, lMatInverse), pMat);
    363    
     363
    364364    /* clean-up */
    365365    idDelete((ideal*)&lMatInverse);
     
    399399    pNormalize(MATELEM(yVec, r, 1));
    400400  }
    401  
     401
    402402  /* determine whether uMat * xVec = yVec is solvable */
    403403  bool isSolvable = true;
     
    541541                    )
    542542{
    543   number ten = complexNumber(10.0, 0.0); 
     543  number ten = complexNumber(10.0, 0.0);
    544544  number result = complexNumber(1.0, 0.0);
    545545  number tmp;
     
    710710number absValue(poly p)
    711711{
    712         if (p == NULL) return nInit(0);
    713         number result = nCopy(pGetCoeff(p));
     712  if (p == NULL) return nInit(0);
     713  number result = nCopy(pGetCoeff(p));
    714714  if (!nGreaterZero(result)) result = nNeg(result);
    715715  return result;
     
    10441044     not zero */
    10451045  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)))
    10471047  {
    10481048    matrix uVec; matrix hMat;
     
    10821082         )
    10831083{
    1084         bool deflationFound = true;
    1085         /* we loop until the working queue is empty,
    1086            provided we always find deflation */
     1084  bool deflationFound = true;
     1085  /* we loop until the working queue is empty,
     1086     provided we always find deflation */
    10871087  while (deflationFound && (queueL > 0))
    10881088  {
     
    10921092    if (m == 1)
    10931093    {
    1094         number newEigenvalue;
    1095         /* the entry at [1, 1] is the eigenvalue */
     1094      number newEigenvalue;
     1095      /* the entry at [1, 1] is the eigenvalue */
    10961096      if (MATELEM(currentMat, 1, 1) == NULL) newEigenvalue = nInit(0);
    10971097      else newEigenvalue = nCopy(pGetCoeff(MATELEM(currentMat, 1, 1)));
     
    11001100    else if (m == 2)
    11011101    {
    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;
     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;
    11121112    }
    11131113    else /* m > 2 */
    11141114    {
    1115         /* bring currentMat into Hessenberg form to fasten computations: */
    1116         matrix mm1; matrix mm2;
    1117         hessenberg(currentMat, mm1, mm2, tol2);
    1118         idDelete((ideal*)&currentMat); 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));   
     1115      /* bring currentMat into Hessenberg form to fasten computations: */
     1116      matrix mm1; matrix mm2;
     1117      hessenberg(currentMat, mm1, mm2, tol2);
     1118      idDelete((ideal*)&currentMat); 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));
    11291129          w1 = absValue(MATELEM(currentMat, k, k));
    1130           w2 = absValue(MATELEM(currentMat, k + 1, k + 1));
     1130          w2 = absValue(MATELEM(currentMat, k + 1, k + 1));
    11311131          test2 = nMult(tol1, nAdd(w1, w2));
    11321132          nDelete(&w1); nDelete(&w2);
     
    11341134          nDelete(&test1); nDelete(&test2);
    11351135          if (stopCriterion) break;
    1136         }     
     1136        }
    11371137        if (k < m)   /* found deflation at position (k + 1, k) */
    11381138        {
    1139                 pDelete(&MATELEM(currentMat, k + 1, k)); /* make this entry zero */
    1140                 subMatrix(currentMat, 1, k, 1, k, queue[queueL++]);
     1139          pDelete(&MATELEM(currentMat, k + 1, k)); /* make this entry zero */
     1140          subMatrix(currentMat, 1, k, 1, k, queue[queueL++]);
    11411141          subMatrix(currentMat, k + 1, m, k + 1, m, queue[queueL++]);
    11421142          doLoop = false;
     
    11441144        else   /* no deflation found yet */
    11451145        {
    1146                 mpTrafo(currentMat, it, tol2);
    1147                 it++;   /* try again */
     1146          mpTrafo(currentMat, it, tol2);
     1147          it++;   /* try again */
    11481148        }
    11491149      }
    11501150      if (doLoop)   /* could not find deflation for currentMat */
    11511151      {
    1152         deflationFound = false;
     1152        deflationFound = false;
    11531153      }
    11541154      idDelete((ideal*)&currentMat);
     
    11761176           )
    11771177{
    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);
     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);
    11931193                nDelete(&w5); nDelete(&rr); nDelete(&ii);
    1194                 if (result != -1) break;
    1195         }
    1196         nDelete(&tt); nDelete(&nr); nDelete(&ni);
    1197         return result;
     1194    if (result != -1) break;
     1195  }
     1196  nDelete(&tt); nDelete(&nr); nDelete(&ni);
     1197  return result;
    11981198}
    11991199
     
    12101210  if (!worked)
    12111211  {
    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
     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
    12211221                                             which is the int zero */
    12221222  }
    12231223  else
    12241224  {
    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]);
     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]);
    12391239    }
    12401240    delete [] eigenVs;
    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;
     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;
    12611261  }
    12621262  return result;
     
    12731273  matrix pMat; matrix lMat; matrix uMat; /* for the decomposition of A */
    12741274  f = pCopy(f0); g = pCopy(g0);          /* initially: h = f*g mod <x^1> */
    1275  
     1275
    12761276  /* initial step: read off coefficients of f0, and g0 */
    12771277  poly p = f0; poly matEntry; number c;
     
    13101310    for (int col = row; col <= m + n; col++)
    13111311      MATELEM(aMat, row, col) = pCopy(MATELEM(aMat, row - 1, col - 1));
    1312  
     1312
    13131313  /* constructing the LU-decomposition of A */
    13141314  luDecomp(aMat, pMat, lMat, uMat);
    1315  
     1315
    13161316  /* Before the xExp-th loop, we know that h = f*g mod <x^xExp>.
    13171317     Afterwards the algorithm ensures      h = f*g mod <x^(xExp + 1)>.
     
    13261326    matrix bVec = mpNew(n + m, 1);     /* b */
    13271327    matrix xVec = mpNew(n + m, 1);     /* x */
    1328    
     1328
    13291329    p = pCopy(fg);
    13301330    p = pAdd(pCopy(h), pNeg(p));       /* p = h - f*g */
     
    13821382    idDelete((ideal*)&bVec); idDelete((ideal*)&xVec);
    13831383  }
    1384  
     1384
    13851385  /* clean-up matrices A, P, L and U, and polynomial fg */
    13861386  idDelete((ideal*)&aMat); idDelete((ideal*)&pMat);
     
    14071407      MATELEM(uMat, r, c) = pCopy(MATELEM(aMat, r, c));
    14081408  u = pOne(); l = pOne();
    1409  
     1409
    14101410  int col = 1; int row = 1;
    14111411  while ((col <= cc) & (row < rr))
     
    14551455      l = pMult(l, pCopy(MATELEM(lMat, row, row)));
    14561456      u = pMult(u, pCopy(MATELEM(uMat, row, col)));
    1457      
     1457
    14581458      for (int r = row + 1; r <= rr; r++)
    14591459      {
     
    14941494    if (col <= cc) u = pMult(u, pCopy(MATELEM(uMat, row, col)));
    14951495  }
    1496  
     1496
    14971497  /* building the permutation matrix from 'permut' and computing l */
    14981498  pMat = mpNew(rr, rr);
     
    15001500    MATELEM(pMat, r, permut[r]) = pOne();
    15011501  delete[] permut;
    1502  
     1502
    15031503  lTimesU = ppMult_qq(l, u);
    15041504}
     
    15351535    q = pNSet(nInvers(pGetCoeff(MATELEM(lMat, r, r))));
    15361536    MATELEM(yVec, r, 1) = pMult(pNeg(p), q);
    1537     pNormalize(MATELEM(yVec, r, 1));   
    1538   }
    1539  
     1537    pNormalize(MATELEM(yVec, r, 1));
     1538  }
     1539
    15401540  /* compute u * dMat * yVec and put result into yVec */
    15411541  for (int r = 1; r <= m; r++)
     
    15441544    MATELEM(yVec, r, 1) = pMult(p, MATELEM(yVec, r, 1));
    15451545  }
    1546  
     1546
    15471547  /* determine whether uMat * xVec = yVec is solvable */
    15481548  bool isSolvable = true;
     
    16091609      lastNonZeroC = nonZeroC;
    16101610    }
    1611    
     1611
    16121612    /* divide xVec by l*u = lTimesU and put result in xVec */
    16131613    number z = nInvers(pGetCoeff(lTimesU));
     
    16181618    }
    16191619    nDelete(&z);
    1620    
     1620
    16211621    if (dim == 0)
    16221622    {
  • kernel/p_polys.cc

    r6e80ab ra41623  
    302302             
    303303#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]);
    305305#endif       
    306306   
  • kernel/ring.cc

    r6e80ab ra41623  
    55055505        r->block0[j]=rOppVar(r, src->block1[i]);
    55065506        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;
    55085508        rOppWeight(r->wvhdl[j], r->block1[j]-r->block0[j]);
    55095509        j++;
  • kernel/shiftgb.cc

    r6e80ab ra41623  
    6060  poly s   = p_mLPshift(p, sh, uptodeg, lV, r); // lm in currRing
    6161  poly pp = pNext(p);
    62  
     62
    6363  while (pp != NULL)
    6464  {
     
    119119
    120120  int j;
    121   //  for (j=1; j<=r->N; j++) 
     121  //  for (j=1; j<=r->N; j++)
    122122  // L*lV gives the last position of the last block
    123123  for (j=1; j<= L*lV ; j++)
     
    131131    }
    132132#ifdef PDEBUG
    133     else 
     133    else
    134134    {
    135135      if (e[j]!=0)
    136136      {
    137         //         Print("p_mLPshift: ex[%d]=%d\n",j,e[j]);
     137         //         Print("p_mLPshift: ex[%d]=%d\n",j,e[j]);
    138138      }
    139139    }
     
    149149  //  p_SetCoeff0(m,p_GetCoeff(p,r),r);
    150150  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
    152152  return(m);
    153153}
     
    226226  /* the 0th block is the 1st one */
    227227  poly q = p; //p_Copy(p,currRing); /* need it ? */
    228   int ans = 0; 
     228  int ans = 0;
    229229  int ansnew = 0;
    230230  while (q!=NULL)
     
    251251  j = currRing->N;
    252252  while ( (!e[j]) && (j>=1) ) j--;
    253   if (j==0) 
     253  if (j==0)
    254254  {
    255255#ifdef PDEBUG
    256256    PrintS("pmLastVblock: unexpected zero exponent vector\n");
    257 #endif   
     257#endif
    258258    return(j);
    259259  }
     
    273273
    274274  int ans = p_mLastVblock(p, lV, r); // Block of LM
    275   poly q = pNext(p); 
     275  poly q = pNext(p);
    276276  int ansnew = 0;
    277277  while (q != NULL)
     
    291291  /* the 0th block is the 1st one */
    292292  poly q = p; //p_Copy(p,currRing); /* need it ? */
    293   int ans = 0; 
     293  int ans = 0;
    294294  int ansnew = 0;
    295295  while (q!=NULL)
     
    316316  j = r->N;
    317317  while ( (!e[j]) && (j>=1) ) j--;
    318   if (j==0) 
     318  if (j==0)
    319319  {
    320320#ifdef PDEBUG
    321321    PrintS("pmLastVblock: unexpected zero exponent vector\n");
    322 #endif   
     322#endif
    323323    return(j);
    324324  }
     
    334334  /* the 0th block is the 1st one */
    335335  poly q = p; //p_Copy(p,currRing); /* need it ? */
    336   int ans = 0; 
     336  int ans = 0;
    337337  int ansnew = 0;
    338338  while (q!=NULL)
     
    359359  j = 1;
    360360  while ( (!e[j]) && (j<=currRing->N-1) ) j++;
    361   if (j==currRing->N + 1) 
     361  if (j==currRing->N + 1)
    362362  {
    363363#ifdef PDEBUG
    364364    PrintS("pmFirstVblock: unexpected zero exponent vector\n");
    365 #endif   
     365#endif
    366366    return(j);
    367367  }
     
    384384  int *e = (int *)omAlloc0((currRing->N+1)*sizeof(int));
    385385  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;
    387387  int *B = (int *)omAlloc0((b+1)*sizeof(int)); /* the num of elements in a block */
    388388  pGetExpV(p,e);
     
    413413//   }
    414414  /* now B[j] != 0 and we test place-squarefreeness */
    415   for (j; j>=1; j--)
     415  for (; j>=1; j--)
    416416  {
    417417    if (B[j]!=1)
     
    472472    i = si_max(i, p_LastVblock(pNext(p), lV, r) );
    473473  }
    474   //  i = uptodeg  - i +1; 
    475   i = uptodeg  - i; 
     474  //  i = uptodeg  - i +1;
     475  i = uptodeg  - i;
    476476  //  p_wrp(p,currRing,r); Print("----i:%d",i); PrintLn();
    477477  return(i);
     
    495495  poly s   = p_mShrink(p, lV, r); // lm in currRing
    496496  poly pp = pNext(p);
    497  
     497
    498498  while (pp != NULL)
    499499  {
     
    517517  poly q = NULL;
    518518  poly pp = p;
    519  
     519
    520520  while (pp != NULL)
    521521  {
     
    546546    for (i=(j-1)*lV + 1; i<= j*lV; i++)
    547547    {
    548       if (e[i]==1) 
     548      if (e[i]==1)
    549549      {
    550         //      B[j] = B[j]+1; // for control in V?
     550         //      B[j] = B[j]+1; // for control in V?
    551551         S[(cnt-1)*lV + (i - (j-1)*lV)] = e[i];
    552552         /* assuming we are in V, can interrupt here */
     
    568568  /*  p_Setm(s,r); // done by p_SetExpV */
    569569  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
    571571#ifdef PDEBUG
    572572  //  Print("p_mShrink: from "); p_wrp(p,r); Print(" to "); p_wrp(s,r); PrintLn();
  • kernel/tgb.cc

    r6e80ab ra41623  
    7676        int e=p_GetExp(m,i,r);
    7777        if (e>1)
    78         {
     78        {
    7979            p_SetExp(m,i,1,r);
    8080            changed=TRUE;
     
    9999         poly iter=h;
    100100         while(iter)
    101         {
     101        {
    102102            pExpVectorSub(iter,div_by);
    103103            pIter(iter);
     
    351351        int i;
    352352        for(i=1;i<c->lastDpBlockStart;i++)
    353         {
     353        {
    354354            if (p_GetExp(p,i,r)!=0)
    355             {
     355            {
    356356                break;
    357357            }
     
    376376        int i;
    377377        for(i=1;i<c->lastDpBlockStart;i++)
    378         {
     378        {
    379379            if (p_GetExp(p,i,r)!=0)
    380             {
     380            {
    381381                break;
    382382            }
     
    605605}
    606606
     607#if 0 //currently unused
    607608static void finalize_reduction_step(reduction_step* r)
    608609{
    609610  delete r;
    610611}
     612#endif
     613#if 0 //currently unused
    611614static int LObject_better_gen(const void* ap, const void* bp)
    612615{
     
    615618  return(pLmCmp(a->p,b->p));
    616619}
     620#endif
    617621static int red_object_better_gen(const void* ap, const void* bp)
    618622{
     
    620624}
    621625
     626#if 0 //currently unused
    622627static int pLmCmp_func_inverted(const void* ap1, const void* ap2)
    623628{
     
    627632  return -pLmCmp(p1,p2);
    628633}
     634#endif
    629635
    630636int tgb_pair_better_gen2(const void* ap,const void* bp)
     
    853859    P.p=strat->S[i];
    854860    P.sev=strat->sevS[i];
    855     int dummy=strat->sl;
     861    //int dummy=strat->sl;
    856862    //if(kFindDivisibleByInS(strat,&dummy,&P)!=i)
    857863    if (kFindDivisibleByInS_easy(strat,P.p,P.sev)!=i)
     
    10571063
    10581064          if (connected[connected_length-1]==to)
    1059           {
     1065          {
    10601066            if (connected_length<c->n)
    1061             {
     1067            {
    10621068              connected[connected_length]=-1;
    10631069            }
     
    10741080      {
    10751081        if (last_cans_pos==c->n)
    1076         {
     1082        {
    10771083          if (connected_length<c->n)
    1078           {
     1084          {
    10791085            connected[connected_length]=-1;
    10801086          }
     
    10851091          continue;
    10861092        if(p_LmShortDivisibleBy(I->m[last_cans_pos],c->short_Exps[last_cans_pos],bound,neg_bounds_short,c->r))
    1087         {
     1093        {
    10881094          cans[cans_length]=last_cans_pos;
    10891095          cans_length++;
     
    10951101      {
    10961102        if (has_t_rep(connected[i],last_cans_pos,c))
    1097         {
     1103        {
    10981104          connected[connected_length]=last_cans_pos;
    10991105          connected_length++;
     
    11011107          --not_yet_found;
    11021108          if (connected[connected_length-1]==to)
    1103           {
     1109          {
    11041110            if (connected_length<c->n)
    1105             {
     1111            {
    11061112              connected[connected_length]=-1;
    11071113            }
     
    11921198    {
    11931199        if (c->T_deg_full!=NULL)
    1194         {
     1200        {
    11951201        int s1=c->T_deg_full[j_con[m]]+syz_deg-c->T_deg[j_con[m]];
    11961202        if (s1>sugar) continue;}
     
    12921298        //    slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r);
    12931299        if(!(TEST_V_COEFSTRAT))
    1294         {
     1300        {
    12951301        wlen_type cs=
    12961302            coeff_mult_size_estimate(
     
    13001306            (wlen_type)cs;}
    13011307            else
    1302             {
     1308            {
    13031309
    13041310            wlen_type cs=
     
    13321338         poly iter=h;
    13331339         while(iter)
    1334         {
     1340        {
    13351341            pExpVectorSub(iter,div_by);
    13361342            pIter(iter);
     
    13441350#define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))
    13451351//  BOOLEAN corr=lenS_correct(c->strat);
    1346   BOOLEAN R_found=FALSE;
    1347   void* hp;
    13481352  int sugar;
    13491353  int ecart=0;
     
    14791483//         }
    14801484        if (c->lengths[i]+c->lengths[j]==3)
    1481         {
     1485        {
    14821486
    14831487
     
    15081512                {
    15091513                    if (c->strat->lenS[iS]>1)
    1510                     {
     1514                    {
    15111515                        //PrintS("O");
    15121516                        if (TRUE) {
     
    15141518                        add_later(short_s,"O",c);
    15151519                        }
    1516                         else p_Delete(&short_s,currRing);
     1520                        else p_Delete(&short_s,currRing);
    15171521                    }
    15181522                    else
     
    17351739  loop
    17361740  {
    1737       int dummy=strat->sl;
     1741      //int dummy=strat->sl;
    17381742      j=kFindDivisibleByInS_easy(strat,P.p,P.sev);
    17391743      //j=kFindDivisibleByInS(strat,&dummy,&P);
     
    17981802    bit_reduce(pNext(h), strat->tailRing);
    17991803  }
    1800   int sl=strat->sl;
    18011804  int i;
    18021805  int len=pLength(h);
     
    19171920  return -pLmCmp(*((poly*) a),*((poly*) b));
    19181921}
     1922#if 0 // currently unused
    19191923static void unify_terms(poly* terms,int & sum)
    19201924{
     
    19321936  sum=last+1;
    19331937}
     1938#endif
     1939#if 0 // currently unused
    19341940static void export_mat(number* number_array,int pn, int tn,const char* format_str, int mat_nr)
    19351941{
     
    19581964  fclose(out);
    19591965}
     1966#endif
    19601967//typedef unsigned short number_type;
    19611968
     
    21662173      {
    21672174        while(ref_begin!=ref_end)
    2168         {
     2175        {
    21692176
    21702177          *my_pos=npAddM(*my_pos,npMult(coef,*ref_begin));
     
    21762183      {
    21772184        while(ref_begin!=ref_end)
    2178         {
     2185        {
    21792186
    21802187          *my_pos=npAddM(*my_pos,*ref_begin);
     
    23772384      {
    23782385        if (npIsOne(red.coef))
    2379         {
     2386        {
    23802387          t=p_Copy(red.p,currRing);
    23812388        }
    2382         else
     2389        else
    23832390        t=pp_Mult_nn(red.p,red.coef,currRing);
    23842391      }
     
    26172624    free_sorted_pair_node(s,c->r);
    26182625    if(!h) continue;
    2619     int len=pLength(h);
    26202626    p[i]=h;
    26212627    i++;
     
    26502656      {
    26512657        if (npPrimeM<65000)
    2652         {
     2658        {
    26532659          noro_step<tgb_uint16>(p,pn,c);
    26542660        }
    2655         else
    2656         {
     2661        else
     2662        {
    26572663          noro_step<tgb_uint32>(p,pn,c);
    26582664        }
     
    28052811      loop
    28062812      {
    2807           int dummy=strat->sl;
     2813          //int dummy=strat->sl;
    28082814          j=kFindDivisibleByInS_easy(strat,P.p,P.sev);//kFindDivisibleByInS(strat,&dummy,&P);
    28092815          if (j>=0)
     
    28262832#ifdef HAVE_PLURAL
    28272833            if (nc)
    2828             {
     2834            {
    28292835              nc_BucketPolyRed_Z(P.bucket, strat->S[j], &coef);
    28302836            }
    2831             else
     2837            else
    28322838#endif
    28332839              coef=kBucketPolyRed(P.bucket,strat->S[j],
     
    29392945    sorted_pair_node** si_array=(sorted_pair_node**) omalloc(s* sizeof(sorted_pair_node*));
    29402946
    2941     for( unsigned int i = 0; i < s; i++ )
     2947    for( int i = 0; i < s; i++ )
    29422948    {
    29432949        sorted_pair_node* si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
     
    30013007  //  Print("is homog:%d",c->is_homog);
    30023008  void* h;
    3003   poly hp;
    3004   int i,j;
     3009  int i;
    30053010  to_destroy=NULL;
    30063011  easy_product_crit=0;
     
    30973102  else
    30983103    strat->lenSw=NULL;
    3099   sorted_pair_node* si;
    31003104  assume(n>0);
    31013105  add_to_basis_ideal_quotient(I->m[0],this,NULL);
     
    31643168        sorted_pair_node* s=apairs[piter];
    31653169        if (s->i<0)
    3166         {
     3170        {
    31673171            //delayed element
    31683172            if (s->lcm_of_lm!=NULL)
    3169             {
     3173            {
    31703174                add[pos]=s->lcm_of_lm;
    31713175                pos++;
     
    32733277      Print("\nNF:%i product criterion:%i, ext_product criterion:%i \n", c->normal_forms, c->easy_product_crit, c->extended_product_crit);
    32743278  }
    3275   int deleted_form_c_s=0;
    32763279
    32773280  for(i=0;i<=c->strat->sl;i++)
     
    33573360        /*int i;
    33583361        for(i=0;i<IDELEMS(s_h);i++)
    3359         {
     3362        {
    33603363            poly p=s_h->m[i];
    33613364            while(p)
    3362             {
     3365            {
    33633366                p_Setm(p,new_ring);
    33643367                pIter(p);
     
    34813484  }
    34823485}
     3486
     3487#if 0 // unused
    34833488static int pLcmDeg(poly a, poly b)
    34843489{
     
    34913496  return n;
    34923497}
     3498#endif
    34933499
    34943500static void shorten_tails(slimgb_alg* c, poly monom)
     
    35583564}
    35593565
     3566#if 0 // currently unused
    35603567static sorted_pair_node* pop_pair(slimgb_alg* c)
    35613568{
     
    35653572  else return (c->apairs[c->pair_top--]);
    35663573}
     3574#endif
    35673575
    35683576void slimgb_alg::cleanDegs(int lower, int upper)
     
    36023610          int j;
    36033611          for(j=0;j<=strat->sl;j++)
    3604           {
     3612          {
    36053613            if (h==strat->S[j])
    3606             {
     3614            {
    36073615              int new_pos=simple_posInS(strat, h,len, wlen);
    36083616              if (strat->lenS)
    3609               {
     3617              {
    36103618                strat->lenS[j]=len;
    36113619              }
    36123620              if (strat->lenSw)
    3613               {
     3621              {
    36143622                strat->lenSw[j]=wlen;
    36153623              }
    36163624              if (new_pos<j)
    3617               {
     3625              {
    36183626                move_forward_in_S(j,new_pos,strat);
    36193627              }
    3620               else
    3621               {
     3628              else
     3629              {
    36223630                if (new_pos>j)
    36233631                 new_pos=new_pos-1;//is identical with one element
     
    36383646      {
    36393647        if (T_deg[i]+T_deg[j]<=upper)
    3640         {
     3648        {
    36413649          now_t_rep(i,j,this);
    36423650        }
     
    38283836}
    38293837
     3838#if 0 //currently unused
    38303839static poly kBucketGcd(kBucket* b, ring r)
    38313840{
     
    38643873  return m;
    38653874}
     3875#endif
    38663876
    38673877static inline wlen_type quality_of_pos_in_strat_S(int pos, slimgb_alg* c)
     
    38933903    if(pLmEqual(c->strat->S[erg.reduce_by],los[erg.to_reduce_u].p))
    38943904    {
    3895       int i;
    38963905      wlen_type quality_a=quality_of_pos_in_strat_S(erg.reduce_by,c);
    38973906      int best=erg.to_reduce_u+1;
     
    39353944      if (erg.to_reduce_u>erg.to_reduce_l)
    39363945      {
    3937   int i;
    39383946  wlen_type quality_a=quality_of_pos_in_strat_S(erg.reduce_by,c);
    39393947  #ifdef HAVE_PLURAL
     
    39503958    int b_pos=kBucketCanonicalize(los[best].bucket);
    39513959    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);
    39533961    //(best!=erg.to_reduce_u+1)
    39543962    if(qc<quality_a)
     
    40234031      best=find_best(los,erg.to_reduce_l,erg.to_reduce_u,qc,c);
    40244032
    4025       int i;
    40264033      if(qc<quality_a)
    40274034      {
     
    40604067      PrintS("b");
    40614068    poly clear_into;
    4062     int dummy_len;
    40634069    int new_length;
    40644070    int bp=erg.to_reduce_u;//bucket_positon
     
    43924398  }
    43934399
    4394   kStrategy strat=c->strat;
    43954400  int curr_pos=losl-1;
    43964401
     
    44044409        poly* p_noro=(poly*) omalloc(pn_noro*sizeof(poly));
    44054410        for(i=0;i<pn_noro;i++)
    4406         {
     4411        {
    44074412            int dummy_len;
    44084413            poly p;
     
    44124417        }
    44134418        if (npPrimeM<255)
    4414         {
     4419        {
    44154420          noro_step<tgb_uint8>(p_noro,pn_noro,c);
    44164421        }
    4417         else
    4418         {
     4422        else
     4423        {
    44194424          if (npPrimeM<65000)
    4420           {
     4425          {
    44214426            noro_step<tgb_uint16>(p_noro,pn_noro,c);
    44224427          }
    4423           else
    4424           {
     4428          else
     4429          {
    44254430            noro_step<tgb_uint32>(p_noro,pn_noro,c);
    44264431          }
    44274432        }
    44284433        for(i=0;i<pn_noro;i++)
    4429         {
     4434        {
    44304435            los[i].p=p_noro[i];
    44314436            los[i].sev=pGetShortExpVector(los[i].p);
     
    44454450
    44464451    erg.expand=NULL;
    4447     int d=erg.to_reduce_u-erg.to_reduce_l+1;
    44484452
    44494453    multi_reduction_lls_trick(los,losl,c,erg);
    44504454
    44514455    int i;
    4452     int len;
    44534456    //    wrp(los[erg.to_reduce_u].p);
    44544457    //PrintLn();
     
    44664469               if(los[i].guess_quality(c)
    44674470                  >1.5*delay_factor*max_initial_quality)
    4468                   {
     4471                  {
    44694472                       if (TEST_OPT_PROT)
    44704473                           PrintS("v");
     
    44724475                       if(los[i].guess_quality(c)
    44734476                           >delay_factor*max_initial_quality)
    4474                            {
     4477                           {
    44754478                               if (TEST_OPT_PROT)
    44764479                                   PrintS(".");
     
    45914594  int i;
    45924595//debug start
    4593   int im;
    45944596
    45954597  if(c->eliminationProblem)
     
    47054707    // pDelete(&m);
    47064708  }
    4707   int i;
    47084709
    47094710  assume(red_len==pLength(red));
  • kernel/tgb_internal.h

    r6e80ab ra41623  
    314314    //SOONTREP
    315315  };
    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);
    317317template <class len_type, class set_type>  int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set);
    318318static int add_to_reductors(slimgb_alg* c, poly h, int len, int ecart, BOOLEAN simplified=FALSE);
     
    324324static void replace_pair(int & i, int & j, slimgb_alg* c);
    325325//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);
    327327//ideal t_rep_gb(ring r,ideal arg_I);
    328328ideal do_t_rep_gb(ring r,ideal arg_I, int syz_comp, BOOLEAN F4_mode,int deg_pos);
    329329static 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);
    331331static int* make_connections(int from, int to, poly bound, slimgb_alg* c);
    332332void 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);
    335335static 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);
    340340void clean_top_of_pair_list(slimgb_alg* c);
    341341static void super_clean_top_of_pair_list(slimgb_alg* c);
     
    346346static poly gcd_of_terms(poly p, ring r);
    347347static 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);
    349349static void multi_reduction(red_object* los, int & losl, slimgb_alg* c);
    350350int slim_nsize(number n, ring r);
     
    409409
    410410static 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);
    412412
    413413template <class len_type, class set_type>  int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set)
     
    10081008{
    10091009  //int j;
    1010   const number_type* const coef_array=row;
     1010  //const number_type* const coef_array=row;
    10111011  //int* const idx_array=row->idx_array;
    10121012  //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;
    10151015  //const tgb_uint32 c=F4mat_to_number_type(coef);
    10161016
     
    10271027{
    10281028  //int j;
    1029   const number_type* const coef_array=row;
     1029  //const number_type* const coef_array=row;
    10301030  //int* const idx_array=row->idx_array;
    10311031  //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;
    10341034  //const tgb_uint32 c=F4mat_to_number_type(coef);
    10351035
     
    10911091         SparseRow<number_type>* row=red.ref->row;
    10921092         number coef=red.coef;
    1093          int j;
    10941093         if (row->idx_array)
    10951094         {
     
    12851284  CoefIdx<number_type>* pairs=(CoefIdx<number_type>*) cache->tempBuffer; //omalloc(together*sizeof(CoefIdx<number_type>));
    12861285  int pos=0;
    1287   int j;
    12881286  const number one=npInit(1, currRing);
    12891287  const number minus_one=npInit(-1, currRing);
     
    13931391template<class number_type> SparseRow<number_type> * noro_red_to_non_poly_t(poly p, int &len, NoroCache<number_type>* cache,slimgb_alg* c){
    13941392  assume(len==pLength(p));
    1395   poly orig_p=p;
    13961393  if (p==NULL)
    13971394  {
     
    14001397  }
    14011398
    1402   number zero=npInit(0,currRing);
    14031399  MonRedResNP<number_type>* mon=(MonRedResNP<number_type>*) omalloc(len*sizeof(MonRedResNP<number_type>));
    14041400  int i=0;
     
    14101406    pNext(t)=NULL;
    14111407
    1412 #ifndef NDEBUG
    1413     number coef_debug=p_GetCoeff(t,currRing);
    1414 #endif
    14151408    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    {
    14171411      double act_density=(double) red.ref->row->len;
    14181412      act_density/=(double) cache->nIrreducibleMonomials;
     
    18121806
    18131807  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  {
    18151810    old_to_new_indices[term_nodes[j].node->term_index]=j;
    18161811    term_nodes[j].node->term_index=j;
     
    18231818  number_type* number_array=(number_type*) omalloc(n*pn*sizeof(number_type));
    18241819  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  {
    18281823    int i;
    18291824    number_type* row=number_array+n*j;
    1830     /*for(i=0;i<n;i++){
     1825    /*for(i=0;i<n;i++)
     1826    {
    18311827      row[i]=zero;
    18321828    }*/
     
    18341830    SparseRow<number_type>* srow=srows[j];
    18351831
    1836     if (srow){
     1832    if (srow)
     1833    {
    18371834      int* const idx_array=srow->idx_array;
    18381835      number_type* const coef_array=srow->coef_array;
    18391836      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        {
    18421841         int idx=old_to_new_indices[idx_array[i]];
    18431842         row[idx]=F4mat_to_number_type(coef_array[i]);
    18441843        }
    18451844      }
    1846       else {
    1847         for(i=0;i<len;i++){
     1845      else
     1846      {
     1847        for(i=0;i<len;i++)
     1848        {
    18481849          row[old_to_new_indices[i]]=F4mat_to_number_type(coef_array[i]);
    18491850        }
     
    18531854  }
    18541855
    1855   static int export_n=0;
     1856  //static int export_n=0;
    18561857  //export_mat(number_array,pn,n,"mat%i.py",++export_n);
    18571858  simplest_gauss_modp(number_array,pn,n);
     
    18851886  assume(level>=0);
    18861887  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    {
    18901893      collectIrreducibleMonomials(level+1,node->branches[i],res);
    18911894    }
    1892   } else {
     1895  }
     1896  else
     1897  {
    18931898    DataNoroCacheNode<number_type>* dn=(DataNoroCacheNode<number_type>*) node;
    1894     if (dn->value_len==backLinkCode){
     1899    if (dn->value_len==backLinkCode)
     1900    {
    18951901      res.push_back(dn);
    18961902    }
  • kernel/tgbgauss.cc

    r6e80ab ra41623  
    644644  mp=(mac_poly*) omalloc(i*sizeof (mac_poly));;
    645645  int z;
    646   int z2;
    647646  for(z=0;z<i;z++)
    648647  {
     
    832831    while (m!=NULL)
    833832    {
     833      #ifndef NDEBUG
    834834      if (currRing==r) {nTest(m->coef);}
     835      #endif
    835836      n_Normalize(m->coef,r);
    836837      m=m->next;
Note: See TracChangeset for help on using the changeset viewer.