Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:15:11

0001 /*
0002     Copyright (C) 2020 Daniel Schultz
0003 
0004     This file is part of FLINT.
0005 
0006     FLINT is free software: you can redistribute it and/or modify it under
0007     the terms of the GNU Lesser General Public License (LGPL) as published
0008     by the Free Software Foundation; either version 3 of the License, or
0009     (at your option) any later version.  See <https://www.gnu.org/licenses/>.
0010 */
0011 
0012 #ifndef FMPQ_MPOLY_FACTOR_H
0013 #define FMPQ_MPOLY_FACTOR_H
0014 
0015 #ifdef FMPQ_MPOLY_FACTOR_INLINES_C
0016 #define FMPQ_MPOLY_FACTOR_INLINE
0017 #else
0018 #define FMPQ_MPOLY_FACTOR_INLINE static inline
0019 #endif
0020 
0021 #include "fmpq_mpoly.h"
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 void fmpq_mpoly_factor_init(fmpq_mpoly_factor_t f,
0028                                                    const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx));
0029 
0030 void fmpq_mpoly_factor_realloc(fmpq_mpoly_factor_t f,
0031                                       slong alloc, const fmpq_mpoly_ctx_t ctx);
0032 
0033 void fmpq_mpoly_factor_fit_length(fmpq_mpoly_factor_t f,
0034                                         slong len, const fmpq_mpoly_ctx_t ctx);
0035 
0036 void fmpq_mpoly_factor_clear(fmpq_mpoly_factor_t f,
0037                                                    const fmpq_mpoly_ctx_t ctx);
0038 
0039 FMPQ_MPOLY_FACTOR_INLINE
0040 slong fmpq_mpoly_factor_length(const fmpq_mpoly_factor_t f,
0041                                                     const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx))
0042 {
0043     return f->num;
0044 }
0045 
0046 FMPQ_MPOLY_FACTOR_INLINE
0047 void fmpq_mpoly_factor_get_constant_fmpq(fmpq_t c,
0048                       const fmpq_mpoly_factor_t f, const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx))
0049 {
0050     fmpq_set(c, f->constant);
0051 }
0052 
0053 FMPQ_MPOLY_FACTOR_INLINE
0054 void fmpq_mpoly_factor_get_base(fmpq_mpoly_t p, const fmpq_mpoly_factor_t f,
0055                                            slong i, const fmpq_mpoly_ctx_t ctx)
0056 {
0057     FLINT_ASSERT(i < (ulong) f->num);
0058     fmpq_mpoly_set(p, f->poly + i, ctx);
0059 }
0060 
0061 FMPQ_MPOLY_FACTOR_INLINE
0062 void fmpq_mpoly_factor_swap_base(fmpq_mpoly_t p, fmpq_mpoly_factor_t f,
0063                                            slong i, const fmpq_mpoly_ctx_t ctx)
0064 {
0065     FLINT_ASSERT(i < (ulong) f->num);
0066     fmpq_mpoly_swap(p, f->poly + i, ctx);
0067 }
0068 
0069 FMPQ_MPOLY_FACTOR_INLINE
0070 slong fmpq_mpoly_factor_get_exp_si(fmpq_mpoly_factor_t f,
0071                                            slong i, const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx))
0072 {
0073     FLINT_ASSERT(i < (ulong) f->num);
0074     return fmpz_get_si(f->exp + i);
0075 }
0076 
0077 
0078 void fmpq_mpoly_factor_sort(fmpq_mpoly_factor_t f,
0079                                                    const fmpq_mpoly_ctx_t ctx);
0080 
0081 int fmpq_mpoly_factor_make_monic(fmpq_mpoly_factor_t f,
0082                                                    const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx));
0083 
0084 int fmpq_mpoly_factor_make_integral(fmpq_mpoly_factor_t f,
0085                                                    const fmpq_mpoly_ctx_t FLINT_UNUSED(ctx));
0086 
0087 int fmpq_mpoly_factor_squarefree(fmpq_mpoly_factor_t f,
0088                              const fmpq_mpoly_t A, const fmpq_mpoly_ctx_t ctx);
0089 
0090 int fmpq_mpoly_factor(fmpq_mpoly_factor_t f, const fmpq_mpoly_t A,
0091                                                    const fmpq_mpoly_ctx_t ctx);
0092 
0093 void _fmpq_mpoly_factor_swap_fmpz_mpoly_factor(fmpq_mpoly_factor_t f,
0094             fmpz_mpoly_factor_t g, const fmpq_t c, const fmpq_mpoly_ctx_t ctx);
0095 
0096 int fmpq_mpoly_factor_expand(fmpq_mpoly_t A,
0097                       const fmpq_mpoly_factor_t f, const fmpq_mpoly_ctx_t ctx);
0098 
0099 #ifdef __cplusplus
0100 }
0101 #endif
0102 
0103 #endif