FIMS  v0.9.3
Loading...
Searching...
No Matches
logistic.hpp
Go to the documentation of this file.
1
9#ifndef POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP
10#define POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP
11
12#include "common/fims_math.hpp"
14#include "selectivity_base.hpp"
15
16namespace fims_popdy {
17
28template <typename Type>
29struct LogisticSelectivity : public SelectivityBase<Type> {
39
40 virtual ~LogisticSelectivity() {}
41
56 virtual const Type evaluate(const Type &x) {
57 return fims_math::logistic<Type>(inflection_point[0], slope[0], x);
58 }
59
66 virtual const Type evaluate(const Type &x, size_t pos) {
67 return fims_math::logistic<Type>(inflection_point.get_force_scalar(pos),
68 slope.get_force_scalar(pos), x);
69 }
70};
71
72} // namespace fims_popdy
73
74#endif /* POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP */
Definition fims_vector.hpp:27
A collection of mathematical functions used in FIMS.
Establishes the FIMS Vector class.
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:235
Declares the SelectivityBase class which is the base class for all selectivity functors.
LogisticSelectivity class that returns the logistic function value from fims_math.
Definition logistic.hpp:29
fims::Vector< Type > slope
Definition logistic.hpp:33
virtual const Type evaluate(const Type &x)
Method of the logistic selectivity class that implements the logistic function from FIMS math.
Definition logistic.hpp:56
virtual const Type evaluate(const Type &x, size_t pos)
Method of the logistic selectivity class that implements the logistic function from FIMS math.
Definition logistic.hpp:66
fims::Vector< Type > inflection_point
Definition logistic.hpp:31
Base class for all selectivity functors.
Definition selectivity_base.hpp:24