Changeset 12e275 in git for Singular/ipshell.cc


Ignore:
Timestamp:
Dec 4, 2014, 5:51:33 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
f19aa6812e6421a0bbd161f43b974557d7f6b874
Parents:
fe6b623ec279088e48111ca37e0592c7d7a54822
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-12-04 17:51:33+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-12-15 18:49:40+01:00
Message:
Mark deprecated BIGINT handling + related bugs / side effects

FIXMEs: nlGMP -> n_MPZ. Check for side effects and nlMapGMP
Fix: bug in BIGINT deletion
Fix: a possible bug due to sideeffect!?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    rfe6b62 r12e275  
    2121
    2222#include <coeffs/rmodulon.h>
     23#include <coeffs/longrat.h>
    2324
    2425#include <polys/monomials/ring.h>
     
    13071308         break;
    13081309      case BIGINT_CMD:
    1309          n_Delete(&IDNUMBER(pp),currRing->cf);
     1310         n_Delete(&IDNUMBER(pp),coeffs_BIGINT);
    13101311         break;
    13111312      case MAP_CMD:
     
    18061807  LL->Init(2);
    18071808  LL->m[0].rtyp=BIGINT_CMD;
    1808   LL->m[0].data=nlMapGMP((number) R->cf->modBase, R->cf, R->cf);
     1809  LL->m[0].data=nlMapGMP((number) R->cf->modBase, R->cf, R->cf); // TODO: what is this?? // extern number nlMapGMP(number from, const coeffs src, const coeffs dst); // FIXME: replace with n_InitMPZ(R->cf->modBase, coeffs_BIGINT); ?
    18091810  LL->m[1].rtyp=INT_CMD;
    18101811  LL->m[1].data=(void *) R->cf->modExponent;
     
    20902091    if ((LL->nr >= 0) && LL->m[0].rtyp == BIGINT_CMD)
    20912092    {
    2092       number tmp= (number) LL->m[0].data;
    2093       n_MPZ (modBase, tmp, coeffs_BIGINT);
     2093      number tmp= (number) LL->m[0].data; // .CopyD()? see below
     2094      n_MPZ (modBase, tmp, coeffs_BIGINT); // FIXME: deletes tmp: previous CopyD() should NOT be necessary!
    20942095    }
    20952096    else if (LL->nr >= 0 && LL->m[0].rtyp == INT_CMD)
     
    52665267  else if ((pn->name != NULL) && (strcmp(pn->name, "integer") == 0))
    52675268  {
     5269    // TODO: change to use coeffs_BIGINT!?
    52685270    modBase = (mpz_ptr) omAlloc(sizeof(mpz_t));
    52695271    mpz_init_set_si(modBase, 0);
     
    52875289      else if (pn->next->Typ()==BIGINT_CMD)
    52885290      {
    5289         number p=(number)pn->next->CopyD();
    5290         nlGMP(p,(number)modBase,coeffs_BIGINT);
    5291         nlDelete(&p,coeffs_BIGINT);
     5291        number p=(number)pn->next->CopyD(); // FIXME: why CopyD() here if nlGMP should not overtake p!?
     5292        nlGMP(p,(number)modBase,coeffs_BIGINT); // TODO? // extern void   nlGMP(number &i, number n, const coeffs r); // FIXME: n_MPZ( modBase, p, coeffs_BIGINT); ?
     5293        n_Delete(&p,coeffs_BIGINT);
    52925294      }
    52935295    }
Note: See TracChangeset for help on using the changeset viewer.