R/RcppExports.R

Defines functions SolveCongruence GetBoxIndices HaltonSeq log_b

Documented in GetBoxIndices HaltonSeq log_b SolveCongruence

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Internal function for log base b, since it isn't obvious in C++.
log_b <- function(x, base) {
    .Call('_MSampNZ_log_b', PACKAGE = 'MSampNZ', x, base)
}

#' Draw Halton Sequence values for a single dimension.
#' Note that this was borrowed from the Internet and is not my implmementation.
#'
#'
#' @param x An integer for the starting index k >= 0.
#' @param base Co-prime Base but generally for BAS work it is 2 or 3.
#' @param n Number of samples to draw.
#'
#' @examples
#' HaltonSeq(k = 0, base = 2, n = 10)
#'
HaltonSeq <- function(k, base, n) {
    .Call('_MSampNZ_HaltonSeq', PACKAGE = 'MSampNZ', k, base, n)
}

#' Fast Implementation of finding x and y order numbers to feed into the linear congruence equation.
#' This solves equation solves for a_i in the HIP paper.
#' This is essentially an internal function and shouldn't be worried about.
#'
#'
#' @param lxy A Matrix of lower x y coordinates of a Halton Box inside the unit box.
#' @param base Co-prime Base but generally for BAS work it is 2 or 3.
#' @param J Integer of 2 values that represent the numbers 2^J1, 3^J2.
#'
#'
GetBoxIndices <- function(lxy, base, J) {
    .Call('_MSampNZ_GetBoxIndices', PACKAGE = 'MSampNZ', lxy, base, J)
}

#' Solve system of linear congruence from HIP paper to order HIP boxes.
#' See page 5 of Robertson et al. 2018 Halton Iterative Partitioning.
#' This is essentially an internal function and shouldn't be worried about.
#'
#'
#' @param A Matrix that is in numeric for computational reasons but is the a_i solutions for all HIP boxes.
#' @param base Co-prime Base but generally for BAS work it is 2 or 3.
#' @param J Integer of 2 values that represent the numbers 2^J1, 3^J2.
#'
#'
SolveCongruence <- function(A, base, J) {
    .Call('_MSampNZ_SolveCongruence', PACKAGE = 'MSampNZ', A, base, J)
}
ogansell/MSampNZ documentation built on Nov. 14, 2020, 3:31 p.m.