Skip to content

Commit

Permalink
Merge pull request #1590 from albinahlback/pointer_docs
Browse files Browse the repository at this point in the history
Unify placement of asterisk for pointers in docs
  • Loading branch information
albinahlback authored Nov 8, 2023
2 parents 91f1cb6 + c5de2ce commit 80dd34d
Show file tree
Hide file tree
Showing 37 changed files with 413 additions and 413 deletions.
2 changes: 1 addition & 1 deletion doc/source/fft.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Arithmetic modulo a generalised Fermat number
--------------------------------------------------------------------------------


.. function:: void mpn_negmod_2expp1(mp_limb_t* z, const mp_limb_t* a, mp_size_t limbs)
.. function:: void mpn_negmod_2expp1(mp_limb_t * z, const mp_limb_t * a, mp_size_t limbs)

Set ``z`` to the negation of the Fermat number `a` modulo ``B^limbs + 1``.
The input ``a`` is expected to be fully reduced, and the output is fully reduced.
Expand Down
6 changes: 3 additions & 3 deletions doc/source/fft_small.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Preconditioned polynomial arithmetic

Represents ``(b, bn)`` in transformed form for preconditioned multiplication.

.. function:: int _nmod_poly_mul_mid_precomp(ulong* z, ulong zl, ulong zh, const ulong* a, ulong an, mul_precomp_struct* M, nmod_t mod, mpn_ctx_t R)
.. function:: int _nmod_poly_mul_mid_precomp(ulong * z, ulong zl, ulong zh, const ulong * a, ulong an, mul_precomp_struct * M, nmod_t mod, mpn_ctx_t R)

Polynomial multiplication given a precomputed transform ``M``.
Returns 1 if successful, 0 if the precomputed transform is too short.

.. type:: nmod_poly_divrem_precomp_struct

.. function:: void _nmod_poly_divrem_precomp_init(nmod_poly_divrem_precomp_struct * M, const ulong* b, ulong bn, ulong Bn, nmod_t mod, mpn_ctx_t R)
void _nmod_poly_divrem_precomp_clear(nmod_poly_divrem_precomp_struct* M)
.. function:: void _nmod_poly_divrem_precomp_init(nmod_poly_divrem_precomp_struct * M, const ulong * b, ulong bn, ulong Bn, nmod_t mod, mpn_ctx_t R)
void _nmod_poly_divrem_precomp_clear(nmod_poly_divrem_precomp_struct * M)

Represents ``(b, bn)`` and its inverse in transformed form for preconditioned multiplication.

Expand Down
12 changes: 6 additions & 6 deletions doc/source/fmpq_poly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ Greatest common divisor
--------------------------------------------------------------------------------


.. function:: void _fmpq_poly_gcd(fmpz *G, fmpz_t denG, const fmpz *A, slong lenA, const fmpz *B, slong lenB)
.. function:: void _fmpq_poly_gcd(fmpz * G, fmpz_t denG, const fmpz * A, slong lenA, const fmpz * B, slong lenB)

Computes the monic greatest common divisor `G` of `A` and `B`.

Expand All @@ -936,7 +936,7 @@ Greatest common divisor

In the special case when `A = B = 0`, sets `G = 0`.

.. function:: void _fmpq_poly_xgcd(fmpz *G, fmpz_t denG, fmpz *S, fmpz_t denS, fmpz *T, fmpz_t denT, const fmpz *A, const fmpz_t denA, slong lenA, const fmpz *B, const fmpz_t denB, slong lenB)
.. function:: void _fmpq_poly_xgcd(fmpz * G, fmpz_t denG, fmpz * S, fmpz_t denS, fmpz * T, fmpz_t denT, const fmpz * A, const fmpz_t denA, slong lenA, const fmpz * B, const fmpz_t denB, slong lenB)

