R/IntegerFactorization.R

Defines functions stdThreadMax primeFactorizeBig quadraticSieve divisorsBig

Documented in divisorsBig primeFactorizeBig quadraticSieve stdThreadMax

divisorsBig <- function(v, namedList = FALSE, showStats = FALSE,
                        skipPolRho = FALSE, skipECM = FALSE, nThreads = NULL) {

    GetDivisorsC(v, namedList, showStats, skipPolRho,
                 skipECM, nThreads, pkgEnv$nThreads)
}

quadraticSieve <- function(n, showStats = FALSE, nThreads = NULL) {
    PrimeFactorization(n, FALSE, showStats, TRUE, TRUE, nThreads, pkgEnv$nThreads)
}

primeFactorizeBig <- function(v, namedList = FALSE, showStats = FALSE,
                              skipPolRho = FALSE, skipECM = FALSE, nThreads = NULL) {

    PrimeFactorization(v, namedList, showStats, skipPolRho,
                       skipECM, nThreads, pkgEnv$nThreads)
}

stdThreadMax <- function() {
    nThreads <- cpp11GetNumThreads()

    if (nThreads < 1L || is.na(nThreads) || is.null(nThreads)) {
        nThreads <- 1L
    }

    nThreads
}

Try the RcppBigIntAlgos package in your browser

Any scripts or data that you put into this service are public.

RcppBigIntAlgos documentation built on Aug. 16, 2023, 5:06 p.m.