R/RcppExports.R

Defines functions aibin_cpp

Documented in aibin_cpp

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

#' Calculate bin value (Vb)
#'
#' @param bin A matrix containing the whole spectral range.
#'   Cols 0-2  are : bins, bin_start, bin_end, then come samples (col-wise)
#' @param r resolution
#' @param noise noise value
#' @param left,right index of bin_end for the current bin
#'   (C++ index 0 to length-1). 
#' @returns A dbl, the bin value
#' @keywords internal
NULL

#' Find a new division splitting position for the current bin
#'
#' @param bin A matrix containing the whole spectral range.
#'   Cols 0-2  are : bins, bin_start, bin_end, then come samples (col-wise)
#' @param r resolution
#' @param noise noise value
#' @param left,right index of bin_end for the current bin
#'   (C++ index 0 to length-1). 
#' @returns A dbl, the new optimal splitting position or 
#'   NAN if not splitting is possible
#' @keywords internal
NULL

#' Reccursively split the bin 
#'
#' @param bin A matrix containing the whole spectral range.
#'   Cols 0-2  are : bins, bin_start, bin_end, then come samples (col-wise)
#' @param r resolution
#' @param noise noise value
#' @param left,right index of bin_end for the current bin
#'   (C++ index 0 to length-1). 
#' @param indices storage of splitting indices, should be initializied with `right`.
#' @returns A vector of splitting indices 
#' @keywords internal
NULL

#' Bucket a spectral region. 
#'
#' @param bin A matrix containing the whole spectral range.
#'   Cols 0-2  are : bins, bin_start, bin_end, then come samples (col-wise)
#' @param r resolution
#' @returns A vector of splitting indices 
#' @keywords internal
NULL

#' Adaptive Intelligent Binning Algorithm
#'
#' Entry point from R for the C++ implementation
#'
#' @param spectra, noise A mtrix containing spectra or nosie regions.
#'   Cols 0-2  are : bins, bin_start, bin_end, then come samples (col-wise)
#' @param R resolution (0>R>=1)
#' @returns vector of integers containing the split indices.
#' @keywords internal
aibin_cpp <- function(spectra, noise, r, snr) {
    .Call(`_tidySpectR_aibin_cpp`, spectra, noise, r, snr)
}
CVUA-RRW/tidySpectR documentation built on April 13, 2021, 11:41 a.m.