Changeset dc32d42 in git for Singular/ideals.cc


Ignore:
Timestamp:
May 21, 1997, 3:05:36 PM (27 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
2b3f238c740deb3d586dc1d5b379ddadb848cbaa
Parents:
670667a17a4a8423dbd6c8e3749cc652102fb28a
Message:
Merged fixes from 1-0 branch


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

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    r670667 rdc32d42  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.6 1997-05-02 15:10:13 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.7 1997-05-21 13:05:12 obachman Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    29202920  if (idIs0(arg)) return idInit(1,arg->rank);
    29212921
    2922   int i,j,k=0,pC;
     2922  int i,j,k,pC;
    29232923  poly p,q;
    29242924  int rg=arg->rank;
    2925   ideal res = idInit(IDELEMS(arg),rg);
     2925  ideal res = idCopy(arg);
    29262926  intvec *indexMap=new intvec(rg+1);
    29272927  intvec *toKill=new intvec(rg+1);
    29282928
    2929   for (i=indexMap->length()-1;i>0;i--)
    2930     (*indexMap)[i] = i;
    2931   for (j=IDELEMS(arg)-1;j>=0;j--)
    2932   {
    2933     if (arg->m[j]!=NULL)
    2934     {
    2935       if ((pIsConstantComp(arg->m[j])) && (pNext(arg->m[j])==NULL))
    2936       {
    2937         pC = pGetComp(arg->m[j]);
     2929  loop
     2930  {
     2931    k = 0;
     2932    for (i=indexMap->length()-1;i>0;i--)
     2933    {
     2934      (*indexMap)[i] = i;
     2935      (*toKill)[i] = 0;
     2936    }
     2937    for (j=IDELEMS(res)-1;j>=0;j--)
     2938    {
     2939      if ((res->m[j]!=NULL) && (pIsConstantComp(res->m[j])) &&
     2940           (pNext(res->m[j])==NULL))
     2941      {
     2942        pC = pGetComp(res->m[j]);
    29382943        if ((*toKill)[pC]==0)
    29392944        {
     
    29432948            (*indexMap)[i]--;
    29442949        }
    2945       }
    2946       else
    2947       {
    2948         res->m[k] = pCopy(arg->m[j]);
     2950        pDelete(&(res->m[j]));
    29492951        k++;
    29502952      }
    29512953    }
    2952   }
    2953   if (rg>0)
    2954   {
    2955     res->rank=rg;
    2956     for (j=IDELEMS(res)-1;j>=0;j--)
    2957     {
    2958       while ((res->m[j]!=NULL) && ((*toKill)[pGetComp(res->m[j])]==1))
    2959         pDelete1(&res->m[j]);
    2960       p = res->m[j];
    2961       while ((p!=NULL) && (pNext(p)!=NULL))
    2962       {
    2963         pSetComp(p,(*indexMap)[pGetComp(p)]);
    2964         while ((pNext(p)!=NULL) && ((*toKill)[pGetComp(pNext(p))]==1))
    2965           pDelete1(&pNext(p));
    2966         pIter(p);
    2967       }
    2968       if (p!=NULL) pSetComp(p,(*indexMap)[pGetComp(p)]);
    2969     }
    29702954    idSkipZeroes(res);
    2971   }
    2972   else
    2973   {
    2974     idDelete(&res);
    2975     res=idFreeModule(1);
     2955    if (k==0) break;
     2956    if (rg>0)
     2957    {
     2958      res->rank=rg;
     2959      for (j=IDELEMS(res)-1;j>=0;j--)
     2960      {
     2961        while ((res->m[j]!=NULL) && ((*toKill)[pGetComp(res->m[j])]==1))
     2962          pDelete1(&res->m[j]);
     2963        p = res->m[j];
     2964        while ((p!=NULL) && (pNext(p)!=NULL))
     2965        {
     2966          pSetComp(p,(*indexMap)[pGetComp(p)]);
     2967          while ((pNext(p)!=NULL) && ((*toKill)[pGetComp(pNext(p))]==1))
     2968            pDelete1(&pNext(p));
     2969          pIter(p);
     2970        }
     2971        if (p!=NULL) pSetComp(p,(*indexMap)[pGetComp(p)]);
     2972      }
     2973      idSkipZeroes(res);
     2974    }
     2975    else
     2976    {
     2977      idDelete(&res);
     2978      res=idFreeModule(1);
     2979      break;
     2980    }
    29762981  }
    29772982  delete toKill;
Note: See TracChangeset for help on using the changeset viewer.