Branch data Line data Source code
1 : : // ***************************************************************************** 2 : : /*! 3 : : \file src/DiffEq/WrightFisher/WrightFisherCoeffPolicy.hpp 4 : : \copyright 2012-2015 J. Bakosi, 5 : : 2016-2018 Los Alamos National Security, LLC., 6 : : 2019-2021 Triad National Security, LLC. 7 : : All rights reserved. See the LICENSE file for details. 8 : : \brief Wright-Fisher coefficients policies 9 : : \details This file defines coefficients policy classes for the Wright-Fisher 10 : : SDE, defined in DiffEq/WrightFisher.h. 11 : : 12 : : General requirements on the Wright-Fisher SDE coefficients policy classes: 13 : : 14 : : - Must define a _constructor_, which is used to initialize the SDE 15 : : coefficient vector, omega. Required signature: 16 : : \code{.cpp} 17 : : CoeffPolicyName( 18 : : tk::ctr::ncomp_t ncomp, 19 : : const std::vector< kw::sde_omega::info::expect::type >& omega_, 20 : : std::vector< kw::sde_omega::info::expect::type >& omega ) 21 : : \endcode 22 : : where 23 : : - ncomp denotes the number of scalar components of the system of the 24 : : Wright-Fisher SDE. 25 : : - Constant references to omega_ which denote a vector of real values used 26 : : to initialize the parameter vector of the Wright-Fisher SDE. The length 27 : : of the vector must be equal to the number of components given by ncomp. 28 : : - Reference to omega which denote the parameter vector to be initialized 29 : : based on omega_. 30 : : 31 : : - Must define the static function _type()_, returning the enum value of the 32 : : policy option. Example: 33 : : \code{.cpp} 34 : : static ctr::CoeffPolicyType type() noexcept { 35 : : return ctr::CoeffPolicyType::CONST_COEFF; 36 : : } 37 : : \endcode 38 : : which returns the enum value of the option from the underlying option 39 : : class, collecting all possible options for coefficients policies. 40 : : */ 41 : : // ***************************************************************************** 42 : : #ifndef WrightFisherCoeffPolicy_h 43 : : #define WrightFisherCoeffPolicy_h 44 : : 45 : : #include <brigand/sequences/list.hpp> 46 : : 47 : : #include "Types.hpp" 48 : : #include "Walker/Options/CoeffPolicy.hpp" 49 : : #include "SystemComponents.hpp" 50 : : 51 : : namespace walker { 52 : : 53 : : //! Wright-Fisher constant coefficients policity: constants in time 54 : : class WrightFisherCoeffConst { 55 : : 56 : : public: 57 : : //! Constructor: initialize coefficients 58 : : WrightFisherCoeffConst( 59 : : tk::ctr::ncomp_t ncomp, 60 : : const std::vector< kw::sde_omega::info::expect::type >& omega_, 61 : : std::vector< kw::sde_omega::info::expect::type >& omega ); 62 : : 63 : 2584 : static ctr::CoeffPolicyType type() noexcept 64 : 2584 : { return ctr::CoeffPolicyType::CONST_COEFF; } 65 : : }; 66 : : 67 : : //! List of all Wright-Fisher's coefficients policies 68 : : using WrightFisherCoeffPolicies = brigand::list< WrightFisherCoeffConst >; 69 : : 70 : : } // walker:: 71 : : 72 : : #endif // WrightFisherCoeffPolicy_h