Changeset 368dcf in git for libpolys/coeffs/modulop.cc
- Timestamp:
- Apr 5, 2018, 2:00:05 PM (6 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/modulop.cc
r9c2cf9 r368dcf 41 41 void npCoeffWrite (const coeffs r, BOOLEAN details); 42 42 const char * npRead (const char *s, number *a,const coeffs r); 43 void nvInpMult(number &a, number b, const coeffs r); 43 44 44 45 #ifdef LDEBUG … … 94 95 n_Test(c, r); 95 96 return c; 97 } 98 99 void 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); 96 109 } 97 110 … … 471 484 472 485 r->cfMult = npMult; 473 r->cfInpMult = npInpMult M;486 r->cfInpMult = npInpMult; 474 487 r->cfSub = npSubM; 475 488 r->cfAdd = npAddM; … … 509 522 //r->cfName = ndName; 510 523 //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; 525 527 #ifdef LDEBUG 526 528 // debug stuff 527 529 r->cfDBTest=npDBTest; 528 530 #endif 529 530 r->convSingNFactoryN=npConvSingNFactoryN;531 r->convFactoryNSingN=npConvFactoryNSingN;532 533 r->cfRandom=npRandom;534 531 535 532 // io via ssi … … 547 544 #endif 548 545 { 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) ); 552 551 r->npExpTable[0] = 1; 553 552 r->npLogTable[0] = 0; … … 578 577 } 579 578 #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 584 595 return FALSE; 585 596 } … … 780 791 } 781 792 782 void 793 void nvInpMult(number &a, number b, const coeffs r) 783 794 { 784 795 number n=nvMultM(a,b,r); 785 796 a=n; 786 797 } 787 788 798 789 799 static inline long nvInvMod(long a, const coeffs R)
Note: See TracChangeset
for help on using the changeset viewer.