Changeset 26ae12 in git


Ignore:
Timestamp:
May 19, 1998, 11:02:40 AM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
565a96ad124ccea57f357a4da2ded5764304f8cf
Parents:
b1fa42d7299399bfcfb6cef7291df79a2a381178
Message:
1998-05-19  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* ideals.cc (idDelLmEquals): added idDelLmEqual == simplify(16),
	and idDelDiv == simplify(32); improved pComparePolys


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

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    rb1fa42 r26ae12  
     11998-05-19  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
     2
     3        * ideals.cc (idDelLmEquals): added idDelLmEqual == simplify(16),
     4        and idDelDiv == simplify(32); improved pComparePolys
     5
    161998-05-18  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
    27
  • Singular/ideals.cc

    rb1fa42 r26ae12  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.26 1998-05-14 14:41:28 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.27 1998-05-19 09:02:35 obachman Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    236236  }
    237237}
     238
     239//
     240// Delete id[j], if Lm(j) == Lm(i) and j > i
     241//
     242void idDelLmEquals(ideal id)
     243{
     244  int i, j, t;
     245  int k = IDELEMS(id), l = k;
     246  for (i=k-2; i>=0; i--)
     247  {
     248    for (j=l-1; j>i; j--)
     249    {
     250      if (pLmEqual(id->m[i], id->m[j]))
     251      {
     252        pDelete(&id->m[j]);
     253        l--;
     254        for(t=j; t<l; t++)
     255        {
     256          id->m[t] = id->m[t+1];
     257        }
     258      }
     259    }
     260  }
     261  if (l != k)
     262  {
     263    pEnlargeSet(&id->m, k, l-k);
     264    IDELEMS(id) = l;
     265  }
     266}
     267         
     268void idDelDiv(ideal id)
     269{
     270  int i, j, t;
     271  int k = IDELEMS(id), l = k;
     272  for (i=k-2; i>=0; i--)
     273  {
     274    for (j=l-1; j>i; j--)
     275    {
     276     
     277      if (((id->m[j] != NULL) && pDivisibleBy(id->m[i], id->m[j])) ||
     278          (id->m[i] == NULL && id->m[j] == NULL))
     279      {
     280        pDelete(&id->m[j]);
     281        l--;
     282        for(t=j; t<l; t++)
     283        {
     284          id->m[t] = id->m[t+1];
     285        }
     286      }
     287    }
     288  }
     289  if (l != k)
     290  {
     291    pEnlargeSet(&id->m, k, l-k);
     292    IDELEMS(id) = l;
     293  }
     294}
     295 
    238296
    239297/*2
  • Singular/ideals.h

    rb1fa42 r26ae12  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ideals.h,v 1.6 1998-02-19 12:45:40 siebert Exp $ */
     6/* $Id: ideals.h,v 1.7 1998-05-19 09:02:35 obachman Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate ideals
     
    2929void idDelMultiples(ideal id);
    3030void idDelEquals(ideal id);
     31void idDelLmEquals(ideal id);
     32void idDelDiv(ideal id);
    3133
    3234#ifdef PDEBUG
  • Singular/iparith.cc

    rb1fa42 r26ae12  
    17361736  return (i==-1);
    17371737}
     1738#define SIMPL_LMDIV 32
     1739#define SIMPL_LMEQ  16
    17381740#define SIMPL_MULT 8
    17391741#define SIMPL_EQU  4
     
    17441746  int sw = (int)v->Data();
    17451747  ideal id = (ideal)u->CopyD();
     1748  if (sw & SIMPL_LMDIV)
     1749  {
     1750    idDelDiv(id);
     1751  }
     1752  if (sw & SIMPL_LMEQ)
     1753  {
     1754    idDelLmEquals(id);
     1755  }
    17461756  if (sw & SIMPL_NULL)
    17471757  {
  • Singular/polys.h

    rb1fa42 r26ae12  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.12 1998-04-08 12:41:37 pohl Exp $ */
     6/* $Id: polys.h,v 1.13 1998-05-19 09:02:38 obachman Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate polynomials
     
    207207poly      pPower(poly p, int i);
    208208
    209 // return TRUE, if exponent and component of p1 and p2 are equal,
    210 // FALSE otherwise
    211 #define pEqual(p1, p2) _pEqual(p1, p2)
     209// return TRUE, if exponent and component of Lm(p1) and Lm(p2) are equal,
     210// FALSE otherwise;
     211#define pEqual(p1, p2) _pEqual(p1, p2) // Assumes p1 != NULL & p2 != NULL
     212inline BOOLEAN pLmEqual(poly p1, poly p2) // no assumptions
     213{
     214  if (p1 != NULL)
     215  {
     216    if (p2 != NULL)
     217      return pEqual(p1, p2);
     218    return FALSE;
     219  }
     220  if (p2 == NULL)
     221    return TRUE;
     222  return FALSE;
     223}
    212224
    213225// returns TRUE, if leading monom of a divides leading monom of b
    214 // i.e., if there exists a expvector c > 0, s.t. b = a + c
     226// i.e., if there exists a expvector c > 0, s.t. b = a + c; assumes b != NULL
    215227#define pDivisibleBy(a, b)  _pDivisibleBy(a,b)
    216228// like pDivisibleBy, except that it is assumed that a!=NULL
    217229#define pDivisibleBy1(a,b)   _pDivisibleBy1(a,b)
    218 // like pDivisibleBy, assumes a != NULL, does not check components
     230// like pDivisibleBy1, does not check components
    219231#define pDivisibleBy2(a, b) _pDivisibleBy2(a,b)
    220232
  • Singular/polys1.cc

    rb1fa42 r26ae12  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.13 1998-04-24 16:39:25 Singular Exp $ */
     4/* $Id: polys1.cc,v 1.14 1998-05-19 09:02:38 obachman Exp $ */
    55
    66/*
     
    12381238  {
    12391239    /* p1 and p2 are non-NULL, so we may use pComp0 instead of pComp */
    1240     if (pComp0(p1,p2) != 0)
     1240    if (! pEqual(p1, p2))
    12411241    {
    12421242       return FALSE;
     
    12661266  while ((p1 != NULL) /*&& (p2 != NULL)*/)
    12671267  {
    1268     for (i=1; i<=pVariables; i++)
    1269     {
    1270       if (pGetExp(p1,i)!=pGetExp(p2,i))
    1271       {
     1268    if ( ! pLmEqual(p1, p2))
     1269    {
    12721270        nDelete(&n);
    12731271        return FALSE;
    1274       }
    1275     }
    1276     if (pGetComp(p1) != pGetComp(p2))
    1277     {
    1278       nDelete(&n);
    1279       return FALSE;
    12801272    }
    12811273    if (!nEqual(pGetCoeff(p1),nn=nMult(pGetCoeff(p2),n)))
     
    12921284  return TRUE;
    12931285}
    1294 //{
    1295 //  number m=NULL,n=NULL;
    1296 //
    1297 //  while ((p1 != NULL) && (p2 != NULL))
    1298 //  {
    1299 //    if (pComp(p1,p2) != 0)
    1300 //    {
    1301 //      if (n!=NULL) nDelete(&n);
    1302 //      return FALSE;
    1303 //    }
    1304 //    if (n == NULL)
    1305 //    {
    1306 //      n=nDiv(pGetCoeff(p1),pGetCoeff(p2));
    1307 //    }
    1308 //    else
    1309 //    {
    1310 //      m=nDiv(pGetCoeff(p1),pGetCoeff(p2));
    1311 //      if (! nEqual(m,n))
    1312 //      {
    1313 //        nDelete(&n);
    1314 //        nDelete(&m);
    1315 //        return FALSE;
    1316 //      }
    1317 //      nDelete(&m);
    1318 //    }
    1319 //    p1=pNext(p1);
    1320 //    p2=pNext(p2);
    1321 //  }
    1322 //  nDelete(&n);
    1323 //  //if (p1 != p2)
    1324 //  //  return FALSE;
    1325 //  //else
    1326 //  //  return TRUE;
    1327 //  return (p1==p2);
    1328 //}
Note: See TracChangeset for help on using the changeset viewer.