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

Autogenerate flint headers #36449

Merged
merged 42 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
19dc06c
automatic generation of flint headers
videlec Oct 12, 2023
8920d71
two fixes
videlec Oct 12, 2023
06c9b51
do not include fft_small.h
videlec Oct 12, 2023
cc4b950
do not include machine_vectors.h
videlec Oct 12, 2023
40357ac
more autogenerated headers
videlec Oct 12, 2023
da08a06
modify arb headers
videlec Oct 13, 2023
e0286d2
more flint declarations
videlec Oct 13, 2023
fe75d4e
fix arb headers
videlec Oct 13, 2023
c2b7033
more autogenerated flint headers
videlec Oct 14, 2023
338512d
adaptation of sage source code
videlec Oct 14, 2023
8669c93
make linter happier
videlec Oct 14, 2023
289fa17
number_of_partitions moved
videlec Oct 14, 2023
d9e0c23
fix doctests in libs/flint/
videlec Oct 14, 2023
b4e9013
int -> bint
videlec Oct 14, 2023
1c11fd4
fix change in imports
videlec Oct 14, 2023
9993f90
Flint documentation
videlec Oct 15, 2023
68af75d
deprecations
videlec Oct 15, 2023
167e5ae
fix declarations and test inclusion of all headers in flint_sage.pyx
videlec Oct 16, 2023
d6c851e
some fixes in flint headers
videlec Oct 22, 2023
b2d39e3
remove extra parenthesis to make cython less confused
videlec Oct 22, 2023
71abce9
noexcept
videlec Dec 11, 2023
a839070
clean fmpq_poly_sage[.pxd,.pyx]
videlec Dec 11, 2023
59fe9b2
safer flint_wrap.h
videlec Dec 11, 2023
6108828
fix import of n_factor_to_list in integer.pyx
videlec Dec 11, 2023
00747de
fix import of qsieve in integer.pyx
videlec Dec 11, 2023
91c7c2d
include autogeneration files
videlec Dec 12, 2023
c98b611
more types
videlec Dec 12, 2023
85e0994
sort pxd_list
videlec Dec 12, 2023
8e4789b
clean macros
videlec Dec 12, 2023
50c792f
remove COEFF_IS_MPZ from types.pxd
videlec Dec 12, 2023
932f1b1
do generate flint.pxd
videlec Dec 12, 2023
8488162
some more notes in README
videlec Dec 12, 2023
e7f8e9f
fix fmpz_factor_sage import
videlec Dec 12, 2023
54ebb17
remove specialized acb_poly_revert_series that disappeared from flint
videlec Dec 12, 2023
01403cc
regenerate flint cython headers
videlec Dec 12, 2023
0c5863a
linting
videlec Dec 12, 2023
ad3eee8
fix README
videlec Dec 12, 2023
45572d2
make sage.libs.flint.*.py a cython modules again
videlec Dec 18, 2023
b876378
fix import in combinat.py
videlec Dec 20, 2023
4a4e0ed
fix sage_flint feature
videlec Dec 22, 2023
4ae06ef
fix import of dedekind_sum
videlec Dec 22, 2023
9ab34ea
include mpfr in flint_wrap
videlec Dec 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/doc/en/reference/libs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ FLINT
.. toctree::
:maxdepth: 1

sage/libs/flint/flint
sage/libs/flint/fmpz_poly
sage/libs/flint/arith
sage/libs/flint/qsieve
sage/libs/flint/fmpz_poly_sage
sage/libs/flint/fmpq_poly_sage
sage/libs/flint/arith_sage
sage/libs/flint/qsieve_sage
sage/libs/flint/ulong_extras_sage

Giac
----
Expand Down
1 change: 1 addition & 0 deletions src/sage/algebras/quatalg/quaternion_algebra_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ from sage.libs.gmp.mpq cimport *
from sage.libs.ntl.convert cimport mpz_to_ZZ, ZZ_to_mpz
from sage.libs.flint.fmpz cimport *
from sage.libs.flint.fmpz_poly cimport *
from sage.libs.flint.fmpz_poly_sage cimport *
from sage.libs.flint.ntl_interface cimport *

