Skip to content

Commit

Permalink
Reformat headers
Browse files Browse the repository at this point in the history
With these headers:
thread_pool.h thread_support.h ulong_extras.h long_extras.h perm.h
double_extras.h d_vec.h d_mat.h mpn_extras.h mpf_vec.h mpf_mat.h
mpfr_vec.h mpfr_mat.h nmod.h nmod_vec.h nmod_mat.h nmod_poly.h fmpz.h
fmpz_vec.h fmpz_mat.h fmpz_poly.h fmpz_mod.h fmpz_mod_vec.h
fmpz_mod_mat.h fmpz_mod_poly.h fmpq.h fmpq_vec.h fmpq_mat.h fmpq_poly.h
fq.h fq_vec.h fq_mat.h fq_poly.h fq_nmod.h fq_nmod_vec.h fq_nmod_mat.h
fq_nmod_poly.h fq_zech.h fq_zech_mat.h fq_zech_poly.h fq_default.h
fq_default_mat.h fq_default_poly.h fq_embed.h fq_nmod_embed.h
fq_zech_embed.h padic.h padic_mat.h padic_poly.h qadic.h
nmod_poly_factor.h fmpz_factor.h fmpz_poly_factor.h
fmpz_mod_poly_factor.h fq_poly_factor.h fq_nmod_poly_factor.h
fq_zech_poly_factor.h fq_default_poly_factor.h nmod_poly_mat.h
fmpz_poly_mat.h mpoly.h nmod_mpoly.h fmpz_mpoly.h fmpz_mod_mpoly.h
fmpq_mpoly.h fq_nmod_mpoly.h fq_zech_mpoly.h nmod_mpoly_factor.h
fmpz_mpoly_factor.h fmpz_mod_mpoly_factor.h fmpq_mpoly_factor.h
fq_nmod_mpoly_factor.h fq_zech_mpoly_factor.h fft.h fft_small.h
fmpz_poly_q.h fmpz_lll.h n_poly.h arith.h qsieve.h aprcl.h nf.h
nf_elem.h qfb.h
  • Loading branch information
albinahlback committed Nov 14, 2023
1 parent 14a1034 commit 863039c
Show file tree
Hide file tree
Showing 70 changed files with 19,222 additions and 3,962 deletions.
22 changes: 19 additions & 3 deletions src/aprcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,17 @@ primality_test_status _aprcl_is_prime_jacobi(const fmpz_t n, const aprcl_config

slong _aprcl_is_prime_jacobi_check_pk(const unity_zp j, const fmpz_t u, ulong v);
slong _aprcl_is_prime_jacobi_check_21(ulong q, const fmpz_t n);
slong _aprcl_is_prime_jacobi_check_22(const unity_zp j, const fmpz_t u, ulong v, ulong q);
slong _aprcl_is_prime_jacobi_check_2k(const unity_zp j, const unity_zp j2_1, const unity_zp j2_2, const fmpz_t u, ulong v);
slong _aprcl_is_prime_jacobi_check_22(
const unity_zp j,
const fmpz_t u,
ulong v,
ulong q);
slong _aprcl_is_prime_jacobi_check_2k(
const unity_zp j,
const unity_zp j2_1,
const unity_zp j2_2,
const fmpz_t u,
ulong v);

int _aprcl_is_prime_jacobi_additional_test(const fmpz_t n, ulong p);

Expand Down Expand Up @@ -204,7 +213,14 @@ mp_ptr aprcl_f_table(const ulong q);

void unity_zp_jacobi_sum_2q_one(unity_zp f, ulong q);
void unity_zp_jacobi_sum_2q_two(unity_zp f, ulong q);
void _unity_zp_jacobi_sum_pq_general(unity_zp f, const mp_ptr table, ulong p, ulong q, ulong k, ulong a, ulong b);
void _unity_zp_jacobi_sum_pq_general(
unity_zp f,
const mp_ptr table,
ulong p,
ulong q,
ulong k,
ulong a,
ulong b);
void unity_zp_jacobi_sum_pq(unity_zp f, ulong q, ulong p);


Expand Down
18 changes: 15 additions & 3 deletions src/arith.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,21 @@ void arith_stirling_number_1u_vec(fmpz * row, ulong n, slong klen);
void arith_stirling_number_1_vec(fmpz * row, ulong n, slong klen);
void arith_stirling_number_2_vec(fmpz * row, ulong n, slong klen);

void arith_stirling_number_1u_vec_next(fmpz * row, const fmpz * prev, slong n, slong klen);
void arith_stirling_number_1_vec_next(fmpz * row, const fmpz * prev, slong n, slong klen);
void arith_stirling_number_2_vec_next(fmpz * row, const fmpz * prev, slong n, slong klen);
void arith_stirling_number_1u_vec_next(
fmpz * row,
const fmpz * prev,
slong n,
slong klen);
void arith_stirling_number_1_vec_next(
fmpz * row,
const fmpz * prev,
slong n,
slong klen);
void arith_stirling_number_2_vec_next(
fmpz * row,
const fmpz * prev,
slong n,
slong klen);

void arith_stirling_matrix_1u(fmpz_mat_t mat);
void arith_stirling_matrix_1(fmpz_mat_t mat);
Expand Down
24 changes: 20 additions & 4 deletions src/d_mat.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ typedef d_mat_struct d_mat_t[1];

#define d_mat_entry(mat,i,j) (*((mat)->rows[i] + (j)))

D_MAT_INLINE double * d_mat_entry_ptr(const d_mat_t mat, slong i, slong j) { return mat->rows[i] + j; }
D_MAT_INLINE double d_mat_get_entry(const d_mat_t mat, slong i, slong j) { return mat->rows[i][j]; }
D_MAT_INLINE
double * d_mat_entry_ptr(const d_mat_t mat, slong i, slong j)
{
return mat->rows[i] + j;
}
D_MAT_INLINE
double d_mat_get_entry(const d_mat_t mat, slong i, slong j)
{
return mat->rows[i][j];
}

D_MAT_INLINE slong d_mat_nrows(const d_mat_t mat) { return mat->r; }
D_MAT_INLINE slong d_mat_ncols(const d_mat_t mat) { return mat->c; }
Expand All @@ -60,7 +68,11 @@ int d_mat_approx_equal(const d_mat_t mat1, const d_mat_t mat2, double eps);
int d_mat_is_zero(const d_mat_t mat);
int d_mat_is_approx_zero(const d_mat_t mat, double eps);

D_MAT_INLINE int d_mat_is_empty(const d_mat_t mat) { return (mat->r == 0) || (mat->c == 0); }
D_MAT_INLINE
int d_mat_is_empty(const d_mat_t mat)
{
return (mat->r == 0) || (mat->c == 0);
}
D_MAT_INLINE int d_mat_is_square(const d_mat_t mat) { return (mat->r == mat->c); }

void d_mat_zero(d_mat_t mat);
Expand All @@ -84,7 +96,11 @@ void d_mat_mul_classical(d_mat_t C, const d_mat_t A, const d_mat_t B);

/* Permutations *************************************************************/

D_MAT_INLINE void d_mat_swap_rows(d_mat_t mat, slong r, slong s) { if (r != s) FLINT_SWAP(double *, mat->rows[r], mat->rows[s]); }
D_MAT_INLINE
void d_mat_swap_rows(d_mat_t mat, slong r, slong s)
{
if (r != s) FLINT_SWAP(double *, mat->rows[r], mat->rows[s]);
}

/* Gram-Schmidt Orthogonalisation and QR Decomposition **********************/

Expand Down
19 changes: 16 additions & 3 deletions src/d_vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ void _d_vec_clear(double * vec);

/* Randomisation ***********************************************************/

void _d_vec_randtest(double * f, flint_rand_t state, slong len, slong minexp, slong maxexp);
void _d_vec_randtest(
double * f,
flint_rand_t state,
slong len,
slong minexp,
slong maxexp);

/* Assignment and basic manipulation ***************************************/

Expand All @@ -56,8 +61,16 @@ void _d_vec_sub(double * res, const double * vec1, const double * vec2, slong le

double _d_vec_norm(const double * vec, slong len);

double _d_vec_dot_heuristic(const double * vec1, const double * vec2, slong len2, double * err);
double _d_vec_dot_thrice(const double * vec1, const double * vec2, slong len2, double * err);
double _d_vec_dot_heuristic(
const double * vec1,
const double * vec2,
slong len2,
double * err);
double _d_vec_dot_thrice(
const double * vec1,
const double * vec2,
slong len2,
double * err);
double _d_vec_dot(const double * vec1, const double * vec2, slong len2);

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 863039c

Please sign in to comment.