Changeset 4c852a in git


Ignore:
Timestamp:
May 9, 2000, 4:34:11 PM (23 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
87a8156a442b896f42878bb29b9c2a183cd30a18
Parents:
72c1b94aa91b5685f167d11c0420e61bbe7253e5
Message:
*hannes: optimizations


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

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    r72c1b9 r4c852a  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.93 2000-03-07 15:49:13 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.94 2000-05-09 14:34:11 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    388388static int pComp_RevLex(poly a, poly b,BOOLEAN nolex)
    389389{
    390  if (nolex) return pComp0(a,b);
    391  int l=pVariables;
    392  while ((l>0) && (pGetExp(a,l)==pGetExp(b,l))) l--;
    393  if (l==0)
    394  {
    395    if (pGetComp(a)==pGetComp(b)) return 0;
    396    if (pGetComp(a)>pGetComp(b)) return 1;
    397  }
    398  else if (pGetExp(a,l)>pGetExp(b,l))
    399    return 1;
    400  return -1;
     390  if (b==NULL) return 1;
     391  if (a==NULL) return -1;
     392
     393  if (nolex) return pComp0(a,b);
     394  int l=pVariables;
     395  while ((l>0) && (pGetExp(a,l)==pGetExp(b,l))) l--;
     396  if (l==0)
     397  {
     398    if (pGetComp(a)==pGetComp(b)) return 0;
     399    if (pGetComp(a)>pGetComp(b)) return 1;
     400  }
     401  else if (pGetExp(a,l)>pGetExp(b,l))
     402    return 1;
     403  return -1;
    401404}
    402405
     
    434437        notFound = FALSE;
    435438      }
    436       while ((newpos>=0) && (newpos<actpos) && (notFound))
     439      //while ((newpos>=0) && (newpos<actpos) && (notFound))
     440      while (notFound && (newpos>=0) && (newpos<actpos))
    437441      {
    438442        newcomp = pComp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex);
     
    16881692        pSetComp(p,1+j+k);
    16891693        pSetmComp(p);
    1690         p = pNeg(p);
     1694        p = pNeg(p);
    16911695      }
    16921696    }
     
    24312435  {
    24322436    ideal result=idCopy(id);
    2433     for (i=1;i<IDELEMS(result);i++)
    2434     {
    2435       if (result->m[i]!=NULL)
    2436       {
    2437         for (j=0;j<i;j++)
     2437    //if (IDELEMS(result) < 1)
     2438    {
     2439      for (i=1;i<IDELEMS(result);i++)
     2440      {
     2441        if (result->m[i]!=NULL)
    24382442        {
    2439           if ((result->m[j]!=NULL)
    2440           && (pComparePolys(result->m[i],result->m[j])))
     2443          for (j=0;j<i;j++)
    24412444          {
    2442             pDelete(&(result->m[j]));
     2445            if ((result->m[j]!=NULL)
     2446            && (pComparePolys(result->m[i],result->m[j])))
     2447            {
     2448              pDelete(&(result->m[j]));
     2449            }
    24432450          }
    24442451        }
    24452452      }
    24462453    }
     2454//    else
     2455//    {
     2456//      intvec *v=idSort(result,TRUE);
     2457//      for(i=0;i<IDELEMS(result);i++)
     2458//        (*v)[i]--;
     2459//      for (i=0;i<IDELEMS(result)-1;i++)
     2460//      {
     2461//      if (((*v)[i]>=0)
     2462//        && (result->m[(*v)[i]]!=NULL))
     2463//        {
     2464//          j=i+1;
     2465//          while ((j<IDELEMS(result))
     2466//        && ((*v)[j]>=0)
     2467//          && (result->m[(*v)[j]]!=NULL)
     2468//          && (pComparePolys(result->m[(*v)[i]],result->m[(*v)[j]])))
     2469//          {
     2470//            pDelete(&(result->m[(*v)[j]]));
     2471//            j++;
     2472//          }
     2473//        }
     2474//      }
     2475//      delete v;
     2476//    }
    24472477    idSkipZeroes(result);
    24482478    return result;
Note: See TracChangeset for help on using the changeset viewer.