Changeset 837062d in git
- Timestamp:
- Mar 14, 2019, 4:47:34 PM (5 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- b0e0160986d9991e7d5712943e2779967a201ecc
- Parents:
- 34ee120584348ffdd171335e368f086111c83d06
- Location:
- libpolys/polys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/flintconv.cc
r34ee12 r837062d 15 15 #if __FLINT_RELEASE >= 20500 16 16 #include "coeffs/coeffs.h" 17 #include "coeffs/longrat.h" 17 18 #include "polys/monomials/p_polys.h" 18 19 … … 43 44 } 44 45 45 void convSingNFlintN(fmpz_t f, mpz_t z) 46 number convFlintNSingN (fmpz_t f) 47 { 48 mpz_t z; 49 mpz_init(z); 50 fmpz_get_mpz(z,f); 51 number n; 52 nlMPZ(z,n,NULL); 53 return n; 54 } 55 number convFlintNSingN (fmpq_t f) 56 { 57 number z=ALLOC_RNUMBER(); 58 #if defined(LDEBUG) 59 z->debug=123456; 60 #endif 61 fmpz_get_mpz_frac(z->z,z->n,f); 62 nlNormalize(z,NULL); 63 return z; 64 } 65 66 void convSingNFlintN(fmpz_t f, mpz_t n) 46 67 { 47 68 fmpz_init(f); 48 fmpz_set_mpz(f,z); 69 fmpz_set_mpz(f,n); 70 } 71 72 void convSingNFlintN(fmpz_t f, number n) 73 { 74 fmpz_init(f); 75 fmpz_set_mpz(f,(mpz_ptr)n); 76 } 77 78 void convSingNFlintN(fmpq_t f, number n) 79 { 80 fmpq_init(f); 81 if (SR_HDL(n)&SR_INT) 82 fmpq_set_si(f,SR_TO_INT(n),1); 83 else if (n->s<3) 84 { 85 fmpz_set_mpz(fmpq_numref(f), n->z); 86 fmpz_set_mpz(fmpq_denref(f), n->n); 87 } 88 else 89 { 90 mpz_t one; 91 mpz_init_set_si(one,1); 92 fmpz_set_mpz(fmpq_numref(f), n->z); 93 fmpz_set_mpz(fmpq_denref(f), one); 94 mpz_clear(one); 95 } 49 96 } 50 97 -
libpolys/polys/flintconv.h
r34ee12 r837062d 41 41 void convFlintNSingN (mpz_t z, fmpz_t f); 42 42 void convSingNFlintN(fmpz_t f, mpz_t z); 43 void convSingNFlintN(fmpz_t f, number n); 44 void convSingNFlintN(fmpq_t f, number n); 45 number convFlintNSingN (fmpz_t f); 46 number convFlintNSingN (fmpq_t f); 47 43 48 bigintmat* singflint_LLL(bigintmat* A, bigintmat* T); 44 49 intvec* singflint_LLL(intvec* A, intvec* T);
Note: See TracChangeset
for help on using the changeset viewer.