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

Adding Fmpz mpoly #59, cont. #132

Merged
merged 106 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
357e435
Make it work with flint 3.0
deinst Aug 11, 2023
e973105
Change from distutils to setuptools
deinst Aug 11, 2023
74c5f85
Change include paths for flint 3.0
deinst Aug 16, 2023
c24b2ff
Starting attack at fmpz_mpoly
deinst Aug 17, 2023
0489152
Made the tests pass.
deinst Aug 17, 2023
518c0a7
Merge remote-tracking branch 'upstream/master' into fmpz_mpoly
deinst Aug 17, 2023
89d567c
Back out changes for flint3 and setuptools
deinst Aug 17, 2023
7176fe7
add prototype for fmpz_mpoly_sort_terms.
deinst Aug 18, 2023
3dbc6ae
Moved generic pieces of fmpz_mpoly_context to base class.
deinst Aug 18, 2023
dc7be11
doctests for fmpz_mpoly_context object
deinst Aug 19, 2023
b5d0e91
Merge branch 'master' into fmpz_mpoly
deinst Aug 21, 2023
843b9f3
Added ability to construct an fmpz_mpoly from a dictionary.
deinst Aug 23, 2023
f346904
Added create_fmpz_mpoly to remove blocks of redundant code.
deinst Aug 25, 2023
3407bce
Initial steps towards fmpz_mpoly.
deinst Aug 28, 2023
96178ce
Merge branch 'master' into fmpz_mpoly
deinst Sep 9, 2023
0f2fceb
Small advances in fmpz_mpoly.
deinst Sep 12, 2023
fe614c5
Merge branch 'master' into fmpz_mpoly
deinst Sep 14, 2023
fbe31b7
Added fmpz_mpoly_factor and fmpq_mpoly.
deinst Sep 22, 2023
7f9c193
Added fmpq_mpoly to setup.py
deinst Sep 22, 2023
70b23be
Merge branch 'master' into fmpz_mpoly
deinst Sep 22, 2023
692c3e7
Merge branch 'master' into fmpz_mpoly
deinst Sep 23, 2023
ab7e114
Added factoring to fmpq_mpoly
deinst Sep 24, 2023
2ebf15d
Framing of fmpz_mpoly_q laid out.
deinst Sep 24, 2023
ca4391d
Fixed small bugs in fmpz_mpoly and fmpq_mpoly
deinst Sep 24, 2023
b156482
Merge branch 'master' into fmpz_mpoly
deinst Sep 28, 2023
1313637
Added printing of fmpz_mpoly_q
deinst Sep 30, 2023
5249c19
Merge branch 'master' into fmpz_mpoly
deinst Sep 30, 2023
80b1325
Added operations on fmpz_mpoly that return fmpq_mpoly of fmpz_mpoly_q
deinst Oct 9, 2023
e3c81d8
Added tests, checks for division by zero to fmpz_mpoly
deinst Oct 10, 2023
8834263
Merge branch 'master' into fmpz_mpoly
Jake-Moss Apr 5, 2024
f2a8bbb
Small refactor and general tidy of fmpz_mpoly and fmpq_mpoly
Jake-Moss Apr 10, 2024
9e14bcb
Reimplement fmpz_mpoly.__call__, add joint_context method
Jake-Moss Apr 14, 2024
d5e2b56
Make joint context creation and coercion explicit
Jake-Moss Apr 15, 2024
941041c
Implemented fmpz_mpoly partial function composition
Jake-Moss Apr 15, 2024
2ba6a29
Disallow positional partial application
Jake-Moss Apr 15, 2024
109fad8
Revamp fmpz_mpoly tests, add a handful of functions
Jake-Moss Apr 21, 2024
ce5c9e7
Use create_fmpz_mpoly in favour of __new__ init pattern
Jake-Moss Apr 22, 2024
8752894
Add super class for Flint exceptions
Jake-Moss Apr 22, 2024
1839619
Add exception to ordering if ladder
Jake-Moss Apr 22, 2024
ca3dd70
Avoid from ... import *
Jake-Moss Apr 22, 2024
ea19511
Allow 0 variables and replace asserts
Jake-Moss Apr 22, 2024
62f1446
Support 0 var fmpz_mpolys
Jake-Moss Apr 22, 2024
df9b929
Fix uninitialised variable warnings
Jake-Moss Apr 22, 2024
40b383d
Remove unused imports and coercions to fmpq_mpoly
Jake-Moss Apr 22, 2024
35c23a4
Enabling the troublesome tests
Jake-Moss Apr 22, 2024
3d51daa
Fix variable being prematurely garbage collected
Jake-Moss Apr 24, 2024
e19044e
Check malloc return value
Jake-Moss Apr 25, 2024
fa07adf
Instrument windows CI: will be reverted
Jake-Moss Apr 25, 2024
63f22fa
Revert "Instrument windows CI: will be reverted"
Jake-Moss Apr 25, 2024
13f5186
Merge branch 'master' into fmpz_mpoly
Jake-Moss Apr 25, 2024
8a09691
Add fmpq_mpoly and fmpz_mpoly_q to meson.build
Jake-Moss Apr 25, 2024
6c0e0cc
Add fmpz_vec and use it
Jake-Moss May 3, 2024
0878b38
Mark char* obtained from python objects as const
Jake-Moss May 3, 2024
98a0cb7
Update flintlib/fmpz_mpoly.pxd
Jake-Moss May 4, 2024
4b08299
Add fmpz_mpoly_vec and use it were appropriate
Jake-Moss May 4, 2024
82885a4
Add build-install to .gitignore
Jake-Moss May 4, 2024
f083101
Add coverage option to meson `spin build --clean -- -Dcoverage=true`
Jake-Moss May 5, 2024
8239992
Add doc strings, rewrite from_dict method to use the fmpz_vec
Jake-Moss May 5, 2024
f35903e
Forgot about the interface I wrote, whoops
Jake-Moss May 5, 2024
a61b4e4
Fix doctests
Jake-Moss May 6, 2024
a108522
Keep the setup.py up to date
Jake-Moss May 6, 2024
59a34ad
100% fmpz_mpoly test coverage.
Jake-Moss May 6, 2024
a7eb6f6
Rearrange methods
Jake-Moss May 6, 2024
aac76b4
Update fmpq_mpoly, bring to parity with fmpz_mpoly, 100% coverage
Jake-Moss May 6, 2024
a31d49c
Forgot these files
Jake-Moss May 6, 2024
b408ae5
Merge branch 'master' into fmpz_mpoly
Jake-Moss Jun 20, 2024
29c8015
Remove _init from flint_mpoly_context
Jake-Moss Jun 20, 2024
a961889
Refactor variable name creation and context retrieval
Jake-Moss Jun 20, 2024
d7e23fc
Remove joint_context
Jake-Moss Jun 20, 2024
d1632d2
Remove pickle decorators
Jake-Moss Jun 20, 2024
a485ca3
Remove star imports
Jake-Moss Jun 20, 2024
17b3406
Add Ordering enum class and remove cpdefs
Jake-Moss Jun 20, 2024
4cf40f9
Remove two places where contexts were created on the fly
Jake-Moss Jun 20, 2024
4e22e14
Prefer fmp[zq]_mpoly_divides to divmod
Jake-Moss Jun 20, 2024
6af7433
Typo in doc string
Jake-Moss Jun 20, 2024
aef740c
Remove fmpz_mpoly_q
Jake-Moss Jun 20, 2024
3ebd8ff
Prevent flint clear of null pointer
Jake-Moss Jun 20, 2024
6e12555
Fix poor error reporting
Jake-Moss Jun 20, 2024
317189a
Add variable_to_index method
Jake-Moss Jun 20, 2024
250861f
Use setdefault over normal dict insertion
Jake-Moss Jun 21, 2024
bc61ca9
Use ascii over utf-8 decoding for c strings
Jake-Moss Jun 21, 2024
e175854
Typos
Jake-Moss Jun 21, 2024
7ec3112
Remove unused var
Jake-Moss Jun 21, 2024
96fa8e6
Prefer .index over dict, raise nicer exception
Jake-Moss Jun 21, 2024
59bce43
fixup! Remove fmpz_mpoly_q
Jake-Moss Jun 21, 2024
492f962
Typo
Jake-Moss Jun 24, 2024
fcd9294
Remove hash
Jake-Moss Jun 24, 2024
efb2c27
Clarify integral doc string
Jake-Moss Jun 24, 2024
4bef177
Split __call__ methods
Jake-Moss Jun 24, 2024
ada4b2f
Raise exception on parsing failure
Jake-Moss Jun 24, 2024
e093ac1
Remove unnecessary secondary results
Jake-Moss Jul 1, 2024
faa1fb2
Drop sequence-like indexing
Jake-Moss Jul 1, 2024
fbc6854
Make fmpq_mpoly and fmpz_mpoly more dict-like
Jake-Moss Jul 1, 2024
10c19be
Add alias for keys/value to monoms/coeffs, add terms function
Jake-Moss Jul 2, 2024
d70c2f9
Remove keys/values/exponent_tuple functions, rename items -> terms
Jake-Moss Jul 4, 2024
8f76c6a
Remove in-place add, sub, and mul
Jake-Moss Jul 4, 2024
dc7c787
Add missing subs and compose docs, fix old error message and comment
Jake-Moss Jul 4, 2024
e042933
Change .degrees to return a tuple over a dict
Jake-Moss Jul 4, 2024
128ae01
Remove unused imports, use lower case to start exception message
Jake-Moss Jul 4, 2024
1317bb0
Fix composition with no-generator polynomial
Jake-Moss Jul 8, 2024
424dc4f
fixup! Add alias for keys/value to monoms/coeffs, add terms function
Jake-Moss Jul 8, 2024
1c88ec3
Revert "Remove in-place add, sub, and mul"
Jake-Moss Jul 8, 2024
fb10785
Make in-place operators functions, and explict
Jake-Moss Jul 8, 2024
c8782c5
Simplify subs method, allow generator index
Jake-Moss Jul 8, 2024
c0c0517
fixup! Remove unused imports, use lower case to start exception message
Jake-Moss Jul 8, 2024
d4e6589
fixup! fixup! Remove unused imports, use lower case to start exceptio…
Jake-Moss Jul 8, 2024
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
11 changes: 11 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ gmp_dep = dependency('gmp')
mpfr_dep = dependency('mpfr')
flint_dep = dependency('flint')