Computes polynomials `G`, `S`, and `T` such that
`G = \gcd(A, B) = S A + T B`, where `G` is the monic
Expand All @@ -959,7 +959,7 @@ Greatest common divisor
scalar multiple of `G = A`, `S = 1`, and `T = 0`. The case
when `A = 0`, `B \neq 0` is handled similarly.

.. function:: void _fmpq_poly_lcm(fmpz *L, fmpz_t denL, const fmpz *A, slong lenA, const fmpz *B, slong lenB)
.. function:: void _fmpq_poly_lcm(fmpz * L, fmpz_t denL, const fmpz * A, slong lenA, const fmpz * B, slong lenB)

Computes the monic least common multiple `L` of `A` and `B`.

Expand All @@ -976,7 +976,7 @@ Greatest common divisor

In the special case when `A = B = 0`, sets `L = 0`.

.. function:: void _fmpq_poly_resultant(fmpz_t rnum, fmpz_t rden, const fmpz *poly1, const fmpz_t den1, slong len1, const fmpz *poly2, const fmpz_t den2, slong len2)
.. function:: void _fmpq_poly_resultant(fmpz_t rnum, fmpz_t rden, const fmpz * poly1, const fmpz_t den1, slong len1, const fmpz * poly2, const fmpz_t den2, slong len2)

Sets ``(rnum, rden)`` to the resultant of the two input
polynomials.
Expand Down Expand Up @@ -1708,7 +1708,7 @@ Input and output
In case of success, returns a positive value. In case of failure,
returns a non-positive value.

.. function:: int _fmpq_poly_print_pretty(const fmpz *poly, const fmpz_t den, slong len, const char * x)
.. function:: int _fmpq_poly_print_pretty(const fmpz * poly, const fmpz_t den, slong len, const char * x)

.. function:: int fmpq_poly_print_pretty(const fmpq_poly_t poly, const char * var)

Expand All @@ -1732,7 +1732,7 @@ Input and output
In case of success, returns a positive value. In case of failure,
returns a non-positive value.

.. function:: int _fmpq_poly_fprint_pretty(FILE * file, const fmpz *poly, const fmpz_t den, slong len, const char * x)
.. function:: int _fmpq_poly_fprint_pretty(FILE * file, const fmpz * poly, const fmpz_t den, slong len, const char * x)

.. function:: int fmpq_poly_fprint_pretty(FILE * file, const fmpq_poly_t poly, const char * var)

Expand Down
2 changes: 1 addition & 1 deletion doc/source/fmpq_vec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Conversions

Sets ``(res, len)`` to ``(vec, len)``.

.. function:: void _fmpq_vec_get_fmpz_vec_fmpz(fmpz* num, fmpz_t den, const fmpq * a, slong len)
.. function:: void _fmpq_vec_get_fmpz_vec_fmpz(fmpz * num, fmpz_t den, const fmpq * a, slong len)

Find a common denominator ``den`` of the entries of ``a`` and set ``(num, len)`` to the corresponding numerators.

Expand Down
30 changes: 15 additions & 15 deletions doc/source/fmpz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,54 +108,54 @@ Types, macros and constants

.. macro:: COEFF_MAX

the largest (positive) value an ``fmpz`` can be if just an ``slong``.
The largest (positive) value an ``fmpz`` can be if just an ``slong``.

.. macro:: COEFF_MIN

the smallest (negative) value an ``fmpz`` can be if just an ``slong``.
The smallest (negative) value an ``fmpz`` can be if just an ``slong``.

.. function:: fmpz PTR_TO_COEFF(__mpz_struct * ptr)

a macro to convert an ``mpz_t`` (or more generally any ``__mpz_struct *``)
A macro to convert an ``mpz_t`` (or more generally any ``__mpz_struct *``)
to an ``fmpz`` (shifts the pointer right by `2` and sets the second most
significant bit).

.. function:: __mpz_struct * COEFF_TO_PTR(fmpz f)

a macro to convert an ``fmpz`` which represents a pointer into an actual
A macro to convert an ``fmpz`` which represents a pointer into an actual
pointer to an ``__mpz_struct`` (i.e. to an ``mpz_t``).

