R/RcppExports.R

Defines functions ExBC SpBC bhC fishNAAC makebiomC

Documented in bhC ExBC fishNAAC makebiomC SpBC

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

#' @title makebiomC runs the surplus production model inside catch-MSY.
#' 
#' @description runs the surplus production model inside catch-MSY. This is 
#'     written in C++ because it contains two for-loops the whole of which is
#'     run for however many iterations are used. Without using C++ the process
#'     can take 15 minutes rather than 20 seconds. This function is only called
#'     inside sraMSY, which is another function that did not strictly need to 
#'     be exported to the public gaze.
#'
#' @param intheta the vector of parameters for the spm and the biomass
#' @param bd the intial biomass depletion vector
#' @param ct the vector of catches leading to the stock reduction
makebiomC <- function(intheta, bd, ct) {
    .Call('_datalowSA_makebiomC', PACKAGE = 'datalowSA', intheta, bd, ct)
}

#' @title fishNAAC numbers-at-age dynamics using Rcpp.
#' 
#' @description conducts the number-at-age dynamics for use within the
#'     the age-structured production model.
#'
#' @param nyr is literally the number of years of dynamics being run.
#' @param maxa is the maximum age
#' @param hS is half the natural survivorship exp(-M/2)
#' @param hrate is the fully selected annual harvest rate
#' @param glob is a vector of parameters of length at least 3:
#'     index 0 = steepness, 1=B0, 2=R0, 
#' @param maa is the maturity-at-age
#' @param waa is the weight-at-age
#' @param sela is the selectivity-at-age
#' @param Nt is thge numbers at age at time t
#' 
#' @export
fishNAAC <- function(nyr, maxa, hS, hrate, glob, maa, waa, sela, Nt) {
    .Call('_datalowSA_fishNAAC', PACKAGE = 'datalowSA', nyr, maxa, hS, hrate, glob, maa, waa, sela, Nt)
}

#' @title bh calculates the expected Beverton-Holt recruitment
#'
#' @description bh calculate the expected Beverton-Holt stock recruitment 
#'     level from the available spawning biomass, the steepness, R0 and B0.
#'     This would be used when fitting a model to data. 
#'
#' @param SPB the current spawning or mature biomass
#' @param steep the steepness of the Beverton-Holt stock recruitment curve
#' @param R0 the unfished average recruitment level
#' @param B0 the unfished spawning biomass.
#' @export
bhC <- function(SPB, steep, R0, B0) {
    .Call('_datalowSA_bhC', PACKAGE = 'datalowSA', SPB, steep, R0, B0)
}

#' @title SpBC calculate spawning biomass from a vector of numbers-at-age
#'
#' @description SpBC calculates the spawning biomass from a vector of
#'     numbers-at-age, Maturity-at-age, and Weight-at-age.
#'
#' @param Nt the numbers-at-age as a vector
#' @param MatA maturity at age vector
#' @param WghtA weight at age vector as kilograms
#' @export
SpBC <- function(Nt, MatA, WghtA) {
    .Call('_datalowSA_SpBC', PACKAGE = 'datalowSA', Nt, MatA, WghtA)
}

#' @title ExBC calculate exploitable biomass 
#'
#' @description ExBC calculates the exploitable biomass from a vector of
#'     numbers-at-age, selectivity-at-age, and Weight-at-age.
#'
#' @param Nt the numbers-at-age as a vector
#' @param Sel the selectivity-at-age vector
#' @param WghtA weight at age vector as kilograms
#' @export
ExBC <- function(Nt, Sel, WghtA) {
    .Call('_datalowSA_ExBC', PACKAGE = 'datalowSA', Nt, Sel, WghtA)
}
haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.