add_project_arguments(
'-X', 'embedsignature=True',
'-X', 'emit_code_comments=True',
language : 'cython'
)

if get_option('coverage')
add_project_arguments('-X', 'linetrace=True', language : 'cython')
add_project_arguments('-DCYTHON_TRACE=1', language : 'c')
endif

# Add rpaths for a local build of flint found via pkgconfig
# https://github.com/mesonbuild/meson/issues/13046
if get_option('add_flint_rpath')
Expand Down
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
option('coverage', type : 'boolean', value : false, description : 'enable coverage build')
option('add_flint_rpath', type : 'boolean', value : false)
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@
("flint.flint_base.flint_context", ["src/flint/flint_base/flint_context.pyx"]),

("flint.types.fmpz", ["src/flint/types/fmpz.pyx"]),
("flint.types.fmpz_vec", ["src/flint/types/fmpz_vec.pyx"]),
("flint.types.fmpz_poly", ["src/flint/types/fmpz_poly.pyx"]),
("flint.types.fmpz_mpoly", ["src/flint/types/fmpz_mpoly.pyx"]),
("flint.types.fmpz_mat", ["src/flint/types/fmpz_mat.pyx"]),
("flint.types.fmpz_series", ["src/flint/types/fmpz_series.pyx"]),

("flint.types.fmpq", ["src/flint/types/fmpq.pyx"]),
("flint.types.fmpq_vec", ["src/flint/types/fmpq_vec.pyx"]),
("flint.types.fmpq_poly", ["src/flint/types/fmpq_poly.pyx"]),
("flint.types.fmpq_mat", ["src/flint/types/fmpq_mat.pyx"]),
("flint.types.fmpq_series", ["src/flint/types/fmpq_series.pyx"]),
Expand All @@ -100,6 +102,9 @@
("flint.types.fmpz_mod_poly", ["src/flint/types/fmpz_mod_poly.pyx"]),
("flint.types.fmpz_mod_mat", ["src/flint/types/fmpz_mod_mat.pyx"]),

