Changeset 1e579c6 in git for kernel/kutil.cc


Ignore:
Timestamp:
Jun 20, 2007, 11:39:25 AM (17 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
07e8ae3b1877436cb95506c90d799438d558c703
Parents:
f7aaec31bd73e9e5b3b2bd84ee5ff4fab2de4691
Message:
kutil.cc:
* use nExtGcd, nIsUnit
* extended spolys only for non-domains

numbers.cc, numbers.h, structs.h:
* new Functions: nIsUnit, nGetUnit, nExtGcd
* new Field: the Integers

polys.cc, polys.h:
* nGetUnit hack removed
* minor memory glitch

polys1.cc:
* no pContent for Integers

ring.h:
new rField methos for Integers and p^n

rintegers.*:
implementation of the whole numbers using gmp

rmodulo*:
added funcs: nIsUnit, nGetUnit, nExtGcd


git-svn-id: file:///usr/local/Singular/svn/trunk@10125 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kutil.cc

    rf7aaec3 r1e579c6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.58 2007-05-24 10:02:43 wienand Exp $ */
     4/* $Id: kutil.cc,v 1.59 2007-06-20 09:39:23 wienand Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    10551055  pSetm(Lp.lcm);
    10561056  assume(!strat->sugarCrit);
    1057   if (pHasNotCF(p,strat->S[i]) && nIsOne(nGcd(0, pGetCoeff(p), currRing)) && nIsOne(nGcd(0, pGetCoeff(strat->S[i]), currRing)))
     1057  if (pHasNotCF(p,strat->S[i]) && nIsUnit(pGetCoeff(p)) && nIsUnit(pGetCoeff(strat->S[i])))
    10581058  {
    10591059#ifdef KDEBUG
     
    12451245#endif
    12461246
    1247 void enterOneStrongPoly (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
    1248 {
    1249   long d, s, t;
     1247BOOLEAN enterOneStrongPoly (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
     1248{
     1249  number d, s, t;
    12501250  assume(i<=strat->sl);
    12511251  LObject  Lp;
    12521252  poly m1, m2, erg, gcd;
    12531253
    1254   XGCD(d, s, t, (long) pGetCoeff(p), (long) pGetCoeff(strat->S[i]));
    1255 
     1254  d = nExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t);
     1255
     1256  if (nIsOne(d) || nIsZero(s) || nIsZero(t))
     1257  {
     1258    nDelete(&d);
     1259    nDelete(&s);
     1260    nDelete(&t);
     1261    return FALSE;
     1262  }
    12561263
    12571264  k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
    12581265
    1259   pSetCoeff0(m1, nInit(s));
    1260   pSetCoeff0(m2, nInit(t));
    1261   pSetCoeff0(gcd, nInit(d));
     1266  pSetCoeff0(m1, s);
     1267  pSetCoeff0(m2, t);
     1268  pSetCoeff0(gcd, d);
    12621269
    12631270
     
    13231330    enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
    13241331  }
     1332  return TRUE;
    13251333}
    13261334#endif
     
    26002608    {
    26012609      // Print("j:%d, Ll:%d\n",j,strat->Ll);
    2602       if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) &&
    2603          ((unsigned long) pGetCoeff(strat->S[j]) % (unsigned long) pGetCoeff(h) != 0))
    2604       {
    2605         new_pair=TRUE;
    2606         enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR);
     2610//      if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) &&
     2611//         ((unsigned long) pGetCoeff(strat->S[j]) % (unsigned long) pGetCoeff(h) != 0))
     2612      {
     2613        if (enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR))
     2614          new_pair=TRUE;
    26072615      }
    26082616    }
     
    27282736    assume (rField_is_Ring(currRing));
    27292737    // enter also zero divisor * poly, if this is non zero and of smaller degree
    2730     enterExtendedSpoly(h, strat);
     2738    if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat);
    27312739    initenterpairsRing(h, k, ecart, 0, strat, atR);
    27322740    initenterstrongPairs(h, k, ecart, 0, strat, atR);
Note: See TracChangeset for help on using the changeset viewer.