FIMS  v0.8.0
Loading...
Searching...
No Matches
double_logistic.hpp
Go to the documentation of this file.
1
9#ifndef POPULATION_DYNAMICS_SELECTIVITY_DOUBLE_LOGISTIC_HPP
10#define POPULATION_DYNAMICS_SELECTIVITY_DOUBLE_LOGISTIC_HPP
11
12// #include "../../../interface/interface.hpp"
13#include "../../../common/fims_math.hpp"
14#include "../../../common/fims_vector.hpp"
15#include "selectivity_base.hpp"
16
17namespace fims_popdy {
18
23template <typename Type>
39
41
53 virtual const Type evaluate(const Type& x) {
54 return fims_math::double_logistic<Type>(
56 slope_desc[0], x);
57 }
58
71 virtual const Type evaluate(const Type& x, size_t pos) {
72 return fims_math::double_logistic<Type>(
73 inflection_point_asc.get_force_scalar(pos),
74 slope_asc.get_force_scalar(pos),
75 inflection_point_desc.get_force_scalar(pos),
76 slope_desc.get_force_scalar(pos), x);
77 }
78
83 std::map<std::string, fims::Vector<fims::Vector<Type>>>& report_vectors) {
84 report_vectors["inflection_point_asc"].emplace_back(
85 inflection_point_asc.to_tmb());
86 report_vectors["slope_asc"].emplace_back(slope_asc.to_tmb());
87 report_vectors["inflection_point_desc"].emplace_back(
88 inflection_point_desc.to_tmb());
89 report_vectors["slope_desc"].emplace_back(slope_desc.to_tmb());
90 }
91
93 std::map<std::string, size_t>& report_vector_count) {
94 report_vector_count["inflection_point_asc"] += 1;
95 report_vector_count["slope_asc"] += 1;
96 report_vector_count["inflection_point_desc"] += 1;
97 report_vector_count["slope_desc"] += 1;
98 }
99};
100
101} // namespace fims_popdy
102
103#endif /* POPULATION_DYNAMICS_SELECTIVITY_DOUBLE_LOGISTIC_HPP */
Definition fims_vector.hpp:27
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:279
Declares the SelectivityBase class which is the base class for all selectivity functors.
DoubleLogisticSelectivity class that returns the double logistic function value from fims_math.
Definition double_logistic.hpp:24
virtual const Type evaluate(const Type &x, size_t pos)
Method of the double logistic selectivity class that implements the double logistic function from FIM...
Definition double_logistic.hpp:71
fims::Vector< Type > inflection_point_asc
Definition double_logistic.hpp:25
fims::Vector< Type > slope_asc
Definition double_logistic.hpp:28
fims::Vector< Type > slope_desc
Definition double_logistic.hpp:34
virtual void create_report_vectors(std::map< std::string, fims::Vector< fims::Vector< Type > > > &report_vectors)
Create a map of report vectors for the selectivity object.
Definition double_logistic.hpp:82
fims::Vector< Type > inflection_point_desc
Definition double_logistic.hpp:31
virtual const Type evaluate(const Type &x)
Method of the double logistic selectivity class that implements the double logistic function from FIM...
Definition double_logistic.hpp:53
virtual void get_report_vector_count(std::map< std::string, size_t > &report_vector_count)
Get the report vector count object. used to get the length of each report vector for populating the U...
Definition double_logistic.hpp:92
Base class for all selectivity functors.
Definition selectivity_base.hpp:24