fmpz-class function

Arbitrary Precision Signed Integers

Arbitrary Precision Signed Integers

Class fmpz extends virtual class flint. It represents vectors of arbitrary precision signed integers. There is no representation for 's missing value NA_integer_. class

## The class generator function: .fmpz(...) ## Mode 1: initialize with zeros ## .fmpz(length = 0L) ## ## Mode 2: initialize with vector ## .fmpz(length = length(x), x)

Arguments

  • ...: arguments passed to methods for initialize.

Returns

The class generator function returns new("fmpz", ...).

Slots

  • .xData, names: inherited from virtual class flint.

Methods

  • !: signature(x = "fmpz"):

     equivalent to (but faster than) `x == 0`.
    
  • +: signature(e1 = "fmpz", e2 = "missing"):

     returns a copy of the argument.
    
  • -: signature(e1 = "fmpz", e2 = "missing"):

     returns the negation of the argument.
    
  • Complex: signature(z = "fmpz"):

     mathematical functions of one argument; see `S4groupGeneric`. Member functions requiring promotion to a floating-point type may not be implemented.
    
  • Math: signature(x = "fmpz"):

     mathematical functions of one argument; see `S4groupGeneric`. Member functions requiring promotion to a floating-point type may not be implemented.
    
  • Math2: signature(x = "fmpz"):

     decimal rounding according to a second argument `digits`; see `S4groupGeneric`. There are just two member member functions: `round`, `signif`.
    
  • Ops: signature(e1 = "ANY", e2 = "fmpz"):

      `signature(e1 = "fmpz", e2 = "ANY")`:
     
     binary arithmetic, comparison, and logical operators; see `S4groupGeneric`. The other operand must be atomic or inherit from virtual class `flint`. The operands are recycled and promoted as necessary.
    
  • Summary: signature(x = "fmpz"):

     univariate summary statistics; see `S4groupGeneric`. The return value is a logical vector of length 1 (`any`, `all`) or an `fmpz` vector of length 1 or 2 (`sum`, `prod`, `min`, `max`, `range`).
    
  • anyNA: signature(x = "fmpz"):

     returns `FALSE`, as `fmpz` has no representation for `NaN`.
    
  • as.vector: signature(x = "fmpz"):

     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 in the direction of zero, 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.
    
  • coerce: signature(from = "ANY", to = "fmpz"):

     returns `.fmpz(x = from)`. An error is signaled if the class or type of `from` is not supported by the method for `initialize`.
    
  • format: signature(x = "fmpz"):

     returns a character vector suitable for printing. Optional arguments control the output; see `format-methods`.
    
  • initialize: signature(.Object = "fmpz", length = "numeric"):

     returns `.Object` after setting its `.xData` slot. The new slot value is an external pointer to an array of the corresponding type, which is newly allocated and initialized entirely with zeros. `.Object` is not copied, so all references are affected.
    
  • initialize: signature(.Object = "fmpz", length = "numeric", x = "atomic|flint"):

     as above, except that the new slot value points to an array initialized with values from `x` truncated towards zero. An error is signaled if elements of `x` are `NaN`, `-Inf`, or `Inf`.
    
  • is.finite: returns a logical vector whose elements are all TRUE, as fmpz has no representation for NaN, -Inf, and Inf.

  • is.infinite, is.na, is.nan: signature(x = "fmpz"):

     returns a logical vector whose elements are all `FALSE`, as `fmpz` has no representation for `NaN`, `-Inf`, and `Inf`.
    
  • is.unsorted: signature(x = "fmpz"):

     returns a logical indicating if `x` is not sorted in nondecreasing order (increasing order if optional argument `strictly` is set to `TRUE`).
    
  • mean: signature(x = "fmpz"):

     returns the arithmetic mean. An error is signaled if the argument length is 0, because the return type is `fmpq`
     
     which cannot represent the result of division by 0.
    

See Also

Virtual class flint.

References

The FLINT documentation of the underlying

type: https://flintlib.org/doc/fmpz.html

Examples

showClass("fmpz") showMethods(classes = "fmpz")
  • Maintainer: Mikael Jagan
  • License: GPL (>= 2)
  • Last published: 2025-03-24