Changeset 8c676a in git
- Timestamp:
- Dec 7, 2012, 2:10:10 PM (11 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 6554ca42ebe1277c9afe7990970390905a6e1cf0
- Parents:
- 7d62506924687f1914af2e044e72b7886ce66aa39f4478c6aeef3d7c745ba2ee7f65f37f65b2ade5
- Location:
- libpolys
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
r7d6250 r8c676a 2545 2545 if (mpz_cmp(tmp,P)<0) 2546 2546 { 2547 // return N/B2548 z=ALLOC_RNUMBER();2549 #ifdef LDEBUG2550 z->debug=123456;2551 #endif2552 2547 if (mpz_isNeg(B)) 2553 2548 { … … 2555 2550 mpz_neg(N,N); 2556 2551 } 2557 mpz_init_set(z->z,N); 2558 mpz_init_set(z->n,B); 2559 z->s = 0; 2560 nlNormalize(z,r); 2552 // check for gcd(N,B)==1 2553 mpz_gcd(tmp,N,B); 2554 if (mpz_cmp_ui(tmp,1)==0) 2555 { 2556 // return N/B 2557 z=ALLOC_RNUMBER(); 2558 #ifdef LDEBUG 2559 z->debug=123456; 2560 #endif 2561 mpz_init_set(z->z,N); 2562 mpz_init_set(z->n,B); 2563 z->s = 0; 2564 nlNormalize(z,r); 2565 } 2566 else 2567 { 2568 // return nN (the input) instead of "fail" 2569 z=nlCopy(nN,r); 2570 } 2561 2571 break; 2562 2572 } -
libpolys/polys/ext_fields/transext.cc
r7d6250 r8c676a 1239 1239 void ntNormalize (number &a, const coeffs cf) 1240 1240 { 1241 if ((a!=NULL) &&(DEN(a)!=NULL))1241 if ((a!=NULL)) 1242 1242 { 1243 1243 definiteGcdCancellation(a, cf, FALSE); … … 1862 1862 ntNormalize(n, cf); 1863 1863 1864 fraction f = (fraction)n ;1864 fraction f = (fraction)ntGetDenom (n, cf); 1865 1865 1866 1866 assume( f != NULL ); 1867 1867 1868 const poly den = DEN(f);1868 const poly den = NUM(f); 1869 1869 1870 1870 if( den == NULL ) // ?? / 1 ? … … 1879 1879 // TODO: move the following to factory? 1880 1880 poly gcd = singclap_gcd(p_Copy(cand, R), p_Copy(den, R), R); // gcd(cand, den) is monic no mater leading coeffs! :(((( 1881 if (nCoeff_is_Q (Q)) 1882 { 1883 number LcGcd= n_Gcd (p_GetCoeff (cand, R), p_GetCoeff(den, R), Q); 1884 gcd = p_Mult_nn(gcd, LcGcd, R); 1885 } 1881 1886 // assume( n_IsOne(pGetCoeff(gcd), Q) ); // TODO: this may be wrong... 1882 1887 cand = p_Mult_q(cand, p_Copy(den, R), R); // cand *= den -
libpolys/polys/monomials/p_polys.cc
r7d6250 r8c676a 1908 1908 static number p_InitContent(poly ph, const ring r); 1909 1909 1910 #define CLEARENUMERATORS 01910 #define CLEARENUMERATORS 1 1911 1911 1912 1912 void p_Content(poly ph, const ring r)
Note: See TracChangeset
for help on using the changeset viewer.