# variables for holding temporary values computed in
Expand Down
4 changes: 2 additions & 2 deletions src/sage/arith/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def bernoulli(n, algorithm='default', num_threads=1):
if n >= 100000:
from warnings import warn
warn("flint is known to not be accurate for large Bernoulli numbers")
from sage.libs.flint.arith import bernoulli_number as flint_bernoulli
from sage.libs.flint.arith_sage import bernoulli_number as flint_bernoulli
return flint_bernoulli(n)
elif algorithm == 'pari' or algorithm == 'gp':
from sage.libs.pari.all import pari
Expand Down Expand Up @@ -6230,7 +6230,7 @@ def dedekind_sum(p, q, algorithm='default'):
- :wikipedia:`Dedekind\_sum`
"""
if algorithm == 'default' or algorithm == 'flint':
from sage.libs.flint.arith import dedekind_sum as flint_dedekind_sum
from sage.libs.flint.arith_sage import dedekind_sum as flint_dedekind_sum
return flint_dedekind_sum(p, q)

if algorithm == 'pari':
Expand Down
16 changes: 8 additions & 8 deletions src/sage/combinat/combinat.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ def bell_number(n, algorithm='flint', **options) -> Integer:
return ZZ(int(ret_mp))

elif algorithm == 'flint':
import sage.libs.flint.arith
return sage.libs.flint.arith.bell_number(n)
import sage.libs.flint.arith_sage
return sage.libs.flint.arith_sage.bell_number(n)

elif algorithm == 'gap':
from sage.libs.gap.libgap import libgap
Expand Down Expand Up @@ -576,8 +576,8 @@ def euler_number(n, algorithm='flint') -> Integer:
if algorithm == 'maxima':
return ZZ(maxima.euler(n)) # type:ignore
elif algorithm == 'flint':
import sage.libs.flint.arith
return sage.libs.flint.arith.euler_number(n)
import sage.libs.flint.arith_sage
return sage.libs.flint.arith_sage.euler_number(n)
else:
raise ValueError("algorithm must be 'flint' or 'maxima'")

Expand Down Expand Up @@ -906,8 +906,8 @@ def stirling_number1(n, k, algorithm="gap") -> Integer:
from sage.libs.gap.libgap import libgap
return libgap.Stirling1(n, k).sage()
if algorithm == 'flint':
import sage.libs.flint.arith
return sage.libs.flint.arith.stirling_number_1(n, k)
import sage.libs.flint.arith_sage
return sage.libs.flint.arith_sage.stirling_number_1(n, k)
raise ValueError("unknown algorithm: %s" % algorithm)


Expand Down Expand Up @@ -1034,8 +1034,8 @@ def stirling_number2(n, k, algorithm=None) -> Integer:
from sage.libs.gap.libgap import libgap
return libgap.Stirling2(n, k).sage()
if algorithm == 'flint':
import sage.libs.flint.arith
return sage.libs.flint.arith.stirling_number_2(n, k)
import sage.libs.flint.arith_sage
return sage.libs.flint.arith_sage.stirling_number_2(n, k)
if algorithm == 'maxima':
return ZZ(maxima.stirling2(n, k)) # type:ignore
raise ValueError("unknown algorithm: %s" % algorithm)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@

from sage.arith.misc import binomial, factorial, gcd, multinomial
from sage.libs.pari.all import pari
from sage.libs.flint.arith import number_of_partitions as flint_number_of_partitions
from sage.libs.flint.arith_sage import number_of_partitions as flint_number_of_partitions
from sage.structure.global_options import GlobalOptions
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
Expand Down
4 changes: 2 additions & 2 deletions src/sage/features/sagemath.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ def __init__(self):
True
"""
JoinFeature.__init__(self, 'sage.libs.flint',
[PythonModule('sage.libs.flint.flint'),
PythonModule('sage.libs.arb.arith')],
[PythonModule('sage.libs.flint.arith_sage'),
PythonModule('sage.libs.flint.flint_sage')],
spkg='sagemath_flint', type='standard')


Expand Down
2 changes: 1 addition & 1 deletion src/sage/functions/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
lazy_import('sage.symbolic.constants', 'pi', as_='const_pi')
lazy_import('sage.rings.complex_double', 'CDF')

lazy_import('sage.libs.flint.arith', 'harmonic_number', as_='_flint_harmonic_number')
lazy_import('sage.libs.flint.arith_sage', 'harmonic_number', as_='_flint_harmonic_number')

lazy_import('sage.libs.mpmath.utils', 'call', as_='_mpmath_utils_call')
lazy_import('mpmath', 'harmonic', as_='_mpmath_harmonic')
Expand Down
2 changes: 2 additions & 0 deletions src/sage/graphs/matchpoly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ from sage.rings.integer cimport Integer

from sage.libs.flint.fmpz cimport *
from sage.libs.flint.fmpz_poly cimport *
from sage.libs.flint.fmpz_poly_sage cimport *


x = polygen(ZZ, 'x')

Expand Down
4 changes: 2 additions & 2 deletions src/sage/interfaces/qsieve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sage.misc.superseded import deprecated_function_alias
import sage.libs.flint.qsieve
import sage.libs.flint.qsieve_sage

qsieve = deprecated_function_alias(1, sage.libs.flint.qsieve.qsieve)
qsieve = deprecated_function_alias(1, sage.libs.flint.qsieve_sage.qsieve)
2 changes: 1 addition & 1 deletion src/sage/libs/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
lazy_import('sage.libs.eclib.mwrank', 'set_precision', 'mwrank_set_precision')
lazy_import('sage.libs.eclib.mwrank', 'initprimes', 'mwrank_initprimes')

lazy_import('sage.libs.flint.qsieve', 'qsieve')
lazy_import('sage.libs.flint.qsieve_sage', 'qsieve')

lazy_import('sage.libs.giac.giac', 'libgiac')
Loading
Loading