MCPcopy Create free account
hub / github.com/davisking/dlib / test_solve_trust_region_subproblem_bounded

Function test_solve_trust_region_subproblem_bounded

dlib/test/optimization.cpp:1195–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

perform_testMethod · 0.85

Calls 3

print_spinnerFunction · 0.85
lengthFunction · 0.50

Tested by

no test coverage detected