Skip to content
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

[WIP] Pointers #1084

Closed
wants to merge 5 commits into from
Closed

[WIP] Pointers #1084

wants to merge 5 commits into from

Conversation

albinahlback
Copy link
Collaborator

Very descriptive title. Basically I am trying to make pointer types for (almost) every type in FLINT such that #1079 can be solved.

I also aim to make the types in FLINT more coherent. Not only within the repository, but also with GMP. For examples within FLINT, we have n_factor_t which at the moment is not a one-element array, but a struct. Very confusing. Also, the types in apcrl is named different compared to all the other parts in FLINT.

I do not aim to simply change everything. I still think that the documentation should try to involve types such as fmpz_t instead of fmpz_ptr for the sake of not involving too many types in the documentation, but the actual declarations should have the pointer versions in order to not get warnings from GCC about overreadings; At least when things are on the form const mystruct[1], but the other variants should change as well for the sake of coherency.

I know this has not really been discussed yet, but I think it is the way to go.

For specific namings schemes, please see the commit messages.

In order to better comply with GMP and to not get warnings when
compiling, change the array-type inputs to pointers. Here the earlier
types where changed by

    _aprcl_config -> aprcl_config_struct
    aprcl_config  -> aprcl_config_t

and new types where introduced:

    aprcl_config_ptr    = aprcl_config_struct *
    aprcl_config_srcptr = const aprcl_config_struct *

Analogue changes were made to unity_zp[q].
Thus, the following types were added

    d_mat_ptr    = d_mat_struct *
    d_mat_srcptr = const d_mat_struct *
Changed

    flint_rand_s -> flint_rand_struct

and introduced the new types

    flint_rand_ptr    = flint_rand_struct *
    flint_rand_srcptr = const flint_rand_struct *
Changed the whole n_factor to pointer based, as it was not pointer based
earlier. Thus, the following types were introduced:

    n_factor_struct
    n_factor_t      = n_factor_struct[1]
    n_factor_ptr    = n_factor_struct *
    n_factor_srcptr = const n_factor_struct *
@albinahlback albinahlback deleted the pointers branch April 2, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant