Changeset 1c37e0 in git
- Timestamp:
- Jul 15, 2020, 10:47:01 PM (4 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- bc9b1fc707213e0fb991294802a5ed1b2e721885
- Parents:
- 2486f460fbcdd44c72acea7779937ed446323e1f
- Location:
- libpolys/coeffs
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/Makefile.am
r2486f4 r1c37e0 24 24 libcoeffs_la_includedir =$(includedir)/singular/coeffs 25 25 libcoeffs_la_include_HEADERS = \ 26 coeffs.h numbers.h si_gmp.h gnumpc.h gnumpfl.h longrat.h modulop.h ffields.h rintegers.h rmodulo2m.h rmodulon.h \ 26 coeffs.h numbers.h si_gmp.h gnumpc.h gnumpfl.h longrat.h modulop.h modulop_inl.h \ 27 ffields.h rintegers.h rmodulo2m.h rmodulon.h \ 27 28 shortfl.h mpr_complex.h mpr_global.h numstats.h ntupel.h \ 28 29 bigintmat.h Enumerator.h \ -
libpolys/coeffs/modulop.cc
r2486f4 r1c37e0 25 25 26 26 BOOLEAN npGreaterZero (number k, const coeffs r); 27 number npMult (number a, number b, const coeffs r);28 number npInit (long i, const coeffs r);29 27 long npInt (number &n, const coeffs r); 30 28 void npPower (number a, int i, number * result,const coeffs r); 31 29 BOOLEAN npIsZero (number a,const coeffs r); 32 BOOLEAN npIsOne (number a,const coeffs r);33 30 BOOLEAN npIsMOne (number a,const coeffs r); 34 31 number npDiv (number a, number b,const coeffs r); … … 47 44 nMapFunc npSetMap(const coeffs src, const coeffs dst); 48 45 46 #include "coeffs/modulop_inl.h" // npMult, npInit 47 49 48 #ifdef NV_OPS 50 #pragma GCC diagnostic ignored "-Wlong-long"51 static inline number nvMultM(number a, number b, const coeffs r)52 {53 assume( getCoeffType(r) == n_Zp );54 55 #if SIZEOF_LONG == 456 #define ULONG64 (unsigned long long)(unsigned long)57 #else58 #define ULONG64 (unsigned long)59 #endif60 return (number)61 (unsigned long)((ULONG64 a)*(ULONG64 b) % (ULONG64 r->ch));62 }63 number nvMult (number a, number b, const coeffs r);64 49 number nvDiv (number a, number b, const coeffs r); 65 50 number nvInvers (number c, const coeffs r); … … 83 68 //} 84 69 85 number npMult (number a,number b, const coeffs r)86 {87 n_Test(a, r);88 n_Test(b, r);89 90 if (((long)a == 0) || ((long)b == 0))91 return (number)0;92 number c = npMultM(a,b, r);93 n_Test(c, r);94 return c;95 }96 70 97 71 void npInpMult (number &a,number b, const coeffs r) … … 106 80 n_Test(a, r); 107 81 } 108 109 /*2110 * create a number from int111 */112 number npInit (long i, const coeffs r)113 {114 long ii=i % (long)r->ch;115 if (ii < 0L) ii += (long)r->ch;116 117 number c = (number)ii;118 n_Test(c, r);119 return c;120 }121 122 82 123 83 /*2 … … 692 652 // ---------------------------------------------------------- 693 653 #ifdef NV_OPS 694 695 number nvMult (number a,number b, const coeffs r)696 {697 //if (((long)a == 0) || ((long)b == 0))698 // return (number)0;699 //else700 return nvMultM(a,b,r);701 }702 703 654 void nvInpMult(number &a, number b, const coeffs r) 704 655 { 705 number n=nvMult M(a,b,r);656 number n=nvMult(a,b,r); 706 657 a=n; 707 658 } … … 725 676 { 726 677 number inv=nvInversM(b,r); 727 return nvMult M(a,inv,r);678 return nvMult(a,inv,r); 728 679 } 729 680 } … … 752 703 { 753 704 nvPower(a,i-1,result,r); 754 *result = nvMult M(a,*result,r);755 } 756 } 757 #endif 758 #endif 759 705 *result = nvMult(a,*result,r); 706 } 707 } 708 #endif 709 #endif 710 -
libpolys/coeffs/modulop.h
r2486f4 r1c37e0 253 253 long npInt (number &n, const coeffs r); 254 254 255 // The folloing is reused inside tgb*.cc256 number npMult (number a, number b, const coeffs r);257 258 255 #define npEqualM(A,B,r) ((A)==(B)) 259 256 260 261 #endif 257 #endif
Note: See TracChangeset
for help on using the changeset viewer.