NEWS | R Documentation |
News for R Package flint
Changes in version 0.0.2 (2025-02-20)
Installation
An array declaration in ‘src/flint.h’ specified an incorrect (too small) array size, triggering
gcc
-Wlto-type-mismatch. Thanks to Brian Ripley for the report.-
‘src/noreturn.h’ is included before system header ‘flint/flint.h’. The latter is broken in FLINT 3.1 due to nonportable use of keyword
_Noreturn
and keyword macronoreturn
. Thanks to Brian Ripley for the report. -
‘configure’ wrongly assumed that ‘Rinternals.h’ must be located in ‘'R RHOME'/include’. Thanks to Dirk Eddelbuettel for the report (GH#3).
More pointers are zero-initialized to appease
clang
-Wsometimes-uninitialized.
Changes in version 0.0.1 (2025-02-17)
Description
The package is titled “Fast Library for Number Theory”, matching FLINT.
Mikael Jagan is the maintainer and sole author.
-
Depends: R (>= 4.3)
mainly for KaTeX support when rendering Rd to HTML and ‘amsmath’ support when rendering Rd to PDF. -
Depends: methods
as flint defines S4 classes, generic functions, and methods. -
Imports: stats
as flint provides S3 and S4 methods forquantile
. -
SystemRequirements: flint (>= 3), mpfr (>= 3.1), gmp
as flint links FLINT, GNU MPFR, and GNU MP. The version requirements are purely informational, as ‘configure’ and ‘configure.win’ scripts check that features used by the package are available.
Installation
A ‘configure’ script is provided for installation under Unix. The script uses
pkg-config
where available to determine options for linking FLINT, GNU MPFR, and GNU MP. The user can set environment variables PKG_CONFIG and PKG_CONFIG_PATH to control howpkg-config
is invoked and where it searches for ‘*.pc’ files. The script gives precedence to environment variables R_FLINT_CPPFLAGS, R_FLINT_CFLAGS, R_FLINT_LDFLAGS, and R_FLINT_LIBS: if any of these is set, then the script does not usepkg-config
. In that case, R_FLINT_LIBS gets a default value -lflint -lmpfr -lgmp. The other R_FLINT_* are empty by default.A ‘configure.win’ script is provided for installation under Windows. Currently, it invokes ‘configure’, passing along positional parameters, and does nothing else.
Documentation
S4 classes, generic functions, and methods are documented under help topics with keyword
classes
ormethods
. Interfaces to special mathematical functions are documented under help topics with keywordmath
. One can usehelp(package = "flint")
or (for example)help.search(package = "flint", keyword = "math")
to get a list of (non-internal) help topics.
Classes
Virtual class
flint
with nonvirtual subclassesulong
,slong
,fmpz
,fmpq
,mag
,arf
,acf
,arb
, andacb
. Objects can be understood as vectors of length at most2^32-1
or2^64-1
(depending on the ABI) of the so-named C types. The implementation is based on external pointers.-
ulong
andslong
represent vectors of fixed precision unsigned and signed integers. The integer size is 32 or 64 bits (depending on the ABI). -
fmpz
represents vectors of arbitrary precision signed integers. -
fmpq
represents vectors of arbitrary precision rational numbers, always in “canonical” form with numerator and positive, coprime denominator -
mag
represents vectors of fixed precision error bounds. -
arf
andacf
represent vectors of arbitrary precision floating-point real and complex numbers. -
arb
andacb
represent vectors of arbitrary precision floating-point real and complex numbers with error bounds. They support “ball arithmetic”.
Generic Functions
S4 generic functions
Num
,Num<-
,Den
, andDen<-
for getting and setting numerators and denominators of quotients.S4 generic functions
Mid
,Mid<-
,Rad
, andRad<-
for getting and setting midpoints and radii of balls in a metric space.S4 generic functions
Real
,Real<-
,Imag
, andImag<-
for getting and setting real and imaginary parts of complex numbers.
Methods
S4 methods are defined for generic functions
[
,[<-
,[[
,[[<-
,Complex
,Den
,Den<-
,Imag
,Imag<-
,Math
,Math2
,Mid
,Mid<-
,Num
,Num<-
,Ops
,Rad
,Rad<-
,Real
,Real<-
,Summary
,all.equal
,anyDuplicated
,anyNA
,as.raw
,as.logical
,as.integer
,as.numeric
,as.complex
,as.vector
,as.matrix
,as.array
,as.data.frame
,as.Date
,as.POSIXct
,as.POSIXlt
,coerce
,cut
,duplicated
,findInterval
,format
,initialize
,is.finite
,is.infinite
,is.na
,is.na<-
,is.nan
,is.unsorted
,length
,length<-
,match
,mean
,mtfrm
,names
,names<-
,print
,quantile
,rep
,rep.int
,rep_len
,show
,seq
,sequence
,summary
,unique
, andxtfrm
.S3 methods are defined for S3-turned-S4 generic functions. These methods call the S4 generic function so that S4 dispatch occurs if the S3 generic function is called.
New Features
Generator functions for each of the nonvirtual subclasses of virtual class
flint
.-
C library functions
arb_const_pi
,arb_const_log2
,arb_const_log10
,arb_const_e
,arb_lambertw
,acb_lambertw
,arb_dirichlet_zeta
,acb_dirichlet_zeta
,arb_dirichlet_hurwitz
,acb_dirichlet_hurwitz
,acb_dirichlet_lerch_phi
,arb_hypgeom_gamma
,acb_hypgeom_gamma
,arb_hypgeom_rgamma
,acb_hypgeom_rgamma
,arb_hypgeom_lgamma
,acb_hypgeom_lgamma
,acb_hypgeom_polygamma
,arb_hypgeom_2f1
, andacb_hypgeom_2f1
acb_polygamma
,acb_dirichlet_zeta
,acb_dirichlet_hurwitz
,acb_dirichlet_lerch_phi
,acb_hypgeom_gamma
,acb_hypgeom_rgamma
,acb_hypgeom_lgamma
, andacb_hypgeom_2f1
are interfaced as R functions with identical names and “prototypes”. Arguments are coerced to the correct class and recycled internally. -
R function
flintABI
returning the size in bits of C typemp_limb_t
, either 32 or 64. The value is determined at configure time. -
R function
flintIdentical
for testing whether twoflint
vectors have identical class, length, and “content”. This test is less strict than the test for pointer equality done byidentical(x, y)
whenx
andy
are external pointers. -
R function
flintLength
for getting the length of aflint
vector as aulong
vector or, optionally, as a traditional numeric vector subject to rounding error. -
R functions
flintPrec
andflintRnd
for getting and setting the global default precision and rounding modes. -
R function
flintSize
for calculating the number of bytes used by aflint
vector. -
R function
flintTriple
returning a character vector of length 3 of the formc(class, length, address)
, useful if details about aflint
vector must be printed. -
R function
flintVersion
returning a list containing header and library versions for FLINT, GNU MPFR, and GNU MP. Header versions are determined at compile time. Library versions are determined at run time.