Changeset 5c7a85 in git


Ignore:
Timestamp:
Apr 9, 2024, 4:13:38 PM (4 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'd25190065115c859833252500a64cfb7b11e3a50')
Children:
b731111a31281d6447b4a56ab74d5c5ca6660db9
Parents:
02b27f46515b62d44f679ffb0308d9bb6b2e653a
Message:
assign number -> bigint
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.inc

    r02b27f r5c7a85  
    838838/*---------------------------------------------*/
    839839// assign: bigint =  bigint
     840// assign: bigint =  number
    840841// assign: bigintvec =  bigintvec
    841842// assign: bigintvec =  intvec
  • Singular/ipassign.cc

    r02b27f r5c7a85  
    700700        n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
    701701        BIMATELEM(*iv,i+1,c) = p;
     702      }
     703    }
     704  }
     705  jiAssignAttr(res,a);
     706  return FALSE;
     707}
     708static BOOLEAN jiA_BIGINT_N(leftv res, leftv a, Subexpr e)
     709{
     710  number p=(number)a->Data();
     711  number pp=NULL;
     712  if (rField_is_Q(currRing))
     713    pp=nCopy(p);
     714  else if (rField_is_Z(currRing))
     715    pp=coeffs_BIGINT->cfInitMPZ((mpz_ptr)p,coeffs_BIGINT);
     716  else
     717  {
     718    WerrorS("cannot assign to bigint");
     719    return TRUE;
     720  }
     721  if (e==NULL)
     722  {
     723    if (res->data!=NULL) n_Delete((number *)&res->data,coeffs_BIGINT);
     724    res->data=(void*)pp;
     725  }
     726  else
     727  {
     728    int i=e->start-1;
     729    if (i<0)
     730    {
     731      Werror("index[%d] must be positive",i+1);
     732      return TRUE;
     733    }
     734    bigintmat *iv=(bigintmat *)res->data;
     735    if ((e->next==NULL)&&(res->rtyp==BIGINTMAT_CMD))
     736    {
     737      WerrorS("only one index given");
     738      return TRUE;
     739    }
     740    else
     741    {
     742      int c;
     743      if (res->rtyp==BIGINTMAT_CMD) c=e->next->start;
     744      else { c=i+1; i=0;}
     745      if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
     746      {
     747        Werror("wrong range [%d,%d] in bigintmat/bigintvec %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
     748        return TRUE;
     749      }
     750      else
     751      {
     752        n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
     753        BIMATELEM(*iv,i+1,c) = pp;
    702754      }
    703755    }
  • Singular/table.h

    r02b27f r5c7a85  
    14211421// proc            res             arg
    14221422 {D(jiA_BIGINT),   BIGINT_CMD,     BIGINT_CMD }
     1423,{D(jiA_BIGINT_N), BIGINT_CMD,     NUMBER_CMD }
    14231424,{D(jiA_BIGINTMAT),BIGINTVEC_CMD,  BIGINTVEC_CMD }
    14241425,{D(jiA_BIGINTVEC_IV),BIGINTVEC_CMD,INTVEC_CMD }
Note: See TracChangeset for help on using the changeset viewer.