-
Notifications
You must be signed in to change notification settings - Fork 276
Prototype fixes #2452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype fixes #2452
Conversation
|
I used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is completely unused in FLINT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially a useful algorithm. Maybe @pascalmolin can document it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this file and entrywise_not_is_zero.c. Not sure why they exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were added at some point because the author needed them. It's possible that they are used externally. We can perhaps deprecate them and remove them in the next next release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also unused? @fredrik-johansson can you just verify that this has no use case for FLINT? I recall it existing in some comment somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at some point Dan wanted to do arithmetic on fmpz_mpoly in factored form, but this function is not very interesting on its own. OK to delete.
17ac6c3 to
5fd7ecb
Compare
|
Could you please do this as several independent PRs, where each PR does one kind of change? |
|
I'm really not convinced that the |
| @@ -404,301 +404,6 @@ int nmod_mpolyun_equal( | |||
| return 1; | |||
| } | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit uneasy about outright deleting this kind of mpoly code. It sometimes helps understand the (poorly documented) code that is actually used. Could you ifdef it out instead, with a comment like "This code is unused. TODO: delete it when the surrounding code is adequately tested and commented."? I think I've already done this elsewhere.
| /* | ||
| Display a relation for debugging purposes | ||
| */ | ||
| void qsieve_display_relation(qs_t qs_inf, relation_t a) | ||
| { | ||
| slong i; | ||
|
|
||
| flint_printf("%wu ", a.lp); | ||
|
|
||
| for (i = 0; i < qs_inf->small_primes; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check
|
|
||
| void nmod_mpolyu_msub(nmod_mpolyu_t R, nmod_mpolyu_t A, nmod_mpolyu_t B, | ||
| nmod_mpoly_t c, slong e, const nmod_mpoly_ctx_t ctx) | ||
| { | ||
| slong i, j, k; | ||
| nmod_mpoly_t T; | ||
|
|
||
| nmod_mpolyu_fit_length(R, A->length + B->length, ctx); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check
| void _n_fq_poly_rem_basecase_( | ||
| ulong * Q, | ||
| ulong * A, | ||
| const ulong * AA, slong Alen, | ||
| const ulong * B, slong Blen, | ||
| const ulong * invB, | ||
| const fq_nmod_ctx_t ctx, | ||
| n_poly_stack_t St) | ||
| { | ||
| slong i; | ||
| slong d = fq_nmod_ctx_degree(ctx); | ||
| nmod_t mod = fq_nmod_ctx_mod(ctx); | ||
| ulong * tmp = n_poly_stack_vec_init(St, d*(3 + N_FQ_POLY_DIVREM_BASECASE_ITCH)); | ||
| ulong * u = tmp + d*N_FQ_POLY_DIVREM_BASECASE_ITCH; | ||
| ulong * q0 = u + d; | ||
| ulong * q1 = q0 + d; | ||
|
|
||
| if (A != AA) | ||
| _nmod_vec_set(A, AA, d*Alen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header
| int fq_zech_mpoly_repack_bits(fq_zech_mpoly_t A, const fq_zech_mpoly_t B, | ||
| flint_bitcnt_t Abits, const fq_zech_mpoly_ctx_t ctx) | ||
| { | ||
| slong i; | ||
| int success; | ||
| fq_zech_mpoly_t T; | ||
|
|
||
| Abits = mpoly_fix_bits(Abits, ctx->minfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
|
|
||
| /* if the coefficient doesn't exist, a new one is created (and set to zero) */ | ||
| fq_zech_mpoly_struct * _fq_zech_mpolyu_get_coeff(fq_zech_mpolyu_t A, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| void fq_zech_mpoly_evaluate_all_ui(fq_zech_t eval, const fq_zech_mpoly_t A, | ||
| fq_zech_struct * const * vals, const fq_zech_mpoly_ctx_t ctx) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| void fq_nmod_mpoly_to_mpolyuu_perm_deflate( | ||
| fq_nmod_mpolyu_t A, | ||
| const fq_nmod_mpoly_ctx_t uctx, | ||
| const fq_nmod_mpoly_t B, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| fmpzi_norm_approx_d_2exp(slong * exp, const fmpzi_t x) | ||
| { | ||
| double a, b; | ||
| slong aexp, bexp; | ||
| int e; | ||
|
|
||
| a = fmpz_get_d_2exp(&aexp, fmpzi_realref(x)); | ||
| b = fmpz_get_d_2exp(&bexp, fmpzi_imagref(x)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| /* | ||
| assuming that the conversion can be done, set poly1 and poly1_shift | ||
| so that poly2 is poly1 * X^poly1_shift | ||
| TODO: handle multiprecision exponents | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to header
| void fmpz_mod_mpolyu_repack_bits_inplace( | ||
| fmpz_mod_mpolyu_t A, | ||
| flint_bitcnt_t bits, | ||
| const fmpz_mod_mpoly_ctx_t ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| void fmpz_mod_mpolyu_one(fmpz_mod_mpolyu_t A, const fmpz_mod_mpoly_ctx_t uctx) | ||
| { | ||
| fmpz_mod_mpolyu_fit_length(A, WORD(1), uctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| /* | ||
| E = A(v = alpha) | ||
| A is in R[v][x] | ||
| E is in R[x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| void fmpz_mod_mpoly_univar_set( | ||
| fmpz_mod_mpoly_univar_t A, | ||
| const fmpz_mod_mpoly_univar_t B, | ||
| const fmpz_mod_mpoly_ctx_t ctx) | ||
| { | ||
| slong i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
| void | ||
| _acb_dirichlet_theta_arb_series(acb_t res, const dirichlet_group_t G, const dirichlet_char_t chi, const arb_t xt, slong len, slong prec) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header
| acb_dirichlet_platt_isolate_local_hardy_z_zeros( | ||
| arf_interval_ptr res, const fmpz_t n, slong len, slong prec) | ||
| { | ||
| if (len <= 0 || fmpz_sizeinbase(n, 10) < 5) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header
| slong | ||
| _acb_dirichlet_platt_isolate_local_hardy_z_zeros( | ||
| arf_interval_ptr res, const fmpz_t n, slong len, | ||
| const fmpz_t T, slong A, slong B, | ||
| const arb_t h, const fmpz_t J, slong K, slong sigma_grid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header
| void | ||
| acb_dft_inverse_cyc(acb_ptr w, acb_srcptr v, slong len, slong prec) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header
| void | ||
| mag_rsqrt_re_quadrant1_lower(mag_t res, const mag_t x, const mag_t y) | ||
| { | ||
| if (mag_is_zero(x)) | ||
| { | ||
| mag_one(res); | ||
| mag_mul_2exp_si(res, res, -1); | ||
| } | ||
| else | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 0
5fd7ecb to
501aa7a
Compare
|
@fredrik-johansson everything should be fixed accordingly now. |
Background
With #2438, I enabled warnings when global functions were defined without a prior prototype given. This intends to warns users that
static.Moreover, declaring prototypes inside source files should be considered a bad habit. Typically in FLINT, prototypes are given inside source files for:
However, when giving the prototype inside a source file, no check is done for ABI compatibilities. Hence, things may break.
This PR
In this PR, I declare a lot of functions
static. Moreover, I implement*/impl.hheaders, intended for declaring internal functions and use them where necessary.However, this PR is not complete, and I will continue working on doing all modules (now I have only done it up until GR) and all tests (so that I can push
-Wmissing-prototypesto the tests).