Sweep: sweep

20-SweepR Documentation

sweep

Description

Sweep an MPCR vector through an MPCR matrix.

Usage

## S4 method for signature 'Rcpp_MPCR'
sweep(x,stat,margin,FUN)

Arguments

x

An MPCR object.

stat

MPCR vector containing the value(s) that should be used in the operation.

margin

1 means row; otherwise means column.

FUN

Sweeping function; must be one of "+", "-", "*", "/", or "^".

Value

An MPCR matrix of the same type as the highest precision input.

Examples


library(MPCR)
x <- as.MPCR(1:20,10,2,"single")
y <- as.MPCR(1:5,precision="double")
sweep_out <- sweep(x, stat=y, margin=1, FUN="+")
MPCR.is.double(sweep_out)  #TRUE


MPCR documentation built on April 13, 2025, 5:08 p.m.

Related to Sweep in MPCR...