Class arf extends virtual class flint. It
represents vectors of arbitrary precision floating-point real numbers.
Elements have arbitrary precision significand and exponent. The
underlying C type can represent NaN, -Inf,
and Inf.
## Class generator functionsarf(x = 0, length = 0L, names = NULL,
prec = NULL, rnd = NULL)
arf.array(x = 0, dim = length(x), dimnames = NULL,
prec = NULL, rnd = NULL)
A arf vector, possibly an array; see ‘Details’.
an atomic or flint vector containing data for
conversion to arf.
a numeric vector of length one giving the length of the return
value. If that exceeds the length of x, then x is
recycled. Non-integer values are rounded in the direction of zero.
the names slot of the return value, either NULL or a
character vector of equal length. Non-character names are
coerced to character.
the dim slot of the return value, an integer vector of
nonzero length. If the product exceeds the length of x, then
x is recycled. Non-integer numeric dim are coerced to
integer.
the dimnames slot of the return value, either NULL or
a list of length equal to the length of dim. The components
are either NULL or character vectors of length given by
dim. Non-character vector components of dimnames are
coerced to character.
the precision used for conversion. NULL means to convert
exactly if possible and to round to the global default precision
otherwise; see flintPrec.
the rounding mode used for inexact conversion. NULL means to
round according to the global default rounding mode; see
flintRnd.
Real numbers and real parts of complex numbers are rounded according
to the precision and rounding mode set by prec and rnd.
Imaginary parts of complex numbers are discarded.
Character strings are converted using function mpfr_strtofr
from the GNU MPFR library with argument
base set to 0; see
https://www.mpfr.org/mpfr-current/mpfr.html#Assignment-Functions.
.xData, dim, dimnames, namesinherited from virtual class flint.
Due to constraints imposed by generic functions, methods typically do
not provide a formal argument prec allowing for a
precision to be indicated in the function call. Such methods use the
current default precision set by flintPrec.
!signature(x = "arf"):
equivalent to (but faster than) x == 0.
%*%, crossprod, tcrossprodsignature(x = "arf", y = "arf"):
signature(x = "arf", y = "ANY"):
signature(x = "ANY", y = "arf"):
matrix products. The “other” operand must be atomic or
inherit from virtual class flint.
crossprod and tcrossprod behave as if y = x
when y is missing or NULL. Operands are promoted as
necessary and must be conformable (have compatible dimensions).
Non-array operands of length k are handled as 1-by-k
or k-by-1 matrices depending on the call. The return value
is approximate insofar that it may not be correctly rounded.
+signature(e1 = "arf", e2 = "missing"):
returns a copy of the argument.
-signature(e1 = "arf", e2 = "missing"):
returns the negation of the argument.
Complexsignature(z = "arf"):
mathematical functions of one argument; see
S4groupGeneric.
Mathsignature(x = "arf"):
mathematical functions of one argument; see
S4groupGeneric.
Math2signature(x = "arf"):
decimal rounding according to a second argument digits; see
S4groupGeneric. There are just two member
member functions: round, signif.
Opssignature(e1 = "arf", e2 = "arf"):
signature(e1 = "arf", e2 = "ANY"):
signature(e1 = "ANY", e2 = "arf"):
binary arithmetic, comparison, and logical operators; see
S4groupGeneric. The “other” operand
must be atomic or inherit from virtual class
flint. Operands are promoted as necessary.
Array operands must be conformable (have identical dimensions).
Non-array operands are recycled.
Summarysignature(x = "arf"):
univariate summary statistics; see
S4groupGeneric. The return value is a
logical vector of length 1 (any, all) or an
arf vector of length 1 or 2 (sum, prod,
min, max, range).
anyNAsignature(x = "arf"):
returns TRUE if any element of x is NaN,
FALSE otherwise.
as.vectorsignature(x = "arf"):
returns as.vector(y, mode), where y is a double
vector containing the result of converting each element of
x to the range of double, rounding if the value is not
exactly representable in double precision. The rounding mode is
to the nearest representable number (with precedence to even
significands in case of ties), unless the element exceeds
.Machine[["double.xmax"]] in absolute value, in which case
-Inf or Inf is introduced with a warning. Coercion
to types "character", "symbol" (synonym
"name"), "pairlist", "list", and
"expression", which are not “number-like”, is
handled specially. See also asVector.
backsolvesignature(r = "arf", x = "arf"):
signature(r = "arf", x = "ANY"):
signature(r = "ANY", x = "arf"):
solution of the triangular system op2(op1(r)) %*% y = x,
where op1=ifelse(upper.tri, triu, tril) and
op2=ifelse(transpose, t, identity) and upper.tri and
transpose are optional logical arguments with default
values TRUE and FALSE, respectively. The
“other” operand must be atomic or inherit from virtual
class flint. If x is missing, then
the return value is the inverse of op2(op1(r)), as if
x were the identity matrix. Operands are promoted as
necessary and must be conformable (have compatible dimensions).
Non-array x are handled as length(x)-by-1 matrices.
cholsignature(x = "arf"):
returns the upper triangular Cholesky factor of the positive
definite matrix whose upper triangular part is the upper
triangular part of x.
chol2invsignature(x = "arf"):
returns the inverse of the positive definite matrix whose upper
triangular Cholesky factor is the upper triangular part of
x.
coercesignature(from = "ANY", to = "arf"):
returns the value of arf(from).
colSums, colMeanssignature(x = "arf"):
returns an arf vector or array containing the column sums
or means of x, defined as sums or means over dimensions
1:dims.
detsignature(x = "arf"):
returns the determinant of x as an arf vector of
length 1.
determinantsignature(x = "arf"):
returns a list with components modulus and sign
specifying the determinant of x, following the documented
behaviour of the base function.
diffsignature(x = "arf"):
returns a vector storing lagged differences of the elements of
x or (if x is a matrix) a matrix storing lagged
differences of the rows of x, following the documented
behaviour of the S3 default method.
diffinvsignature(x = "arf"):
returns the vector or matrix y such that
x = diff(y, ...), following the documented behaviour of
the S3 default method.
formatsignature(x = "arf"):
returns a character vector suitable for printing, using scientific
format. Optional arguments control the output; see
format-methods.
is.finitesignature(x = "arf"):
returns a logical vector indicating which elements of x
are not NaN, -Inf, or Inf.
is.infinitesignature(x = "arf"):
returns a logical vector indicating which elements of x
are -Inf or Inf.
is.na, is.nansignature(x = "arf"):
returns a logical vector indicating which elements of x
are NaN.
is.unsortedsignature(x = "arf"):
returns a logical indicating if x is not sorted in
nondecreasing order (increasing order if optional argument
strictly is set to TRUE).
logsignature(x = "arf"):
returns the logarithm of the argument. The natural logarithm is
computed by default (when optional argument base is
unset).
meansignature(x = "arf"):
returns the arithmetic mean.
rowSums, rowMeanssignature(x = "arf"):
returns an arf vector or array containing the row sums or
means of x, defined as sums or means over dimensions
(dims+1):length(dim(x)).
solvesignature(a = "arf", b = "arf"):
signature(a = "arf", b = "ANY"):
signature(a = "ANY", b = "arf"):
solution of the general system a %*% x = b. The
“other” operand must be atomic or inherit from virtual
class flint. If b is missing, then
the return value is the inverse of a, as if b were
the identity matrix. Operands are promoted as necessary and must
be conformable (have compatible dimensions). Non-array b
are handled as length(b)-by-1 matrices.
The class generator function has four distinct usages:
arf()
arf(length=)
arf(x)
arf(x, length=)The first usage generates an empty vector. The second usage generates
a zero vector of the indicated length. The third usage converts
x, preserving dimensions, dimension names, and names. The
fourth usage converts x, recycling its elements to the
indicated length and discarding its dimensions, dimension names, and
names. Attempts to recycle x of length zero to nonzero length
are an error.
Usage of arf.array is modelled after array.
The FLINT documentation of the underlying C type: https://flintlib.org/doc/arf.html
Johansson, F. (2017). Arb: efficient arbitrary-precision midpoint-radius interval arithmetic. IEEE Transactions on Computers, 66(8), 1281-1292. tools:::Rd_expr_doi("10.1109/TC.2017.2690633")
Virtual class flint.
showClass("arf")
showMethods(classes = "arf")
Run the code above in your browser using DataLab