9#ifndef FIMS_POPULATION_DYNAMICS_SIZE_PRODUCTS_HPP
10#define FIMS_POPULATION_DYNAMICS_SIZE_PRODUCTS_HPP
29template <
typename Type>
53 SizeProducts(std::size_t years, std::size_t ages, std::size_t size_bins) {
54 Resize(years, ages, size_bins);
63 void Resize(std::size_t years, std::size_t ages, std::size_t size_bins) {
86 std::size_t size_bins) {
105 std::size_t age_index)
const {
107 throw std::out_of_range(
"SizeProducts year-age index out of range");
110 return year_index *
n_ages + age_index;
121 std::size_t age_index,
122 std::size_t size_bin_index)
const {
125 throw std::out_of_range(
"SizeProducts year-age-size index out of range");
138 inline Type&
MeanLAA(std::size_t year_index, std::size_t age_index) {
148 inline Type&
SdLAA(std::size_t year_index, std::size_t age_index) {
159 inline Type&
ProbSize(std::size_t year_index, std::size_t age_index,
160 std::size_t size_bin_index) {
170 inline const Type&
MeanLAA(std::size_t year_index,
171 std::size_t age_index)
const {
181 inline const Type&
SdLAA(std::size_t year_index,
182 std::size_t age_index)
const {
193 inline const Type&
ProbSize(std::size_t year_index, std::size_t age_index,
194 std::size_t size_bin_index)
const {
Definition fims_vector.hpp:27
Establishes the FIMS Vector class.
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
const Type & MeanLAA(std::size_t year_index, std::size_t age_index) const
Read mean length-at-age.
Definition size_products.hpp:170
Type & MeanLAA(std::size_t year_index, std::size_t age_index)
Access mean length-at-age.
Definition size_products.hpp:138
std::size_t AgeYearIndex(std::size_t year_index, std::size_t age_index) const
Return the flattened index for year-age products.
Definition size_products.hpp:104
fims::Vector< Type > mean_LAA
Definition size_products.hpp:36
std::size_t n_ages
Definition size_products.hpp:32
std::size_t AgeYearSizeIndex(std::size_t year_index, std::size_t age_index, std::size_t size_bin_index) const
Return the flattened index for year-age-size-bin probabilities.
Definition size_products.hpp:120
void Resize(std::size_t years, std::size_t ages, std::size_t size_bins)
Resize all cached product arrays.
Definition size_products.hpp:63
const Type & ProbSize(std::size_t year_index, std::size_t age_index, std::size_t size_bin_index) const
Read age-to-size probability.
Definition size_products.hpp:193
void ResizeProbSizeOnly(std::size_t years, std::size_t ages, std::size_t size_bins)
Resize only the cached age-to-size probability array.
Definition size_products.hpp:85
SizeProducts(std::size_t years, std::size_t ages, std::size_t size_bins)
Construct and size the size-product container.
Definition size_products.hpp:53
std::size_t n_years
Definition size_products.hpp:31
std::size_t n_size_bins
Definition size_products.hpp:33
fims::Vector< Type > sd_LAA
Definition size_products.hpp:38
SizeProducts()
Default constructor.
Definition size_products.hpp:45
Type & ProbSize(std::size_t year_index, std::size_t age_index, std::size_t size_bin_index)
Access age-to-size probability.
Definition size_products.hpp:159
Type & SdLAA(std::size_t year_index, std::size_t age_index)
Access spread of length-at-age.
Definition size_products.hpp:148
fims::Vector< Type > prob_size
Definition size_products.hpp:40
const Type & SdLAA(std::size_t year_index, std::size_t age_index) const
Read spread of length-at-age.
Definition size_products.hpp:181