Changeset 3504d7 in git for kernel/ideals.cc


Ignore:
Timestamp:
Nov 24, 2006, 2:44:38 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1d138cc219f68b925aa7c15df754cc1eaf1da469
Parents:
0ef842f27dd9647ae9abc8375147f2c17ec4e0c8
Message:
*hannes: idMinEmbed and weights: opt.


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

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r0ef842 r3504d7  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.23 2006-11-24 09:53:01 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.24 2006-11-24 13:44:38 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    34853485static int idReadOutUnits(ideal arg,int* comp)
    34863486{
    3487   if (idIs0(arg)) return -1;
     3487  assume(!idIs0(arg));
    34883488  int i=0,j, generator=-1;
    34893489  int rk_arg=arg->rank; //idRankFreeModule(arg);
     
    35643564{
    35653565  if (idIs0(arg)) return idInit(1,arg->rank);
    3566   int next_gen,next_comp;
     3566  int i,next_gen,next_comp;
    35673567  ideal res=arg;
    35683568
     
    35703570  res->rank=si_max(res->rank,idRankFreeModule(res));
    35713571
     3572  intvec *wtmp=NULL;
    35723573  loop
    35733574  {
     
    35783579    if ((w !=NULL)&&(*w!=NULL))
    35793580    {
    3580       intvec *wtmp;
    3581       if ((*w)->length()==1)
    3582       {
    3583         wtmp=new intvec(1);
    3584         // (*wtmp)[0]=0;
    3585       }
    3586       else
    3587       {
    3588         wtmp=new intvec((*w)->length()-1);
    3589         int i;
    3590         for(i=0;i<next_comp-1;i++) (*wtmp)[i]=(**w)[i];
    3591         for(i=next_comp;i<(*w)->length();i++) (*wtmp)[i-1]=(**w)[i];
    3592       }
     3581      if (wtmp==NULL)
     3582      {
     3583        if ((*w)->length()==1)
     3584        {
     3585          wtmp=new intvec(1);
     3586          // (*wtmp)[0]=0;
     3587        }
     3588        else
     3589        {
     3590          wtmp=new intvec((*w)->length()-1);
     3591          for(i=0;i<wtmp->length();i++) (*wtmp)[i]=(**w)[i];
     3592        }
     3593      }
     3594      for(i=next_comp;i<(*w)->length();i++) (*wtmp)[i-1]=(*wtmp)[i];
     3595    }
     3596  }
     3597  if ((w !=NULL)&&(*w!=NULL))
     3598  {
     3599    delete *w;
     3600    *w=wtmp;
     3601    if (wtmp->length()>1)
     3602    {
     3603      wtmp=new intvec(res->rank);
     3604      for(i=0;i<res->rank;i++) (*wtmp)[i]=(**w)[i];
    35933605      delete *w;
    35943606      *w=wtmp;
Note: See TracChangeset for help on using the changeset viewer.