.. function:: int COEFF_IS_MPZ(fmpz f)

a macro which returns `1` if `f` represents an ``mpz_t``, otherwise `0` is
A macro which returns `1` if `f` represents an ``mpz_t``, otherwise `0` is
returned.

.. function:: __mpz_struct * _fmpz_new_mpz(void)

initialises a new ``mpz_t`` and returns a pointer to it. This is only used
Initialises a new ``mpz_t`` and returns a pointer to it. This is only used
internally.

.. function:: void _fmpz_clear_mpz(fmpz f)

clears the ``mpz_t`` "pointed to" by the ``fmpz`` `f`. This is only used
Clears the ``mpz_t`` "pointed to" by the ``fmpz`` `f`. This is only used
internally.

.. function:: void _fmpz_cleanup_mpz_content()

this function does nothing in the reentrant version of ``fmpz``.
This function does nothing in the reentrant version of ``fmpz``.

.. function:: void _fmpz_cleanup()

this function does nothing in the reentrant version of ``fmpz``.
This function does nothing in the reentrant version of ``fmpz``.

.. function:: __mpz_struct * _fmpz_promote(fmpz_t f)

if `f` doesn't represent an ``mpz_t``, initialise one and associate it to
If `f` doesn't represent an ``mpz_t``, initialise one and associate it to
`f`.

.. function:: __mpz_struct * _fmpz_promote_val(fmpz_t f)

if `f` doesn't represent an ``mpz_t``, initialise one and associate it to
If `f` doesn't represent an ``mpz_t``, initialise one and associate it to
`f`, but preserve the value of `f`.

This function is for internal use. The resulting ``fmpz`` will be backed by
Expand All @@ -165,12 +165,12 @@ Types, macros and constants

.. function:: void _fmpz_demote(fmpz_t f)

if `f` represents an ``mpz_t`` clear it and make `f` just represent an
If `f` represents an ``mpz_t`` clear it and make `f` just represent an
``slong``.

.. function:: void _fmpz_demote_val(fmpz_t f)

if `f` represents an ``mpz_t`` and its value will fit in an ``slong``,
If `f` represents an ``mpz_t`` and its value will fit in an ``slong``,
preserve the value in `f` which we make to represent an ``slong``, and
clear the ``mpz_t``.

Expand Down Expand Up @@ -332,7 +332,7 @@ Conversion

Sets the ``mpz_t`` `x` to the same value as `f`.

.. function:: int fmpz_get_mpn(mp_ptr *n, fmpz_t n_in)
.. function:: int fmpz_get_mpn(mp_ptr * n, fmpz_t n_in)

Sets the ``mp_ptr`` `n` to the same value as `n_{in}`. Returned
integer is number of limbs allocated to `n`, minimum number of limbs
Expand Down Expand Up @@ -579,7 +579,7 @@ Input and output
``flint_printf`` from the standard library and ``mpz_out_str``
from MPIR.

.. function:: size_t fmpz_out_raw(FILE *fout, const fmpz_t x )
.. function:: size_t fmpz_out_raw(FILE * fout, const fmpz_t x )

Writes the value `x` to ``file``.
The value is written in raw binary format. The integer is written in
Expand Down
2 changes: 1 addition & 1 deletion doc/source/fmpz_factor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Factoring of ``fmpz`` integers using ECM
The curve selected is of Montgomery form, the points selected satisfy the
curve and are projective coordinates.

.. function:: int fmpz_factor_ecm_stage_I(mp_ptr f, const mp_limb_t *prime_array, mp_limb_t num, mp_limb_t B1, mp_ptr n, ecm_t ecm_inf)
.. function:: int fmpz_factor_ecm_stage_I(mp_ptr f, const mp_limb_t * prime_array, mp_limb_t num, mp_limb_t B1, mp_ptr n, ecm_t ecm_inf)

Stage I implementation of the ECM algorithm.

