FIMS  v0.10.0
Loading...
Searching...
No Matches
fims_popdy::SizeProducts< Type > Struct Template Reference

Cached population-level size outputs on a biological size grid. More...

#include <size_products.hpp>

Public Member Functions

 SizeProducts ()
 Default constructor.
 
 SizeProducts (std::size_t years, std::size_t ages, std::size_t size_bins)
 Construct and size the size-product container.
 
void Resize (std::size_t years, std::size_t ages, std::size_t size_bins)
 Resize all cached product arrays.
 
void ResizeProbSizeOnly (std::size_t years, std::size_t ages, std::size_t size_bins)
 Resize only the cached age-to-size probability array.
 
std::size_t AgeYearIndex (std::size_t year_index, std::size_t age_index) const
 Return the flattened index for year-age products.
 
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.
 
Type & MeanLAA (std::size_t year_index, std::size_t age_index)
 Access mean length-at-age.
 
Type & SdLAA (std::size_t year_index, std::size_t age_index)
 Access spread of length-at-age.
 
Type & ProbSize (std::size_t year_index, std::size_t age_index, std::size_t size_bin_index)
 Access age-to-size probability.
 
const Type & MeanLAA (std::size_t year_index, std::size_t age_index) const
 Read mean length-at-age.
 
const Type & SdLAA (std::size_t year_index, std::size_t age_index) const
 Read spread of length-at-age.
 
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.
 

Public Attributes

std::size_t n_years = 0
 
std::size_t n_ages = 0
 
std::size_t n_size_bins
 
fims::Vector< Type > mean_LAA
 
fims::Vector< Type > sd_LAA
 
fims::Vector< Type > prob_size
 

Detailed Description

template<typename Type>
struct fims_popdy::SizeProducts< Type >

Cached population-level size outputs on a biological size grid.

This container can be used by a size provider to store prepared size-related outputs for a pooled population, including mean length-at-age, spread-at-age, and age-to-size probabilities on the internal biological size grid.

Template Parameters
TypeNumeric type used for cached values.

Constructor & Destructor Documentation

◆ SizeProducts()

template<typename Type >
fims_popdy::SizeProducts< Type >::SizeProducts ( std::size_t  years,
std::size_t  ages,
std::size_t  size_bins 
)
inline

Construct and size the size-product container.

Parameters
yearsNumber of modeled years.
agesNumber of modeled ages.
size_binsNumber of biological size bins.

Member Function Documentation

◆ AgeYearIndex()

template<typename Type >
std::size_t fims_popdy::SizeProducts< Type >::AgeYearIndex ( std::size_t  year_index,
std::size_t  age_index 
) const
inline

Return the flattened index for year-age products.

Parameters
year_indexYear index.
age_indexAge index.
Returns
Flattened year-age index.

◆ AgeYearSizeIndex()

template<typename Type >
std::size_t fims_popdy::SizeProducts< Type >::AgeYearSizeIndex ( std::size_t  year_index,
std::size_t  age_index,
std::size_t  size_bin_index 
) const
inline

Return the flattened index for year-age-size-bin probabilities.

Parameters
year_indexYear index.
age_indexAge index.
size_bin_indexSize-bin index.
Returns
Flattened year-age-size-bin index.

◆ MeanLAA() [1/2]

template<typename Type >
Type & fims_popdy::SizeProducts< Type >::MeanLAA ( std::size_t  year_index,
std::size_t  age_index 
)
inline

Access mean length-at-age.

Parameters
year_indexYear index.
age_indexAge index.
Returns
Reference to mean length-at-age.

◆ MeanLAA() [2/2]

template<typename Type >
const Type & fims_popdy::SizeProducts< Type >::MeanLAA ( std::size_t  year_index,
std::size_t  age_index 
) const
inline

Read mean length-at-age.

Parameters
year_indexYear index.
age_indexAge index.
Returns
Const reference to mean length-at-age.

◆ ProbSize() [1/2]

template<typename Type >
Type & fims_popdy::SizeProducts< Type >::ProbSize ( std::size_t  year_index,
std::size_t  age_index,
std::size_t  size_bin_index 
)
inline

Access age-to-size probability.

Parameters
year_indexYear index.
age_indexAge index.
size_bin_indexSize-bin index.
Returns
Reference to age-to-size probability.

◆ ProbSize() [2/2]

template<typename Type >
const Type & fims_popdy::SizeProducts< Type >::ProbSize ( std::size_t  year_index,
std::size_t  age_index,
std::size_t  size_bin_index 
) const
inline

Read age-to-size probability.

Parameters
year_indexYear index.
age_indexAge index.
size_bin_indexSize-bin index.
Returns
Const reference to age-to-size probability.

◆ Resize()

template<typename Type >
void fims_popdy::SizeProducts< Type >::Resize ( std::size_t  years,
std::size_t  ages,
std::size_t  size_bins 
)
inline

Resize all cached product arrays.

Parameters
yearsNumber of modeled years.
agesNumber of modeled ages.
size_binsNumber of biological size bins.

◆ ResizeProbSizeOnly()

template<typename Type >
void fims_popdy::SizeProducts< Type >::ResizeProbSizeOnly ( std::size_t  years,
std::size_t  ages,
std::size_t  size_bins 
)
inline

Resize only the cached age-to-size probability array.

Parameters
yearsNumber of modeled years.
agesNumber of modeled ages.
size_binsNumber of biological size bins.

This is used by providers that read MeanLAA and SdLAA from upstream growth products and only own ProbSize locally.

◆ SdLAA() [1/2]

template<typename Type >
Type & fims_popdy::SizeProducts< Type >::SdLAA ( std::size_t  year_index,
std::size_t  age_index 
)
inline

Access spread of length-at-age.

Parameters
year_indexYear index.
age_indexAge index.
Returns
Reference to spread of length-at-age.

◆ SdLAA() [2/2]

template<typename Type >
const Type & fims_popdy::SizeProducts< Type >::SdLAA ( std::size_t  year_index,
std::size_t  age_index 
) const
inline

Read spread of length-at-age.

Parameters
year_indexYear index.
age_indexAge index.
Returns
Const reference to spread of length-at-age.

Member Data Documentation

◆ mean_LAA

mean length-at-age on the natural scale

◆ n_ages

template<typename Type >
std::size_t fims_popdy::SizeProducts< Type >::n_ages = 0

number of modeled ages represented

◆ n_size_bins

template<typename Type >
std::size_t fims_popdy::SizeProducts< Type >::n_size_bins
Initial value:
=
0

number of biological size bins represented

◆ n_years

template<typename Type >
std::size_t fims_popdy::SizeProducts< Type >::n_years = 0

number of modeled years represented

◆ prob_size

age-to-size probabilities on the biological size grid

◆ sd_LAA

spread of length-at-age on the natural scale


The documentation for this struct was generated from the following file: