diff --git a/cpptests/test_site_dependent_genetic_value.cc b/cpptests/test_site_dependent_genetic_value.cc index a7ca3514e..5d0e76ef8 100644 --- a/cpptests/test_site_dependent_genetic_value.cc +++ b/cpptests/test_site_dependent_genetic_value.cc @@ -201,7 +201,7 @@ BOOST_FIXTURE_TEST_CASE(test_multiplicative_fitness_1, Fwdpy11Pop) BOOST_REQUIRE(offspring_metadata[0].w > 0.0); // we now pass in this correct lambda expression - m = fwdpy11::multiplicative_fitness_model(1, 2., nullptr, nullptr); + m = fwdpy11::multiplicative_fitness_model(1, 2., nullptr); m(data); BOOST_REQUIRE_EQUAL(offspring_metadata[0].g, 0.); BOOST_REQUIRE_EQUAL(offspring_metadata[0].w, 0.); diff --git a/fwdpy11/headers/fwdpy11/genetic_values/DiploidAdditive.hpp b/fwdpy11/headers/fwdpy11/genetic_values/DiploidAdditive.hpp index 3ca418212..134a44859 100644 --- a/fwdpy11/headers/fwdpy11/genetic_values/DiploidAdditive.hpp +++ b/fwdpy11/headers/fwdpy11/genetic_values/DiploidAdditive.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include "fwdpp_wrappers/fwdpp_genetic_value.hpp" namespace fwdpy11 @@ -73,4 +74,23 @@ namespace fwdpy11 single_deme_additive_het, single_deme_additive_hom, multi_deme_additive_het, multi_deme_additive_hom, 0>; + inline DiploidAdditive + additive_fitness_model(std::size_t ndemes, double scaling, + const GeneticValueNoise* noise) + { + return DiploidAdditive( + ndemes, scaling, final_additive_fitness(), + [](const double) { return false; }, nullptr, noise); + } + + inline DiploidAdditive + additive_trait_model(std::size_t ndemes, double scaling, + const GeneticValueIsTrait* gvalue_to_fitness, + const GeneticValueNoise* noise) + { + return DiploidAdditive( + ndemes, scaling, final_additive_trait(), [](const double) { return false; }, + gvalue_to_fitness, noise); + } + } diff --git a/fwdpy11/headers/fwdpy11/genetic_values/DiploidMultiplicative.hpp b/fwdpy11/headers/fwdpy11/genetic_values/DiploidMultiplicative.hpp index 27bae186f..c0bb4416f 100644 --- a/fwdpy11/headers/fwdpy11/genetic_values/DiploidMultiplicative.hpp +++ b/fwdpy11/headers/fwdpy11/genetic_values/DiploidMultiplicative.hpp @@ -77,12 +77,11 @@ namespace fwdpy11 inline DiploidMultiplicative multiplicative_fitness_model(std::size_t ndemes, double scaling, - const GeneticValueIsTrait* gvalue_to_fitness, const GeneticValueNoise* noise) { return DiploidMultiplicative( ndemes, scaling, final_multiplicative_fitness(), - [](const double w) { return w <= 0.0; }, gvalue_to_fitness, noise); + [](const double w) { return w <= 0.0; }, nullptr, noise); } inline DiploidMultiplicative