("flint.types.fmpq_mpoly", ["src/flint/types/fmpq_mpoly.pyx"]),
("flint.types.fmpz_mpoly_q", ["src/flint/types/fmpz_mpoly_q.pyx"]),

("flint.types.arf", ["src/flint/types/arf.pyx"]),
("flint.types.arb", ["src/flint/types/arb.pyx"]),
("flint.types.arb_poly", ["src/flint/types/arb_poly.pyx"]),
Expand Down
7 changes: 6 additions & 1 deletion src/flint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@
from .types.fmpz_poly import *
from .types.fmpz_mat import *
from .types.fmpz_series import *
from .types.fmpz_vec import fmpz_vec

from .types.fmpq import *
from .types.fmpq_poly import *
from .types.fmpq_mat import *
from .types.fmpq_series import *
from .types.fmpq_vec import fmpq_vec

from .types.nmod import *
from .types.nmod_poly import *
from .types.nmod_mat import *
from .types.nmod_series import *

from .types.fmpz_mpoly import *
from .types.fmpz_mpoly import fmpz_mpoly_ctx, fmpz_mpoly, fmpz_mpoly_vec
from .types.fmpz_mod import *
from .types.fmpz_mod_poly import *
from .types.fmpz_mod_mat import fmpz_mod_mat

