1 /*
2     Copyright (C) 2013 Mike Hansen
3 
4     This file is part of FLINT.
5 
6     FLINT is free software: you can redistribute it and/or modify it under
7     the terms of the GNU Lesser General Public License (LGPL) as published
8     by the Free Software Foundation; either version 2.1 of the License, or
9     (at your option) any later version.  See <http://www.gnu.org/licenses/>.
10 */
11 
12 #ifndef FQ_POLY_FACTOR_H
13 #define FQ_POLY_FACTOR_H
14 
15 #ifdef FQ_POLY_FACTOR_INLINES_C
16 #define FQ_POLY_FACTOR_TEMPLATES_INLINE FLINT_DLL
17 #define FQ_POLY_FACTOR_INLINE FLINT_DLL
18 #else
19 #define FQ_POLY_FACTOR_TEMPLATES_INLINE static __inline__
20 #define FQ_POLY_FACTOR_INLINE static __inline__
21 #endif
22 
23 FQ_POLY_FACTOR_INLINE
FQ_POLY_ITERATED_FROBENIUS_CUTOFF(const fq_ctx_t ctx,slong length)24 int FQ_POLY_ITERATED_FROBENIUS_CUTOFF(const fq_ctx_t ctx, slong length)
25 {
26     int result;
27     fmpz_t q;
28     fmpz_init(q);
29     fq_ctx_order(q, ctx);
30     if ( fmpz_sizeinbase(q, 2) < 3 * (n_sqrt(length) + 1))
31         result = 1;
32     else
33         result = 0;
34     fmpz_clear(q);
35     return result;
36 }
37 
38 #ifdef T
39 #undef T
40 #endif
41 
42 #define T fq
43 #define CAP_T FQ
44 #include "fq_poly_factor_templates.h"
45 #undef CAP_T
46 #undef T
47 
48 /* Inlines *******************************************************************/
49 
50 FLINT_DLL void fq_poly_factor_get_poly(fq_poly_t z, fq_poly_factor_t fac, slong i, fq_ctx_t ctx);
51 
52 #endif
53