Expand Down
10 changes: 5 additions & 5 deletions doc/source/fmpz_lll.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The various Babai's
--------------------------------------------------------------------------------


.. function:: int fmpz_lll_check_babai(int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double *s, d_mat_t appB, int *expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)
.. function:: int fmpz_lll_check_babai(int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double * s, d_mat_t appB, int * expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)

Performs floating point size reductions of the ``kappa``-th row of
``B`` by all of the previous rows, uses d_mats ``mu`` and ``r``
Expand All @@ -89,27 +89,27 @@ The various Babai's
(usually due to insufficient precision) or 0 if everything was successful.
These descriptions will be true for the future Babai procedures as well.

.. function:: int fmpz_lll_check_babai_heuristic_d(int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double *s, d_mat_t appB, int *expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)
.. function:: int fmpz_lll_check_babai_heuristic_d(int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double * s, d_mat_t appB, int * expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)

Same as :func:`fmpz_lll_check_babai` but using the heuristic inner product
rather than a purely floating point inner product. The heuristic will
compute at full precision when there is cancellation.

.. function:: int fmpz_lll_check_babai_heuristic(int kappa, fmpz_mat_t B, fmpz_mat_t U, mpf_mat_t mu, mpf_mat_t r, mpf *s, mpf_mat_t appB, fmpz_gram_t A, int a, int zeros, int kappamax, int n, mpf_t tmp, mpf_t rtmp, flint_bitcnt_t prec, const fmpz_lll_t fl)
.. function:: int fmpz_lll_check_babai_heuristic(int kappa, fmpz_mat_t B, fmpz_mat_t U, mpf_mat_t mu, mpf_mat_t r, mpf * s, mpf_mat_t appB, fmpz_gram_t A, int a, int zeros, int kappamax, int n, mpf_t tmp, mpf_t rtmp, flint_bitcnt_t prec, const fmpz_lll_t fl)

This function is like the ``mpf`` version of
:func:`fmpz_lll_check_babai_heuristic_d`. However, it also inherits some
temporary ``mpf_t`` variables ``tmp`` and ``rtmp``.

.. function:: int fmpz_lll_advance_check_babai(int cur_kappa, int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double *s, d_mat_t appB, int *expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)
.. function:: int fmpz_lll_advance_check_babai(int cur_kappa, int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double * s, d_mat_t appB, int * expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)

This is a Babai procedure which is used when size reducing a vector beyond
an index which LLL has reached. ``cur_kappa`` is the index behind which
we can assume ``B`` is LLL reduced, while ``kappa`` is the vector to
be reduced. This procedure only size reduces the ``kappa``-th row by
vectors up to ``cur_kappa``, **not** ``kappa - 1``.

.. function:: int fmpz_lll_advance_check_babai_heuristic_d(int cur_kappa, int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double *s, d_mat_t appB, int *expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)
.. function:: int fmpz_lll_advance_check_babai_heuristic_d(int cur_kappa, int kappa, fmpz_mat_t B, fmpz_mat_t U, d_mat_t mu, d_mat_t r, double * s, d_mat_t appB, int * expo, fmpz_gram_t A, int a, int zeros, int kappamax, int n, const fmpz_lll_t fl)

Same as :func:`fmpz_lll_advance_check_babai` but using the heuristic inner
product rather than a purely floating point inner product. The heuristic
Expand Down
2 changes: 1 addition & 1 deletion doc/source/fmpz_mat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ Input and output
Prints the given matrix to ``stdout``. For further details,
see :func:`fmpz_mat_fprint_pretty`.

.. function:: int fmpz_mat_fread(FILE* file, fmpz_mat_t mat)
.. function:: int fmpz_mat_fread(FILE * file, fmpz_mat_t mat)

Reads a matrix from the stream ``file``, storing the result
in ``mat``. The expected format is the number of rows, a
Expand Down
Loading

0 comments on commit 80dd34d

Please sign in to comment.