from .types.fmpq_mpoly import fmpq_mpoly_ctx, fmpq_mpoly, fmpq_mpoly_vec

from .types.arf import *
from .types.arb import *
from .types.arb_poly import *
Expand All @@ -36,6 +40,7 @@
from .flint_base.flint_base import (
FLINT_VERSION as __FLINT_VERSION__,
FLINT_RELEASE as __FLINT_RELEASE__,
Ordering,
)

__version__ = '0.6.0'
12 changes: 12 additions & 0 deletions src/flint/flint_base/flint_base.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from flint.flintlib.mpoly cimport ordering_t

cdef class flint_elem:
pass

Expand All @@ -7,6 +9,10 @@ cdef class flint_scalar(flint_elem):
cdef class flint_poly(flint_elem):
pass

cdef class flint_mpoly_context(flint_elem):
cdef public object py_names
cdef const char ** c_names

cdef class flint_mpoly(flint_elem):
pass

Expand All @@ -15,3 +21,9 @@ cdef class flint_mat(flint_elem):

cdef class flint_series(flint_elem):
pass

cpdef enum Ordering:
lex, deglex, degrevlex

cdef ordering_t ordering_py_to_c(ordering: Ordering)
cdef ordering_c_to_py(ordering_t ordering)
185 changes: 184 additions & 1 deletion src/flint/flint_base/flint_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ from flint.flintlib.flint cimport (
FLINT_BITS as _FLINT_BITS,
FLINT_VERSION as _FLINT_VERSION,
__FLINT_RELEASE as _FLINT_RELEASE,
slong
)
from flint.flintlib.mpoly cimport ordering_t
from flint.flint_base.flint_context cimport thectx
from flint.flint_base.flint_base cimport Ordering
from flint.utils.typecheck cimport typecheck
cimport libc.stdlib

from typing import Optional


FLINT_BITS = _FLINT_BITS
Expand Down Expand Up @@ -114,16 +121,169 @@ cdef class flint_poly(flint_elem):
v = - fac[0]
roots.append((v, m))
return roots

def complex_roots(self):
raise AttributeError("Complex roots are not supported for this polynomial")


cdef class flint_mpoly_context(flint_elem):
"""
Base class for multivariate ring contexts
"""

_ctx_cache = None

def __init__(self, int nvars, names):
if nvars < 0:
raise ValueError("Cannot have a negative amount of variables")
elif len(names) != nvars:
raise ValueError("Number of variables must match number of variable names")
self.py_names = tuple(name.encode("ascii") if not isinstance(name, bytes) else name for name in names)
Jake-Moss marked this conversation as resolved.
Show resolved Hide resolved
self.c_names = <const char**> libc.stdlib.malloc(nvars * sizeof(const char *))
for i in range(nvars):
self.c_names[i] = self.py_names[i]

def __dealloc__(self):
libc.stdlib.free(self.c_names)
self.c_names = NULL

def __str__(self):
return self.__repr__()

def __repr__(self):
return f"{self.__class__.__name__}({self.nvars()}, '{repr(self.ordering())}', {self.names()})"

def name(self, long i):
if not 0 <= i < len(self.py_names):
raise IndexError("Variable name index out of range")
return self.py_names[i].decode("ascii")

def names(self):
return tuple(name.decode("ascii") for name in self.py_names)

def gens(self):
return tuple(self.gen(i) for i in range(self.nvars()))

def variable_to_index(self, var: Union[int, str]):
"""Convert a variable name string or possible index to its index in the context."""
if isinstance(var, str):
try:
i = self.names().index(var)
except ValueError:
raise ValueError("Variable not in context")
elif isinstance(var, int):
if not 0 <= var < self.nvars():
raise IndexError("Generator index out of range")
i = var
else:
raise TypeError("Invalid variable type")

