R/RcppExports.R

Defines functions logSumExp marginalTransitionsCpp multiProbToStick multiStickToProb postorderMessagePassing preorderMessagePassing probToStick setValues siteGainLossCpp stickToProb treeLL

Documented in logSumExp multiProbToStick multiStickToProb probToStick stickToProb

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

#' Vector logSumExpArma
#'
#' This function computes the sum(e^x) of a vector x without leaving log space
#'
#' @param x A numeric vector
NULL

#' Vector logSumExp
#' 
#' This function computes the sum(e^x) of a vector x without leaving log space
#'
#' @param x A numeric vector
#' @export
logSumExp <- function(x) {
    .Call('_epiAllele_logSumExp', PACKAGE = 'epiAllele', x)
}

marginalTransitionsCpp <- function(data, tMat, traversal, nTips, logPi, siblings, ncores = 1L) {
    .Call('_epiAllele_marginalTransitionsCpp', PACKAGE = 'epiAllele', data, tMat, traversal, nTips, logPi, siblings, ncores)
}

#' multiProbToStick 
#'
#' Convert a multiple sets of stick breaking parameters to a set of probabilities that sum to one
#' @param x the parameter of stick breaking parameters
#' @param width the width of the stick breakink process
#' @name multiProbToStick
#' @return a vector of probabilities that sum to one
multiProbToStick <- function(x, width) {
    .Call('_epiAllele_multiProbToStick', PACKAGE = 'epiAllele', x, width)
}

#' multiStickToProb 
#'
#' Convert a multiple sets of stick breaking parameters to a set of probabilities that sum to one
#' @param x the parameter of stick breaking parameters
#' @param width the width of the stick breakink process
#' @name multiStickToProb
#' @return a vector of probabilities that sum to one
multiStickToProb <- function(x, width) {
    .Call('_epiAllele_multiStickToProb', PACKAGE = 'epiAllele', x, width)
}

postorderMessagePassing <- function(data, tMat, traversal, nTips, logPi, nNode) {
    .Call('_epiAllele_postorderMessagePassing', PACKAGE = 'epiAllele', data, tMat, traversal, nTips, logPi, nNode)
}

preorderMessagePassing <- function(data, tMat, traversal, nTips, logPi, alpha, siblings, nNode, root) {
    .Call('_epiAllele_preorderMessagePassing', PACKAGE = 'epiAllele', data, tMat, traversal, nTips, logPi, alpha, siblings, nNode, root)
}

#' probToStick 
#'
#' Convert a set of probabilities that sum to one to a set of stick breaking parameters
#' @param x parameter vector of probabilities
#' @name probToStick
#' @return a vector of parameters for a stick breaking parameters
probToStick <- function(x) {
    .Call('_epiAllele_probToStick', PACKAGE = 'epiAllele', x)
}

setValues <- function(x, ind, val) {
    invisible(.Call('_epiAllele_setValues', PACKAGE = 'epiAllele', x, ind, val))
}

siteGainLossCpp <- function(data, tMat, traversal, nTips, logPi, siblings, ncores = 1L) {
    .Call('_epiAllele_siteGainLossCpp', PACKAGE = 'epiAllele', data, tMat, traversal, nTips, logPi, siblings, ncores)
}

#' stickToProb 
#'
#' Convert a set of stick breaking parameters to a set of probabilities that sum to one
#' @param x parameter vector of stick breaking process parameters
#' @name stickToProb
#' @return a vector of probabilities that sum to one
stickToProb <- function(x) {
    .Call('_epiAllele_stickToProb', PACKAGE = 'epiAllele', x)
}

treeLL <- function(data, tMat, traversal, nTips, logPi) {
    .Call('_epiAllele_treeLL', PACKAGE = 'epiAllele', data, tMat, traversal, nTips, logPi)
}
ndukler/epiAllele documentation built on May 5, 2019, 4:50 p.m.