Changeset 955025 in git


Ignore:
Timestamp:
Nov 27, 2006, 2:44:44 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
b2c236a6179ecdae1034b600ce9d1490f7eca0f9
Parents:
1eaa1dc3ce472107c471d84ea116e5ad1fede744
Message:
*hannes: idMinEmbedding optimized


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

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r1eaa1d r955025  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.26 2006-11-27 12:55:57 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.27 2006-11-27 13:44:44 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    35353535}
    35363536
     3537#if 0
    35373538static void idDeleteComp(ideal arg,int red_comp)
    35383539{
     
    35553556  }
    35563557  (arg->rank)--;
     3558}
     3559#endif
     3560
     3561static void idDeleteComps(ideal arg,int* red_comp,int del)
     3562// red_comp is an array [0..args->rank]
     3563{
     3564  int i,j;
     3565  poly p;
     3566
     3567  for (i=IDELEMS(arg)-1;i>=0;i--)
     3568  {
     3569    p = arg->m[i];
     3570    while (p!=NULL)
     3571    {
     3572      j = pGetComp(p);
     3573      if (red_comp[j]!=j)
     3574      {
     3575        pSetComp(p,red_comp[j]);
     3576        pSetmComp(p);
     3577      }
     3578      pIter(p);
     3579    }
     3580  }
     3581  (arg->rank) -= del;
    35573582}
    35583583
     
    35693594  if (!inPlace) res = idCopy(arg);
    35703595  res->rank=si_max(res->rank,idRankFreeModule(res));
     3596  int *red_comp=(int*)omAlloc((res->rank+1)*sizeof(int));
     3597  for (i=res->rank;i>=0;i--) red_comp[i]=i;
    35713598
    35723599  int del=0;
     
    35773604    del++;
    35783605    syGaussForOne(res,next_gen,next_comp,0,IDELEMS(res));
    3579     idDeleteComp(res,next_comp);
     3606    for(i=next_comp+1;i<=arg->rank;i++) red_comp[i]--;
    35803607    if ((w !=NULL)&&(*w!=NULL))
    35813608    {
     
    35833610    }
    35843611  }
     3612
     3613  idDeleteComps(res,red_comp,del);
     3614  idSkipZeroes(res);
     3615  omFree(red_comp);
     3616
    35853617  if ((w !=NULL)&&(*w!=NULL) &&(del>0))
    35863618  {
     
    35903622    *w=wtmp;
    35913623  }
    3592   idSkipZeroes(res);
    35933624  return res;
    35943625}
Note: See TracChangeset for help on using the changeset viewer.