|
| 1 | +/** |
| 2 | + * @file delta_bar_detla_test.cpp |
| 3 | + * @author Ranjodh Singh |
| 4 | + * |
| 5 | + * ensmallen is free software; you may redistribute it and/or modify it under |
| 6 | + * the terms of the 3-clause BSD license. You should have received a copy of |
| 7 | + * the 3-clause BSD license along with ensmallen. If not, see |
| 8 | + * http://www.opensource.org/licenses/BSD-3-Clause for more information. |
| 9 | + */ |
| 10 | +#if defined(ENS_USE_COOT) |
| 11 | + #include <armadillo> |
| 12 | + #include <bandicoot> |
| 13 | +#endif |
| 14 | +#include <ensmallen.hpp> |
| 15 | +#include "catch.hpp" |
| 16 | +#include "test_function_tools.hpp" |
| 17 | + |
| 18 | +using namespace ens; |
| 19 | +using namespace ens::test; |
| 20 | + |
| 21 | +TEMPLATE_TEST_CASE("DeltaBarDelta_GDTestFunction", "[DeltaBarDelta]", |
| 22 | + arma::mat, arma::fmat) |
| 23 | +{ |
| 24 | + DeltaBarDelta s(0.01, 500, 1e-9); |
| 25 | + FunctionTest<GDTestFunction, TestType>(s, 0.1, 0.01); |
| 26 | +} |
| 27 | + |
| 28 | +TEMPLATE_TEST_CASE("DeltaBarDelta_RosenbrockFunction", "[DeltaBarDelta]", |
| 29 | + arma::mat, arma::fmat) |
| 30 | +{ |
| 31 | + DeltaBarDelta s(0.001, 0, 1e-15); |
| 32 | + FunctionTest<RosenbrockFunction, TestType>(s, 0.01, 0.001); |
| 33 | +} |
| 34 | + |
| 35 | +#ifdef ENS_HAVE_COOT |
| 36 | + |
| 37 | +TEMPLATE_TEST_CASE("DeltaBarDelta_GDTestFunction", "[DeltaBarDelta]", |
| 38 | + coot::mat, coot::fmat) |
| 39 | +{ |
| 40 | + DeltaBarDelta s(0.01, 500, 1e-9); |
| 41 | + FunctionTest<GDTestFunction, TestType>(s, 0.1, 0.01); |
| 42 | +} |
| 43 | + |
| 44 | +TEMPLATE_TEST_CASE("DeltaBarDelta_RosenbrockFunction", "[DeltaBarDelta]", |
| 45 | + coot::mat, coot::fmat) |
| 46 | +{ |
| 47 | + DeltaBarDelta s(0.001, 0, 1e-15); |
| 48 | + FunctionTest<RosenbrockFunction, TestType>(s, 0.01, 0.001); |
| 49 | +} |
| 50 | + |
| 51 | +#endif |
0 commit comments