Skip to content

Commit aa99ac9

Browse files
committed
Fix test build of nlopt algo
1 parent 86e7bc1 commit aa99ac9

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

tests/nlopt.cpp

-31
Original file line numberDiff line numberDiff line change
@@ -381,34 +381,3 @@ BOOST_AUTO_TEST_CASE(nlopt_loc_opt)
381381
algo.evolve(pop);
382382
BOOST_CHECK(algo.extract<nlopt>()->get_last_opt_result() >= 0);
383383
}
384-
385-
BOOST_AUTO_TEST_CASE(nlopt_initial_population_not_respecting_bounds_throw_test)
386-
{
387-
// We test that the algorithm throws if the initial population does not respect the bounds
388-
auto pop = population{hs71{}, 1};
389-
auto a = nlopt{"slsqp"};
390-
auto dv = pop.get_x()[0];
391-
dv[0] = prob.get_bounds().first[0] - 1.;
392-
pop.set_x(0, dv);
393-
BOOST_CHECK_THROW(nlopt.evolve(pop), std::invalid_argument);
394-
395-
dv = pop.get_x()[0];
396-
dv[0] = prob.get_bounds().second[0] + 2.;
397-
pop.set_x(0, dv);
398-
BOOST_CHECK_THROW(nlopt.evolve(pop), std::invalid_argument);
399-
400-
dv = pop.get_x()[0];
401-
dv[0] = std::numeric_limits<double>::quiet_NaN();
402-
pop.set_x(0, dv);
403-
BOOST_CHECK_THROW(nlopt.evolve(pop), std::invalid_argument);
404-
405-
dv = pop.get_x()[0];
406-
dv[0] = std::numeric_limits<double>::infinity();
407-
pop.set_x(0, dv);
408-
BOOST_CHECK_THROW(nlopt.evolve(pop), std::invalid_argument);
409-
410-
dv = pop.get_x()[0];
411-
dv[0] = prob.get_bounds().first[0] + prob.get_bounds().second[0] / 2.0;
412-
pop.set_x(0, dv);
413-
BOOST_CHECK_NO_THROW(nlopt.evolve(pop));
414-
}

0 commit comments

Comments
 (0)