Changeset 99c34c in git


Ignore:
Timestamp:
Jul 25, 2017, 3:15:07 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '98550b669234b32be762076c32b3be2c35188ac4')
Children:
8a56bb20ce24ff417ec3e90dc3086523518b044cbb865eb91673e33d3e7f851b088b48a8ff0731b7
Parents:
4b6d98d864dc84324edd68f69498842e26f79071
Message:
chg: use standard type conversions for jjIDEAL_PL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r4b6d98 r99c34c  
    66456645  int i=0;
    66466646  poly p;
     6647  int dest_type=POLY_CMD;
     6648  if (iiOp==MODUL_CMD) dest_type=VECTOR_CMD;
    66476649  while (h!=NULL)
    66486650  {
    6649     switch(h->Typ())
    6650     {
    6651       case POLY_CMD:
    6652       {
    6653         p=(poly)h->CopyD(POLY_CMD);
    6654         break;
    6655       }
    6656       case INT_CMD:
    6657       {
    6658         number n=nInit((int)(long)h->Data());
    6659         if (!nIsZero(n))
    6660         {
    6661           p=pNSet(n);
    6662         }
    6663         else
    6664         {
    6665           p=NULL;
    6666           nDelete(&n);
    6667         }
    6668         break;
    6669       }
    6670       case BIGINT_CMD:
    6671       {
    6672         number b=(number)h->Data();
    6673         nMapFunc nMap=n_SetMap(coeffs_BIGINT,currRing->cf);
    6674         if (nMap==NULL) return TRUE;
    6675         number n=nMap(b,coeffs_BIGINT,currRing->cf);
    6676         if (!nIsZero(n))
    6677         {
    6678           p=pNSet(n);
    6679         }
    6680         else
    6681         {
    6682           p=NULL;
    6683           nDelete(&n);
    6684         }
    6685         break;
    6686       }
    6687       case NUMBER_CMD:
    6688       {
    6689         number n=(number)h->CopyD(NUMBER_CMD);
    6690         if (!nIsZero(n))
    6691         {
    6692           p=pNSet(n);
    6693         }
    6694         else
    6695         {
    6696           p=NULL;
    6697           nDelete(&n);
    6698         }
    6699         break;
    6700       }
    6701       case VECTOR_CMD:
    6702       {
    6703         p=(poly)h->CopyD(VECTOR_CMD);
    6704         if (iiOp!=MODUL_CMD)
    6705         {
    6706           idDelete(&id);
    6707           pDelete(&p);
    6708           return TRUE;
    6709         }
    6710         rank=si_max(rank,(int)pMaxComp(p));
    6711         break;
    6712       }
    6713       default:
    6714       {
    6715         idDelete(&id);
    6716         return TRUE;
    6717       }
    6718     }
    6719     if ((iiOp==MODUL_CMD)&&(p!=NULL)&&(pGetComp(p)==0))
    6720     {
    6721       pSetCompP(p,1);
     6651    // use standard type conversions to poly/vector
     6652    int ri;
     6653    int ht=h->Typ();
     6654    if (ht==dest_type)
     6655    {
     6656      p=(poly)h->CopyD();
     6657      if (p!=NULL) rank=si_max(rank,(int)pMaxComp(p));
     6658    }
     6659    else if ((ri=iiTestConvert(ht,dest_type,dConvertTypes))!=0)
     6660    {
     6661      sleftv tmp;
     6662      leftv hnext=h->next;
     6663      h->next=NULL;
     6664      iiConvert(ht,dest_type,ri,h,&tmp,dConvertTypes);
     6665      h->next=hnext;
     6666      p=(poly)tmp.data;
     6667      if (p!=NULL) rank=si_max(rank,(int)pMaxComp(p));
     6668    }
     6669    else
     6670    {
     6671      idDelete(&id);
     6672      return TRUE;
    67226673    }
    67236674    id->m[i]=p;
Note: See TracChangeset for help on using the changeset viewer.