Changeset a8d220b in git
- Timestamp:
- Jul 3, 2020, 9:46:31 AM (3 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- b287470827373f8b355e6acb8f830baa5b3e88d1
- Parents:
- 3801735313555d3e7900ceb38636374dc2183a76
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_chinese.cc
r380173 ra8d220b 18 18 #ifdef HAVE_NTL 19 19 #include "NTLconvert.h" 20 #endif 21 22 #ifdef HAVE_FLINT 23 #include "FLINTconvert.h" 20 24 #endif 21 25 … … 159 163 } 160 164 161 #if ndef HAVE_NTL165 #if 0 162 166 CanonicalForm Farey_n (CanonicalForm N, const CanonicalForm P) 163 167 //"USAGE: Farey_n (N,P); P, N number; … … 203 207 CanonicalForm c; 204 208 CFIterator i; 205 #ifdef HAVE_NTL 209 #ifdef HAVE_FLINT 210 fmpz_t FLINTq; 211 fmpz_init(FLINTq); 212 convertCF2Fmpz(FLINTq,q); 213 fmpz_t FLINTc; 214 fmpz_init(FLINTc); 215 fmpq_t FLINTres; 216 fmpq_init(FLINTres); 217 #elif defined(HAVE_NTL) 206 218 ZZ NTLq= convertFacCF2NTLZZ (q); 207 219 ZZ bound; … … 213 225 if ( c.inCoeffDomain()) 214 226 { 215 #ifdef HAVE_NTL 227 #ifdef HAVE_FLINT 228 if (c.inZ()) 229 { 230 convertCF2Fmpz(FLINTc,c); 231 fmpq_reconstruct_fmpz(FLINTres,FLINTc,FLINTq); 232 result += power (x, i.exp())*(convertFmpq2CF(FLINTres)); 233 } 234 #elif defined(HAVE_NTL) 216 235 if (c.inZ()) 217 236 { … … 232 251 } 233 252 } 253 #endif 234 254 else 235 255 result += power( x, i.exp() ) * Farey(c,q); 236 #else237 if (c.inZ())238 result += power( x, i.exp() ) * Farey_n(c,q);239 else240 result += power( x, i.exp() ) * Farey(c,q);241 #endif242 256 } 243 257 else … … 245 259 } 246 260 if (is_rat) On(SW_RATIONAL); 261 #ifdef HAVE_FLINT 262 fmpq_clear(FLINTres); 263 fmpz_clear(FLINTc); 264 fmpz_clear(FLINTq); 265 #endif 247 266 return result; 248 267 }
Note: See TracChangeset
for help on using the changeset viewer.