Changeset 7152fa in git
- Timestamp:
- May 30, 2014, 4:52:30 PM (9 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 29cbfc58717330e765f1af9ef017a028621f797a
- Parents:
- 75424e3a56f41323abd6d3f9936e00e102ff6a6d
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/paraplanecurves.lib
r75424e r7152fa 1973 1973 1974 1974 /////////////////////////////////////////////////////////////////////////////// 1975 proc polyModP(poly q, bigint p)1975 static proc polyModP(poly q, bigint p) 1976 1976 "USAGE: polyModP(q, p); q poly, p bigint 1977 1977 RETURN: takes each coefficient of q modulo p and returns the resulting poly … … 2015 2015 return (-1); 2016 2016 } 2017 2017 2018 /* For p > 32003, we use Cantor-Zassenhaus' algorithm: */ 2018 2019 def br = basering; … … 2109 2110 // 3) lift (x1, x2, ..., xk) in Z/p1^e1 * ... * Z/pk^ek 2110 2111 // to x in Z/m via Chinese remainder theorem 2112 2111 2113 list roots; 2112 2114 // 2.1): -
libpolys/coeffs/longrat.cc
r75424e r7152fa 271 271 { 272 272 mpz_t dummy; 273 mpz_init_set_si(dummy, SR_TO_INT(n)); 274 term = make_cf(dummy); 273 mpz_init_set_si(dummy, SR_TO_INT(n)); 274 term = make_cf(dummy); 275 275 } 276 276 } … … 542 542 nlTest(i, r); 543 543 nlNormalize(i,r); 544 if (SR_HDL(i) & SR_INT) 544 if (SR_HDL(i) & SR_INT) 545 545 { 546 546 int dummy = SR_TO_INT(i); … … 803 803 LONG c=SR_TO_INT(a) % bb; 804 804 /*if(c < 0) 805 { 805 { 806 806 if(bb < 0) 807 807 c = c - bb; … … 820 820 if (SR_HDL(a) & SR_INT) 821 821 { 822 // a is a small and b is a large int: -> a 822 // a is a small and b is a large int: -> a 823 823 // INCORRECT, IT COULD HAPPEN THAT b IS A SMALL NUMBER 824 number aa; 825 aa=ALLOC_RNUMBER(); 824 number aa=ALLOC_RNUMBER(); 826 825 mpz_init(aa->z); 827 826 mpz_set_si(aa->z, SR_TO_INT(a)); … … 831 830 #endif 832 831 u->s = 3; 833 mpz_init(u->z); 832 mpz_init(u->z); 834 833 mpz_mod(u->z,aa->z,b->z); 835 834 if (mpz_isNeg(u->z)) 836 835 { 837 838 839 840 836 if (mpz_isNeg(b->z)) 837 mpz_sub(u->z,aa->z,b->z); 838 else 839 mpz_add(u->z,aa->z,b->z); 841 840 } 842 841 /*mpz_t dummy; … … 855 854 } 856 855 mpz_clear(dummy);*/ 857 if (aa!=NULL) 858 { 859 mpz_clear(aa->z); 856 mpz_clear(aa->z); 860 857 #if defined(LDEBUG) 861 858 aa->debug=654324; 862 859 #endif 863 FREE_RNUMBER(aa); 864 } 860 FREE_RNUMBER(aa); 865 861 u=nlShort3(u); 866 862 nlTest(u,r); … … 2985 2981 s_readmpz(f,n->z); 2986 2982 n->s=3; /*sub_type*/ 2983 #if SIZEOF_LONG == 8 2984 n=nlShort3(n); 2985 #endif 2987 2986 return n; 2988 2987 } … … 3011 3010 s_readmpz_base (f,n->z, SSI_BASE); 3012 3011 n->s=sub_type=3; /*subtype-5*/ 3012 #if SIZEOF_LONG == 8 3013 n=nlShort3(n); 3014 #endif 3013 3015 return n; 3014 3016 }
Note: See TracChangeset
for help on using the changeset viewer.