Malachite for Users of Other Libraries
These pages map the functions of established arithmetic libraries onto their Malachite counterparts, section by section, following the organization of each library’s manual. They are meant to be read in two directions: if you are porting code, look up the function you are using and find what to write instead; if you are wondering what Malachite is still missing, look for the rows marked ✗, which are the ones it is committed to filling in.
GMP
- Integers: the
mpz_ttype, mapped ontoNaturalandInteger. - Rationals: the
mpq_ttype, mapped ontoRational.
GMP’s floating-point type, mpf_t, will not get a page of its own. GMP’s manual steers new
projects toward MPFR, and Malachite’s
Float follows
MPFR, so the float mapping belongs with
the MPFR page.
FLINT
- Integers: the
fmpz_ttype, mapped ontoNaturalandInteger. - Integers mod n: the
fmpz_mod.hmodule, mapped onto theMod*traits overNaturalresidues. - Rationals: the
fmpq_ttype, mapped ontoRational. - Gaussian integers: the
fmpzi_ttype, mapped ontoGaussianInteger. - Integer polynomials: the
fmpz_poly_ttype, mapped ontoIntegerPolynomial. All 48 sections offmpz_poly.hare mapped. - Rational polynomials: the
fmpq_poly_ttype, mapped ontoRationalPolynomial. All 32 sections offmpq_poly.hare mapped. - Modular polynomials: the
fmpz_mod_poly_ttype — polynomials over the integers mod \(n\) — mapped ontoNaturalPolynomial. All 34 sections offmpz_mod_poly.hare mapped. - Word-sized modular polynomials: the
nmod_poly_ttype — polynomials over the integers mod \(n\), for an \(n\) that fits in a machine word — mapped ontoUnsignedPolynomial. All 42 sections ofnmod_poly.hare mapped. - Integer vectors: the
fmpz_vec.hmodule, mapped ontoIntegerVector. All 15 sections offmpz_vec.hare mapped. - Rational vectors: the
fmpq_vec.hmodule, mapped ontoRationalVector. All 8 sections offmpq_vec.hare mapped. - Integer vectors mod n: the
fmpz_mod_vec.hmodule, mapped ontoNaturalVectorwith theMod*traits. All 5 sections offmpz_mod_vec.hare mapped. - Word-sized integer vectors mod n: the
nmod_vec.hmodule, mapped ontoUnsignedVectorwith theMod*traits. All 7 sections ofnmod_vec.hare mapped. - Arithmetic functions: the
arith.hmodule, which computes number-theoretic and combinatorial sequences.
FLINT modules not listed here have no page.
MPFR
num
- Integers: num-bigint’s
BigUintandBigInt, mapped ontoNaturalandInteger. - Rationals: num-rational’s
Ratio<T>andBigRational, mapped ontoRational. - Traits: the num-traits and num-integer trait crates, with num-iter’s ranges, mapped onto malachite-base’s generic vocabulary.
num-complex has no page: Malachite has no complex type for it to map onto.
Azurite
- Naturals: the
AzNattype, Azurite’s formally verified multi-limb natural number, mapped ontoNatural. - Integers: the
AzInttype, mapped ontoInteger. - Integers modulo a power of 2: the
AzZModPow2 ktype, mapped onto themod_power_of_2_*operations ofNatural. - Integers modulo a natural: the
AzZMod mtype, mapped onto themod_*operations ofNatural. - Rationals: the
AzRattype, mapped ontoRational. - Floats: the
AzFloattype, mapped ontoFloat.
Azurite’s polynomial and matrix types will get pages as they are mapped.