FIMS  v0.11.0
Loading...
Searching...
No Matches
fims_popdy::GrowthProducts< Type > Struct Template Reference

Growth "products" in a consistent (year, age, sex) space. More...

#include <growth_products.hpp>

Public Member Functions

 GrowthProducts ()=default
 Construct an empty growth-product container.
 GrowthProducts (std::size_t years, std::size_t ages, std::size_t sexes)
 Construct and size the growth-product container.
void Resize (std::size_t years, std::size_t ages, std::size_t sexes)
 Resize all cached product arrays.
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.
Type & MeanLAA (std::size_t y, std::size_t a, std::size_t s)
 Access mean length-at-age by reference.
Type & SdLAA (std::size_t y, std::size_t a, std::size_t s)
 Access standard deviation of length-at-age by reference.
Type & MeanWAA (std::size_t y, std::size_t a, std::size_t s)
 Access mean weight-at-age by reference.
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.
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.
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.
std::size_t Size () const
 Return the total number of cached cells.

Public Attributes

std::size_t n_years = 0
std::size_t n_ages = 0
std::size_t n_sexes = 0
std::vector< Type > mean_LAA
std::vector< Type > sd_LAA
std::vector< Type > mean_WAA

Detailed Description

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

Growth "products" in a consistent (year, age, sex) space.

Storage is contiguous in row-major order: idx = ((y * n_ages + a) * n_sexes + s)

Constructor & Destructor Documentation

◆ GrowthProducts()

template<typename Type>
fims_popdy::GrowthProducts< Type >::GrowthProducts ( std::size_t years,
std::size_t ages,
std::size_t sexes )
inline

Construct and size the growth-product container.

Parameters
yearsNumber of years.
agesNumber of ages.
sexesNumber of sexes.

Member Function Documentation

◆ Index()

template<typename Type>
std::size_t fims_popdy::GrowthProducts< Type >::Index ( std::size_t y,
std::size_t a,
std::size_t s ) const
inline

Convert a (year, age, sex) triple into the contiguous storage index.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Flattened storage index.

◆ MeanLAA() [1/2]

template<typename Type>
Type & fims_popdy::GrowthProducts< Type >::MeanLAA ( std::size_t y,
std::size_t a,
std::size_t s )
inline

Access mean length-at-age by reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Mutable reference to the requested value.

◆ MeanLAA() [2/2]

template<typename Type>
const Type & fims_popdy::GrowthProducts< Type >::MeanLAA ( std::size_t y,
std::size_t a,
std::size_t s ) const
inline

Access mean length-at-age as a const reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Const reference to the requested value.

◆ MeanWAA() [1/2]

template<typename Type>
Type & fims_popdy::GrowthProducts< Type >::MeanWAA ( std::size_t y,
std::size_t a,
std::size_t s )
inline

Access mean weight-at-age by reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Mutable reference to the requested value.

◆ MeanWAA() [2/2]

template<typename Type>
const Type & fims_popdy::GrowthProducts< Type >::MeanWAA ( std::size_t y,
std::size_t a,
std::size_t s ) const
inline

Access mean weight-at-age as a const reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Const reference to the requested value.

◆ Resize()

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

Resize all cached product arrays.

Parameters
yearsNumber of years.
agesNumber of ages.
sexesNumber of sexes.

◆ SdLAA() [1/2]

template<typename Type>
Type & fims_popdy::GrowthProducts< Type >::SdLAA ( std::size_t y,
std::size_t a,
std::size_t s )
inline

Access standard deviation of length-at-age by reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Mutable reference to the requested value.

◆ SdLAA() [2/2]

template<typename Type>
const Type & fims_popdy::GrowthProducts< Type >::SdLAA ( std::size_t y,
std::size_t a,
std::size_t s ) const
inline

Access standard deviation of length-at-age as a const reference.

Parameters
yYear index.
aAge index.
sSex index.
Returns
Const reference to the requested value.

◆ Size()

template<typename Type>
std::size_t fims_popdy::GrowthProducts< Type >::Size ( ) const
inline

Return the total number of cached cells.

Returns
Total element count of the cached vectors.

Member Data Documentation

◆ mean_LAA

template<typename Type>
std::vector<Type> fims_popdy::GrowthProducts< Type >::mean_LAA

mean length-at-age values

◆ mean_WAA

template<typename Type>
std::vector<Type> fims_popdy::GrowthProducts< Type >::mean_WAA

mean weight-at-age values

◆ n_ages

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

number of ages represented

◆ n_sexes

template<typename Type>
std::size_t fims_popdy::GrowthProducts< Type >::n_sexes = 0

number of sexes represented

◆ n_years

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

number of years represented

◆ sd_LAA

template<typename Type>
std::vector<Type> fims_popdy::GrowthProducts< Type >::sd_LAA

standard deviation of length-at-age values


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