| 1193 | } |
| 1194 | |
| 1195 | void test_solve_trust_region_subproblem_bounded() |
| 1196 | { |
| 1197 | print_spinner(); |
| 1198 | matrix<double> H(2,2); |
| 1199 | H = 1, 0, |
| 1200 | 0, 1; |
| 1201 | matrix<double,0,1> g, lower, upper, p, true_p; |
| 1202 | g = {0, 0}; |
| 1203 | |
| 1204 | double radius = 0.5; |
| 1205 | lower = {0.5, 0}; |
| 1206 | upper = {10, 10}; |
| 1207 | |
| 1208 | |
| 1209 | solve_trust_region_subproblem_bounded(H,g, radius, p, 0.001, 500, lower, upper); |
| 1210 | true_p = { 0.5, 0}; |
| 1211 | DLIB_TEST_MSG(length(p-true_p) < 1e-12, p); |
| 1212 | |
| 1213 | } |
| 1214 | |
| 1215 | // ---------------------------------------------------------------------------------------- |
| 1216 |
no test coverage detected