Changeset 1950d7 in git


Ignore:
Timestamp:
Oct 28, 2020, 12:51:54 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
2694e4bb422106b6c10873c2b061ad87b870f453
Parents:
0a6f360449d9d3f50e2f00fcff58bd71f9c1917c
Message:
opt: nlGMP -> nlMPZ, nlMapGMP -> nlInitMPZ
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r0a6f36 r1950d7  
    18381838  LL->Init(2);
    18391839  LL->m[0].rtyp=BIGINT_CMD;
    1840   LL->m[0].data=nlMapGMP((number) C->modBase, C, coeffs_BIGINT);
     1840  LL->m[0].data=n_InitMPZ( C->modBase, coeffs_BIGINT);
    18411841  LL->m[1].rtyp=INT_CMD;
    18421842  LL->m[1].data=(void *) C->modExponent;
     
    18671867  LL->Init(2);
    18681868  LL->m[0].rtyp=BIGINT_CMD;
    1869   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); ?
     1869  LL->m[0].data=n_InitMPZ( R->cf->modBase, R->cf);
    18701870  LL->m[1].rtyp=INT_CMD;
    18711871  LL->m[1].data=(void *) R->cf->modExponent;
     
    58375837      {
    58385838        number p=(number)pnn->next->CopyD();
    5839         nlGMP(p,modBase,coeffs_BIGINT); // TODO? // extern void   nlGMP(number &i, mpz_t n, const coeffs r); // FIXME: n_MPZ( modBase, p, coeffs_BIGINT); ?
     5839                n_MPZ(modBase,p,coeffs_BIGINT);
    58405840        n_Delete(&p,coeffs_BIGINT);
    58415841      }
  • Singular/number2.cc

    r0a6f36 r1950d7  
    44#include "coeffs/rmodulon.h" // ZnmInfo
    55#include "coeffs/bigintmat.h" // bigintmat
    6 #include "coeffs/longrat.h" // BIGINTs: nlGMP
     6#include "coeffs/longrat.h" // BIGINTs: nlMPZ
    77#include "polys/ext_fields/algext.h" // AlgExtInfo
    88#include "misc/prime.h" // IsPrime
     
    9494    ZnmInfo info;
    9595    mpz_t modBase;
    96     mpz_init(modBase);
    97     nlGMP(i2,modBase,coeffs_BIGINT); // FIXME? TODO? // extern void   nlGMP(number &i, mpz_t n, const coeffs r); // to be replaced with n_MPZ(modBase,i2,coeffs_BIGINT); // ?
     96    nlMPZ(modBase,i2,coeffs_BIGINT);
    9897    info.base= (mpz_ptr)modBase;
    9998    info.exp= 1;
  • libpolys/coeffs/longrat.cc

    r0a6f36 r1950d7  
    6363number   nlBigInt(number &n);
    6464
    65 #ifdef HAVE_RINGS
    66 number nlMapGMP(number from, const coeffs src, const coeffs dst);
    67 #endif
    68 
    6965BOOLEAN  nlGreaterZero(number za, const coeffs r);
    7066number   nlInvers(number a, const coeffs r);
     
    166162}
    167163
     164static number nlInitMPZ(mpz_t m, const coeffs)
     165{
     166  number z = ALLOC_RNUMBER();
     167  z->s = 3;
     168  #ifdef LDEBUG
     169  z->debug=123456;
     170  #endif
     171  mpz_init_set(z->z, m);
     172  z=nlShort3(z);
     173  return z;
     174}
    168175
    169176#if (__GNU_MP_VERSION*10+__GNU_MP_VERSION_MINOR < 31)
     
    197204* convert from a GMP integer
    198205*/
    199 number nlMapGMP(number from, const coeffs /*src*/, const coeffs /*dst*/)
    200 {
    201   number z=ALLOC_RNUMBER();
    202 #if defined(LDEBUG)
    203   z->debug=123456;
    204 #endif
    205   mpz_init_set(z->z,(mpz_ptr) from);
    206   z->s = 3;
    207   z=nlShort3(z);
    208   return z;
     206static inline number nlMapGMP(number from, const coeffs /*src*/, const coeffs dst)
     207{
     208  return nlInitMPZ((mpz_ptr)from,dst);
    209209}
    210210
     
    215215    return from;
    216216  }
    217   return nlMapGMP(from,src,dst);
     217  return nlInitMPZ((mpz_ptr)from,dst);
    218218}
    219219
     
    503503}
    504504
    505 #ifndef P_NUMBERS_H
    506 
    507 static number nlInitMPZ(mpz_t m, const coeffs)
    508 {
    509   number z = ALLOC_RNUMBER();
    510   z->s = 3;
    511   #ifdef LDEBUG
    512   z->debug=123456;
    513   #endif
    514   mpz_init_set(z->z, m);
    515   z=nlShort3(z);
    516   return z;
    517 }
    518 #endif
    519505
    520506static number nlMapC(number from, const coeffs src, const coeffs dst)
  • libpolys/coeffs/longrat.h

    r0a6f36 r1950d7  
    119119number   nlInit2gmp (mpz_t i, mpz_t j, const coeffs r);
    120120
    121 // FIXME: TODO:  why only if HAVE_RINGS? bug?
    122 #  ifdef HAVE_RINGS
    123 void   nlGMP(number &i, mpz_t n, const coeffs r); // to be replaced with n_MPZ(number n, number &i,const coeffs r)???
    124 number nlMapGMP(number from, const coeffs src, const coeffs dst);
    125 #  endif
     121#if 0 // substituted by nlMPZ
     122void   nlGMP(number &i, mpz_t n, const coeffs r);
     123#endif
    126124// for ring similiar to Q/Z (char 0 required):
    127125number   nlChineseRemainderSym(number *x, number *q,int rl, BOOLEAN sym, CFArray &inv_cache,const coeffs CF);
  • libpolys/coeffs/rintegers2.cc

    r0a6f36 r1950d7  
    361361  mpz_ptr erg = (mpz_ptr) omAllocBin(gmp_nrz_bin);
    362362  mpz_init(erg);
    363   nlGMP(from, erg, src); // FIXME? TODO? // extern void   nlGMP(number &i, number n, const coeffs r); // to be replaced with n_MPZ(erg, from, src); // ?
     363  nlMPZ(erg, from, src);
    364364  return (number) erg;
    365365}
  • libpolys/coeffs/rmodulo2m.cc

    r0a6f36 r1950d7  
    635635{
    636636  mpz_ptr gmp = (mpz_ptr)omAllocBin(gmp_nrz_bin);
    637   mpz_init(gmp);
    638   nlGMP(from, gmp, src); // FIXME? TODO? // extern void   nlGMP(number &i, number n, const coeffs r); // to be replaced with n_MPZ(erg, from, src); // ?
     637  nlMPZ(gmp, from, src);
    639638  number res=nr2mMapGMP((number)gmp,src,dst);
    640639  mpz_clear(gmp); omFree((ADDRESS)gmp);
  • libpolys/coeffs/rmodulon.cc

    r0a6f36 r1950d7  
    711711{
    712712  mpz_ptr erg = (mpz_ptr)omAllocBin(gmp_nrz_bin);
    713   mpz_init(erg);
    714   nlGMP(from, erg, src); // FIXME? TODO? // extern void   nlGMP(number &i, number n, const coeffs r); // to be replaced with n_MPZ(erg, from, src); // ?
     713  nlMPZ(erg, from, src);
    715714  mpz_mod(erg, erg, dst->modNumber);
    716715  return (number)erg;
Note: See TracChangeset for help on using the changeset viewer.