8#ifndef POPULATION_DYNAMICS_AGE_SPECIFIC_SELECTIVITY_HPP
9#define POPULATION_DYNAMICS_AGE_SPECIFIC_SELECTIVITY_HPP
48template <
typename Type>
90 Type a =
static_cast<Type
>(0.0);
91 Type b =
static_cast<Type
>(1.0);
92 double x_temp = fims_math::Value(x);
93 size_t x_final =
static_cast<size_t>(x_temp);
94 size_t i_age = x_final -
min_age;
107 virtual const Type
evaluate(
const Type &x,
size_t pos) {
108 Type a =
static_cast<Type
>(0.0);
109 Type b =
static_cast<Type
>(1.0);
110 double x_temp = fims_math::Value(x);
111 size_t x_final =
static_cast<size_t>(x_temp);
112 size_t i_age = x_final -
min_age;
118 throw std::invalid_argument(
119 "AgeSpecificSelectivity: logit_sel_at_age has " +
120 std::to_string(n_values) +
" values, which is not 1 or a multiple " +
121 "of n_ages (" + std::to_string(
n_ages) +
").");
123 size_t i_value = (n_values ==
n_ages) ? i_age : pos *
n_ages + i_age;
Definition fims_vector.hpp:27
A collection of mathematical functions used in FIMS.
const Type inv_logit(const Type &a, const Type &b, const Type &logit_x)
An inverse logit function for bounding of parameters.
Definition fims_math.hpp:276
Establishes the FIMS Vector class.
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
Declares the SelectivityBase class which is the base class for all selectivity functors.
Age-specific selectivity calculated using one parameter per age bin.
Definition age_specific.hpp:49
size_t min_age
Minimum modeled age, used to map input age to logit_sel_at_age.
Definition age_specific.hpp:65
virtual const Type evaluate(const Type &x, size_t pos)
Calculates selectivity for an age using its age-specific parameter.
Definition age_specific.hpp:107
virtual const Type evaluate(const Type &x)
Calculates selectivity for an age using its age-specific parameter.
Definition age_specific.hpp:89
size_t n_ages
Stores the number of modeled age bins.
Definition age_specific.hpp:60
fims::Vector< Type > logit_sel_at_age
Stores the age-specific selectivity parameters on the logit scale.
Definition age_specific.hpp:55
SelectivityBase()
Constructor.
Definition selectivity_base.hpp:34