Changeset e342a2 in git


Ignore:
Timestamp:
Oct 24, 2006, 11:45:22 AM (18 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6e08adb429cbbf3773369df68b06629870822290
Parents:
3a8d345bf7b5a2c27d4d61b0d414df5302626e75
Message:
kutil.cc:
* changes on creating of zero polys

kstd2.cc:
* HAVE_VANGB new switch for gb with or without zeropolys


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

Legend:

Unmodified
Added
Removed
  • kernel/kstd2.cc

    r3a8d345 re342a2  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.24 2006-10-17 16:17:53 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.25 2006-10-24 09:45:22 wienand Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    317317  int j = 0;
    318318  int pass = 0;
    319   poly zeroPoly;
     319  poly zeroPoly = NULL;
    320320
    321321// TODO warum SetpFDeg notwendig?
     
    333333#ifdef HAVE_VANGB
    334334    zeroPoly = kFindDivisibleByZeroPoly(h);
    335 #else
    336     zeroPoly = NULL;
    337 #endif
    338335    if (zeroPoly != NULL)
    339336    {
     
    358355    }
    359356    else
     357#endif
    360358    {
    361359      j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     
    378376
    379377    ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat);
     378#ifdef HAVE_VANGB
    380379    if (zeroPoly != NULL)
    381380    {
     
    383382      strat->tl--;
    384383    }
     384#endif
    385385
    386386#ifdef KDEBUG
  • kernel/kutil.cc

    r3a8d345 re342a2  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.33 2006-10-17 16:17:53 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.34 2006-10-24 09:45:22 wienand Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    20902090/* Helper for kCreateZeroPoly
    20912091 * enumerating the exponents
     2092ring r = 2^2, (a, b, c), lp; ideal G0 = system("createG0"); ideal G = interred(G0); ncols(G0); ncols(G);
    20922093 */
    20932094
    2094 int nextZeroSimplexExponent (long exp[], long ind[], long cexp[], long cind[], long* cabsind, long bound, long N)
     2095int nextZeroSimplexExponent (long exp[], long ind[], long cexp[], long cind[], long* cabsind, long step[], long bound, long N)
    20952096/* gives the next exponent from the set H_1 */
    20962097{
    2097   if (*cabsind < bound)
     2098  long add = ind2(cexp[1] + 2);
     2099  if ((*cabsind < bound) && (*cabsind - step[1] + add < bound))
    20982100  {
    20992101    cexp[1] += 2;
    2100     long add = ind2(cexp[1]);
    21012102    cind[1] += add;
    21022103    *cabsind += add;
     
    21112112    *cabsind -= cind[i];
    21122113    cind[i] = ind[i];
     2114    step[i] = 500000;
    21132115    *cabsind += cind[i];
    21142116    // Print("in: %d\n", *cabsind);
    21152117    i += 1;
    21162118    if (i > N) return 0;
     2119    do
     2120    {
     2121      step[1] = 500000;
     2122      for (int j = i + 1; j <= N; j++)
     2123      {
     2124        if (step[1] > step[j]) step[1] = step[j];
     2125      }
     2126      add = ind2(cexp[i] + 2);
     2127      if (*cabsind - step[1] + add >= bound)
     2128      {
     2129        cexp[i] = exp[i];
     2130        *cabsind -= cind[i];
     2131        cind[i] = ind[i];
     2132        *cabsind += cind[i];
     2133        step[i] = 500000;
     2134        i += 1;
     2135        if (i > N) return 0;
     2136      }
     2137      else step[1] = -1;
     2138    } while (step[1] != -1);
     2139    step[1] = 500000;
    21172140    cexp[i] += 2;
    2118     long add = ind2(cexp[i]);
    21192141    cind[i] += add;
    21202142    *cabsind += add;
     2143    if (add < step[i]) step[i] = add;
     2144    for (i = 2; i <= N; i++)
     2145    {
     2146      if (step[1] > step[i]) step[1] = step[i];
     2147    }
    21212148  }
    21222149  return 1;
     
    22052232  long cabsind = 0;        // The abs. index of cexp, i.e. the sum of cind
    22062233  long habsind = 0;        // The abs. index of the coefficient of h
     2234  long step[50];           // The last increases
    22072235  for (int i = 1; i <= currRing->N; i++)
    22082236  {
     
    22172245    cabsind += ind[i];
    22182246    cind[i] = ind[i];
    2219   }
     2247    step[i] = 500000;
     2248  }
     2249  step[1] = 500000;
    22202250  habsind = ind2((long) p_GetCoeff(p, currRing));
    22212251  long bound = currRing->ch - habsind;
     
    22312261  if (cabsind == 0)
    22322262  {
    2233     if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N)))
     2263    if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N)))
    22342264    {
    22352265      return;
     
    22512281    enterOneZeroPairRing(zeroPoly, t_p, p, ecart, strat, atR);
    22522282  }
    2253   while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N) );
     2283  while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N) );
    22542284}
    22552285
     
    22682298  long cabsind = 0;        // The abs. index of cexp, i.e. the sum of cind
    22692299  long habsind = 0;        // The abs. index of the coefficient of h
     2300  long step[50];           // The last increases
    22702301  for (int i = 1; i <= currRing->N; i++)
    22712302  {
     
    22732304    cexp[i] = exp[i];
    22742305    ind[i] = 0;
     2306    step[i] = 500000;
    22752307    cind[i] = ind[i];
    22762308  }
    22772309  long bound = currRing->ch;
     2310  step[1] = 500000;
    22782311#ifdef OLI_DEBUG
    22792312  PrintS("-------------\npoly  :");
     
    22872320  if (cabsind == 0)
    22882321  {
    2289     if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N)))
     2322    if (!(nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N)))
    22902323    {
    22912324      return idInit(1, 1);
     
    23112344    G0->m[IDELEMS(G0) - 1] = zeroPoly;
    23122345  }
    2313   while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, bound, currRing->N) );
     2346  while ( nextZeroSimplexExponent(exp, ind, cexp, cind, &cabsind, step, bound, currRing->N) );
    23142347  idSkipZeroes(G0);
    23152348  return G0;
Note: See TracChangeset for help on using the changeset viewer.