10#ifndef POPULATION_DYNAMICS_GROWTH_PRODUCTS_HPP
11#define POPULATION_DYNAMICS_GROWTH_PRODUCTS_HPP
25template <
typename Type>
47 Resize(years, ages, sexes);
56 void Resize(std::size_t years, std::size_t ages, std::size_t sexes) {
63 mean_LAA.assign(n,
static_cast<Type
>(0));
64 sd_LAA.assign(n,
static_cast<Type
>(0));
65 mean_WAA.assign(n,
static_cast<Type
>(0));
75 inline std::size_t
Index(std::size_t y, std::size_t a, std::size_t s)
const {
78 throw std::out_of_range(
"GrowthProducts index out of range");
90 inline Type&
MeanLAA(std::size_t y, std::size_t a, std::size_t s) {
101 inline Type&
SdLAA(std::size_t y, std::size_t a, std::size_t s) {
112 inline Type&
MeanWAA(std::size_t y, std::size_t a, std::size_t s) {
123 inline const Type&
MeanLAA(std::size_t y, std::size_t a,
124 std::size_t s)
const {
135 inline const Type&
SdLAA(std::size_t y, std::size_t a, std::size_t s)
const {
146 inline const Type&
MeanWAA(std::size_t y, std::size_t a,
147 std::size_t s)
const {
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
GrowthProducts()=default
Construct an empty growth-product container.
std::size_t Index(std::size_t y, std::size_t a, std::size_t s) const
Convert a (year, age, sex) triple into the contiguous storage index.
Definition growth_products.hpp:75
GrowthProducts(std::size_t years, std::size_t ages, std::size_t sexes)
Construct and size the growth-product container.
Definition growth_products.hpp:46
Type & MeanLAA(std::size_t y, std::size_t a, std::size_t s)
Access mean length-at-age by reference.
Definition growth_products.hpp:90
const Type & MeanWAA(std::size_t y, std::size_t a, std::size_t s) const
Access mean weight-at-age as a const reference.
Definition growth_products.hpp:146
std::size_t Size() const
Return the total number of cached cells.
Definition growth_products.hpp:155
void Resize(std::size_t years, std::size_t ages, std::size_t sexes)
Resize all cached product arrays.
Definition growth_products.hpp:56
std::vector< Type > mean_LAA
Definition growth_products.hpp:31
const Type & SdLAA(std::size_t y, std::size_t a, std::size_t s) const
Access standard deviation of length-at-age as a const reference.
Definition growth_products.hpp:135
std::size_t n_years
Definition growth_products.hpp:27
Type & MeanWAA(std::size_t y, std::size_t a, std::size_t s)
Access mean weight-at-age by reference.
Definition growth_products.hpp:112
const Type & MeanLAA(std::size_t y, std::size_t a, std::size_t s) const
Access mean length-at-age as a const reference.
Definition growth_products.hpp:123
Type & SdLAA(std::size_t y, std::size_t a, std::size_t s)
Access standard deviation of length-at-age by reference.
Definition growth_products.hpp:101
std::size_t n_sexes
Definition growth_products.hpp:29
std::size_t n_ages
Definition growth_products.hpp:28
std::vector< Type > sd_LAA
Definition growth_products.hpp:32
std::vector< Type > mean_WAA
Definition growth_products.hpp:33