R/RcppExports.R

Defines functions calc_probsurf secr_nll squarify sim_ss find_local make_toa_ssq bearings distances min_skip_matrix detection_timediffs detection_dists blockify find_incomplete_blocks

Documented in bearings distances secr_nll

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

find_incomplete_blocks <- function(mat) {
    .Call('_ascr_find_incomplete_blocks', PACKAGE = 'ascr', mat)
}

blockify <- function(block, reqss) {
    .Call('_ascr_blockify', PACKAGE = 'ascr', block, reqss)
}

detection_dists <- function(trap_dists, traps) {
    .Call('_ascr_detection_dists', PACKAGE = 'ascr', trap_dists, traps)
}

detection_timediffs <- function(times, traps) {
    .Call('_ascr_detection_timediffs', PACKAGE = 'ascr', times, traps)
}

min_skip_matrix <- function(skip, allocated) {
    .Call('_ascr_min_skip_matrix', PACKAGE = 'ascr', skip, allocated)
}

#' Calculating distances between two sets of points
#'
#' Calculates pairwise distances between two sets of points.
#'
#' @param a matrix containing a set of coordinates.
#' @param b matrix containing another set of coordinates.
#'
#' @return A matrix with pairwise distances between the two sets of points.
#'
#' @examples
#' dists <- distances(example.data$traps, example.data$mask)
#'
#' @export
distances <- function(a, b) {
    .Call('_ascr_distances', PACKAGE = 'ascr', a, b)
}

#' Calculating bearings between two sets of points
#'
#' Calculates the bearing from one set of points to another.
#'
#' @param a matrix containing a set of coordinates.
#' @param b matrix containing another set of coordinates.
#'
#' @return A matrix with bearings of the points in matrix b from the points in matrix a.
#'
#' @examples
#' bears <- bearings(example.data$traps, example.data$mask) 
#'
#' @export
bearings <- function(a, b) {
    .Call('_ascr_bearings', PACKAGE = 'ascr', a, b)
}

make_toa_ssq <- function(capt, dists, sound_speed) {
    .Call('_ascr_make_toa_ssq', PACKAGE = 'ascr', capt, dists, sound_speed)
}

find_local <- function(capt, dists, buffer) {
    .Call('_ascr_find_local', PACKAGE = 'ascr', capt, dists, buffer)
}

sim_ss <- function(ss_mean, sigma_ss, cutoff, freqs) {
    .Call('_ascr_sim_ss', PACKAGE = 'ascr', ss_mean, sigma_ss, cutoff, freqs)
}

squarify <- function(mask, D_mask) {
    .Call('_ascr_squarify', PACKAGE = 'ascr', mask, D_mask)
}

#' Evaluating the likelihood using C++
#'
#' Returns the likelihood for a vector of parameter values.
#'
#' @param link_pars Parameter values on link scale.
#' @param dat Data list.
#' @param get_esa Logical. If \code{TRUE} the effective sampling area is returned,
#'        otherwise the negative log-likelihood is returned.
#'
#' @return The value of the negative log-likelihood.
#'
secr_nll <- function(link_pars, dat, get_esa) {
    .Call('_ascr_secr_nll', PACKAGE = 'ascr', link_pars, dat, get_esa)
}

calc_probsurf <- function(link_pars, dat) {
    .Call('_ascr_calc_probsurf', PACKAGE = 'ascr', link_pars, dat)
}
b-steve/ascr documentation built on Aug. 15, 2022, 2:38 p.m.