Changeset 368dcf in git for libpolys/coeffs/modulop.cc


Ignore:
Timestamp:
Apr 5, 2018, 2:00:05 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
945ccc9d24666485bf37d032e929710f62e1063af2a4ddf13a67aded2d7eb6d181c2cfda9ceb300a
Parents:
3778c1cd47e473a481bc16cc58ccb6b1767bb99e9c2cf91f31b9174ec4735d6e2fab3ee8ed28b302
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2018-04-05 14:00:05+02:00
git-committer:
GitHub <noreply@github.com>2018-04-05 14:00:05+02:00
Message:
Merge pull request #864 from steenpass/preimage

include kernel/preimage.h in libsingular.h
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.cc

    r9c2cf9 r368dcf  
    4141void    npCoeffWrite  (const coeffs r, BOOLEAN details);
    4242const char *  npRead  (const char *s, number *a,const coeffs r);
     43void nvInpMult(number &a, number b, const coeffs r);
    4344
    4445#ifdef LDEBUG
     
    9495  n_Test(c, r);
    9596  return c;
     97}
     98
     99void npInpMult (number &a,number b, const coeffs r)
     100{
     101  n_Test(a, r);
     102  n_Test(b, r);
     103
     104  if (((long)a == 0) || ((long)b == 0))
     105    a=(number)0;
     106  else
     107    a = npMultM(a,b, r);
     108  n_Test(a, r);
    96109}
    97110
     
    471484
    472485  r->cfMult  = npMult;
    473   r->cfInpMult  = npInpMultM;
     486  r->cfInpMult  = npInpMult;
    474487  r->cfSub   = npSubM;
    475488  r->cfAdd   = npAddM;
     
    509522  //r->cfName = ndName;
    510523  //r->cfInpMult=ndInpMult;
    511 #ifdef NV_OPS
    512   if (c>NV_MAX_PRIME)
    513   {
    514     r->cfMult  = nvMult;
    515     r->cfDiv   = nvDiv;
    516     r->cfExactDiv= nvDiv;
    517     r->cfInvers= nvInvers;
    518     //r->cfPower= nvPower;
    519     if (c>FACTORY_MAX_PRIME)
    520     {
    521       r->convSingNFactoryN=ndConvSingNFactoryN;
    522     }
    523   }
    524 #endif
     524  r->convSingNFactoryN=npConvSingNFactoryN;
     525  r->convFactoryNSingN=npConvFactoryNSingN;
     526  r->cfRandom=npRandom;
    525527#ifdef LDEBUG
    526528  // debug stuff
    527529  r->cfDBTest=npDBTest;
    528530#endif
    529 
    530   r->convSingNFactoryN=npConvSingNFactoryN;
    531   r->convFactoryNSingN=npConvFactoryNSingN;
    532 
    533   r->cfRandom=npRandom;
    534531
    535532  // io via ssi
     
    547544#endif
    548545  {
    549 #if !defined(HAVE_DIV_MOD) || !defined(HAVE_MULT_MOD)
    550     r->npExpTable=(unsigned short *)omAlloc( r->ch*sizeof(unsigned short) );
    551     r->npLogTable=(unsigned short *)omAlloc( r->ch*sizeof(unsigned short) );
     546#ifdef HAVE_DIV_MOD
     547    r->npInvTable=(unsigned short*)omAlloc0( r->ch*sizeof(unsigned short) );
     548#elif (!defined(HAVE_MULT_MOD)||(!HAVE_DIV_MOD))
     549    r->npExpTable=(unsigned short *)omAlloc0( r->ch*sizeof(unsigned short) );
     550    r->npLogTable=(unsigned short *)omAlloc0( r->ch*sizeof(unsigned short) );
    552551    r->npExpTable[0] = 1;
    553552    r->npLogTable[0] = 0;
     
    578577    }
    579578#endif
    580 #ifdef HAVE_DIV_MOD
    581     r->npInvTable=(unsigned short*)omAlloc0( r->ch*sizeof(unsigned short) );
    582 #endif
    583   }
     579  }
     580#ifdef NV_OPS
     581  else /*if (c>NV_MAX_PRIME)*/
     582  {
     583    r->cfMult  = nvMult;
     584    r->cfDiv   = nvDiv;
     585    r->cfExactDiv = nvDiv;
     586    r->cfInvers  = nvInvers;
     587    r->cfInpMult = nvInpMult;
     588    //r->cfPower= nvPower;
     589    //if (c>FACTORY_MAX_PRIME) // factory will catch this error
     590    //{
     591    //  r->convSingNFactoryN=ndConvSingNFactoryN;
     592    //}
     593  }
     594#endif
    584595  return FALSE;
    585596}
     
    780791}
    781792
    782 void   nvInpMult(number &a, number b, const coeffs r)
     793void nvInpMult(number &a, number b, const coeffs r)
    783794{
    784795  number n=nvMultM(a,b,r);
    785796  a=n;
    786797}
    787 
    788798
    789799static inline long nvInvMod(long a, const coeffs R)
Note: See TracChangeset for help on using the changeset viewer.