Changeset 994197 in git


Ignore:
Timestamp:
Mar 2, 2009, 4:43:24 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
19a0637d5afa08bfef5ba5ad9b199cd5ee3ab1e4
Parents:
4a1764827ceed5ebcbbce2b9e29ff72366b509ed
Message:
*hannes: poly-bigint, facstd(0)


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

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r4a1764 r994197  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.498 2009-03-02 15:30:17 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.499 2009-03-02 15:43:24 Singular Exp $ */
    55
    66/*
     
    38443844  ideal_list p,h;
    38453845  h=kStdfac((ideal)v->Data(),NULL,testHomog,NULL);
    3846   p=h;
    3847   int l=0;
    3848   while (p!=NULL) { p=p->next;l++; }
    38493846  lists L=(lists)omAllocBin(slists_bin);
    3850   L->Init(l);
    3851   l=0;
    3852   while(h!=NULL)
    3853   {
    3854     L->m[l].data=(char *)h->d;
    3855     L->m[l].rtyp=IDEAL_CMD;
    3856     p=h->next;
    3857     omFreeSize(h,sizeof(*h));
    3858     h=p;
    3859     l++;
     3847  if (h==NULL)
     3848  {
     3849    L->Init(1);
     3850    L->m[0].data=(char *)idInit(0,1);
     3851    L->m[0].rtyp=IDEAL_CMD;
     3852  }
     3853  else
     3854  {
     3855    p=h;
     3856    int l=0;
     3857    while (p!=NULL) { p=p->next;l++; }
     3858    L->Init(l);
     3859    l=0;
     3860    while(h!=NULL)
     3861    {
     3862      L->m[l].data=(char *)h->d;
     3863      L->m[l].rtyp=IDEAL_CMD;
     3864      p=h->next;
     3865      omFreeSize(h,sizeof(*h));
     3866      h=p;
     3867      l++;
     3868    }
    38603869  }
    38613870  res->data=(void *)L;
     
    43744383  }
    43754384  return FALSE;
     4385}
     4386static BOOLEAN jjP2BI(leftv res, leftv v)
     4387{
     4388  poly p=(poly)v->Data();
     4389  if (p==NULL) { res->data=(char *)nlInit(0); return FALSE; }
     4390  if ((pNext(p)!=NULL)|| (!pIsConstant(p)))
     4391  {
     4392    WerrorS("poly must be constant");
     4393    return TRUE;
     4394  }
     4395  number i=pGetCoeff(p);
     4396  number n;
     4397  if (rField_is_Zp())
     4398  {
     4399     if (((long)i)>(npPrimeM>>1))
     4400       n=nlInit((int)(((long)i)-npPrimeM));
     4401     else
     4402       n=nlInit((int)(long)i);
     4403  }
     4404  else if (rField_is_Q()) n=nlBigInt(i);
     4405#ifdef HAVE_RINGS
     4406  else if (rField_is_Ring_Z() || rField_is_Ring_ModN() || rField_is_Ring_PtoM()) n=nlMapGMP(i);
     4407  else if (rField_is_Ring_2toM()) n=nlInit((unsigned long) i);
     4408#endif
     4409  else goto err;
     4410  res->data=(void *)n;
     4411  return FALSE;
     4412err:
     4413  WerrorS("cannot convert to bigint"); return TRUE;
    43764414}
    43774415static BOOLEAN jjP2I(leftv res, leftv v)
     
    50595097,{jjDUMMY,      BIGINT_CMD,      BIGINT_CMD,     BIGINT_CMD     ALLOW_PLURAL}
    50605098,{jjN2BI,       BIGINT_CMD,      BIGINT_CMD,     NUMBER_CMD     ALLOW_PLURAL}
     5099,{jjP2BI,       BIGINT_CMD,      BIGINT_CMD,     POLY_CMD       ALLOW_PLURAL}
    50615100,{jjCHAR,       CHARACTERISTIC_CMD, INT_CMD,     RING_CMD       ALLOW_PLURAL}
    50625101,{jjCHAR,       CHARACTERISTIC_CMD, INT_CMD,     QRING_CMD      ALLOW_PLURAL}
Note: See TracChangeset for help on using the changeset viewer.