return i

@staticmethod
def create_variable_names(slong nvars, names: str):
"""
Create a tuple of variable names based on the comma separated `names` string.

If `names` contains a single value, and `nvars` > 1, then the variables are numbered, e.g.

>>> flint_mpoly_context.create_variable_names(3, "x")
('x0', 'x1', 'x2')

"""
nametup = tuple(name.strip() for name in names.split(','))
if len(nametup) != nvars:
if len(nametup) == 1:
nametup = tuple(nametup[0] + str(i) for i in range(nvars))
else:
raise ValueError("Number of variables does not equal number of names")
return nametup

@classmethod
def get_context(cls, slong nvars=1, ordering=Ordering.lex, names: Optional[str] = "x", nametup: Optional[tuple] = None):
"""
Retrieve a context via the number of variables, `nvars`, the ordering, `ordering`, and either a variable
name string, `names`, or a tuple of variable names, `nametup`.
"""

# A type hint of `ordering: Ordering` results in the error "TypeError: an integer is required" if a Ordering
# object is not provided. This is pretty obtuse so we check it's type ourselves
if not isinstance(ordering, Ordering):
raise TypeError(f"`ordering` ('{ordering}') is not an instance of flint.Ordering")

if nametup is not None:
key = nvars, ordering, nametup
elif nametup is None and names is not None:
key = nvars, ordering, cls.create_variable_names(nvars, names)
else:
raise ValueError("Must provide either `names` or `nametup`")

ctx = cls._ctx_cache.get(key)
if ctx is None:
ctx = cls._ctx_cache.setdefault(key, cls(*key))
return ctx

@classmethod
def from_context(cls, ctx: flint_mpoly_context):
return cls.get_context(
nvars=ctx.nvars(),
ordering=ctx.ordering(),
names=None,
nametup=ctx.names()
)


cdef class flint_mpoly(flint_elem):
"""
Base class for multivariate polynomials.
"""

def leading_coefficient(self):
return self.coefficient(0)

def to_dict(self):
return {self.exponent_tuple(i): self.coefficient(i) for i in range(len(self))}

def __contains__(self, x):
"""
Returns True if `self` contains a term with exponent vector `x` and a non-zero coefficient.

>>> from flint import fmpq_mpoly_ctx, Ordering
>>> ctx = fmpq_mpoly_ctx.get_context(2, Ordering.lex, 'x')
>>> p = ctx.from_dict({(0, 1): 2, (1, 1): 3})
>>> (1, 1) in p
True
>>> (5, 1) in p
False

"""
return bool(self[x])

def __iter__(self):
return iter(self.keys())

def __pos__(self):
return self

def keys(self):
return self.monoms()

def values(self):
return self.coeffs()

def items(self):
"""
Return the exponent vectors and coefficient of each term.

>>> from flint import fmpq_mpoly_ctx, Ordering
>>> ctx = fmpq_mpoly_ctx.get_context(2, Ordering.lex, 'x')
>>> f = ctx.from_dict({(0, 0): 1, (1, 0): 2, (0, 1): 3, (1, 1): 4})
>>> list(f.items())
[((1, 1), 4), ((1, 0), 2), ((0, 1), 3), ((0, 0), 1)]

"""
return zip(self.keys(), self.values())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these should just be removed now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have monoms and coeffs which perform the same role.

Copy link
Contributor Author

@Jake-Moss Jake-Moss Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but I will note here that .items is slightly different that the .terms currently implemented (and sympy), it returns a list of the terms of the polynomials rather than a tuple of exponent tuple and coefficient. (I swear I commented about that but I cannot find it)

I'm tempting to move the current .terms behaviour into another function or remove it, making .terms align with sympy. Though I'm not sure what I would name it



