diff --git a/include/pagmo/algorithms/cstrs_self_adaptive.hpp b/include/pagmo/algorithms/cstrs_self_adaptive.hpp index 576d9a684..2b1132ea9 100644 --- a/include/pagmo/algorithms/cstrs_self_adaptive.hpp +++ b/include/pagmo/algorithms/cstrs_self_adaptive.hpp @@ -96,6 +96,9 @@ struct PAGMO_DLL_PUBLIC penalized_udp { // The bounds are unchanged std::pair get_bounds() const; + // The integer dimension is unchanged + vector_double::size_type get_nix() const; + // The fitness computation vector_double fitness(const vector_double &) const; diff --git a/src/algorithms/cstrs_self_adaptive.cpp b/src/algorithms/cstrs_self_adaptive.cpp index d065d5571..cffebb75c 100644 --- a/src/algorithms/cstrs_self_adaptive.cpp +++ b/src/algorithms/cstrs_self_adaptive.cpp @@ -80,6 +80,12 @@ std::pair penalized_udp::get_bounds() const return m_pop_ptr->get_problem().get_bounds(); } +// The integer dimension is unchanged +vector_double::size_type penalized_udp::get_nix() const +{ + return m_pop_ptr->get_problem().get_nix(); +} + // The fitness computation vector_double penalized_udp::fitness(const vector_double &x) const { diff --git a/tests/cstrs_self_adaptive.cpp b/tests/cstrs_self_adaptive.cpp index 007f62e62..30a082198 100644 --- a/tests/cstrs_self_adaptive.cpp +++ b/tests/cstrs_self_adaptive.cpp @@ -65,6 +65,7 @@ BOOST_AUTO_TEST_CASE(penalized_problem_construction) BOOST_CHECK_EQUAL(udp_p.m_f_hat_down.size(), udp.get_nf()); BOOST_CHECK_EQUAL(udp_p.m_f_hat_up.size(), udp.get_nf()); BOOST_CHECK_EQUAL(udp_p.m_f_hat_round.size(), udp.get_nf()); + BOOST_CHECK_EQUAL(udp_p.get_nix(), udp.get_nix()); BOOST_CHECK_EQUAL(udp_p.m_fitness_map.size(), NP); // We also test get bounds here BOOST_CHECK(udp_p.get_bounds() == udp.get_bounds());