cdef class flint_series(flint_elem):
"""
Expand Down Expand Up @@ -190,3 +350,26 @@ cdef class flint_mat(flint_elem):

# supports mpmath conversions
tolist = table


cdef ordering_t ordering_py_to_c(ordering): # Cython does not like an "Ordering" type hint here
if not isinstance(ordering, Ordering):
raise TypeError(f"`ordering` ('{ordering}') is not an instance of flint.Ordering")

if ordering == Ordering.lex:
return ordering_t.ORD_LEX
elif ordering == Ordering.deglex:
return ordering_t.ORD_DEGLEX
elif ordering == Ordering.degrevlex:
return ordering_t.ORD_DEGREVLEX


cdef ordering_c_to_py(ordering_t ordering):
if ordering == ordering_t.ORD_LEX:
return Ordering.lex
elif ordering == ordering_t.ORD_DEGLEX:
return Ordering.deglex
elif ordering == ordering_t.ORD_DEGREVLEX:
return Ordering.degrevlex
else:
raise ValueError("Unimplemented term order %d" % ordering)
2 changes: 1 addition & 1 deletion src/flint/flint_base/flint_context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cdef class FlintContext:
self.threads = 1
self.cap = 10

@property
@property
def prec(self):
return self._prec

Expand Down
46 changes: 8 additions & 38 deletions src/flint/flintlib/fmpq.pxd
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
from flint.flintlib.flint cimport ulong, flint_rand_t, mp_bitcnt_t, slong, flint_bitcnt_t
from flint.flintlib.fmpz cimport fmpz_struct, fmpz_t

cdef extern from *:
"""
/* An ugly hack to get around the ugly hack of renaming fmpq to avoid a c/python name collision */
typedef fmpq fmpq_struct;
"""

cdef extern from "flint/fmpq.h":
ctypedef struct fmpq_struct:
fmpz_struct num
fmpz_struct den

ctypedef fmpq_struct fmpq_t[1]

fmpz_struct * fmpq_numref(fmpq_t x)
fmpz_struct * fmpq_denref(fmpq_t x)

# from here on is parsed
void fmpq_init(fmpq_t x)
void fmpq_clear(fmpq_t x)
void fmpq_canonicalise(fmpq_t res)
void _fmpq_canonicalise(fmpz_t num, fmpz_t den)
int fmpq_is_canonical(const fmpq_t x)
int _fmpq_is_canonical(const fmpz_t num, const fmpz_t den)
void fmpq_set(fmpq_t dest, const fmpq_t src)
void fmpq_swap(fmpq_t op1, fmpq_t op2)
void fmpq_neg(fmpq_t dest, const fmpq_t src)
void fmpq_abs(fmpq_t dest, const fmpq_t src)
void fmpq_zero(fmpq_t res)
void fmpq_one(fmpq_t res)
int fmpq_is_zero(const fmpq_t res)
int fmpq_is_one(const fmpq_t res)
int fmpq_is_pm1(const fmpq_t res)
int fmpq_equal(const fmpq_t x, const fmpq_t y)
int fmpq_sgn(const fmpq_t x)
int fmpq_cmp(const fmpq_t x, const fmpq_t y)
int fmpq_cmp_fmpz(const fmpq_t x, const fmpz_t y)
int fmpq_cmp_ui(const fmpq_t x, ulong y)
int fmpq_cmp_si(const fmpq_t x, slong y)
int fmpq_equal_ui(const fmpq_t x, ulong y)
int fmpq_equal_si(const fmpq_t x, slong y)
void fmpq_height(fmpz_t height, const fmpq_t x)
flint_bitcnt_t fmpq_height_bits(const fmpq_t x)
void fmpq_set_fmpz_frac(fmpq_t res, const fmpz_t p, const fmpz_t q)
# void fmpq_get_mpz_frac(mpz_t a, mpz_t b, fmpq_t c)
void fmpq_set_si(fmpq_t res, slong p, ulong q)
void _fmpq_set_si(fmpz_t rnum, fmpz_t rden, slong p, ulong q)
void fmpq_set_ui(fmpq_t res, ulong p, ulong q)
void _fmpq_set_ui(fmpz_t rnum, fmpz_t rden, ulong p, ulong q)
# void fmpq_set_mpq(fmpq_t dest, const mpq_t src)
void fmpq_set_str(fmpq_t dest, const char * s, int base)
# void fmpq_init_set_mpz_frac_readonly(fmpq_t z, const mpz_t p, const mpz_t q)
double fmpq_get_d(const fmpq_t f)
# void fmpq_get_mpq(mpq_t dest, const fmpq_t src)
# int fmpq_get_mpfr(mpfr_t dest, const fmpq_t src, mpfr_rnd_t rnd)
# from here on is parsed
void fmpq_init(fmpq_t x)
void fmpq_clear(fmpq_t x)
Expand Down
Loading
Loading