MCPcopy Create free account
hub / github.com/abess-team/abess / testHybrj1

Function testHybrj1

python/include/unsupported/test/NonLinearOptimization.cpp:281–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280
281void testHybrj1()
282{
283 const int n=9;
284 int info;
285 VectorXd x(n);
286
287 /* the following starting values provide a rough fit. */
288 x.setConstant(n, -1.);
289
290 // do the computation
291 hybrj_functor functor;
292 HybridNonLinearSolver<hybrj_functor> solver(functor);
293 info = solver.hybrj1(x);
294
295 // check return value
296 VERIFY_IS_EQUAL(info, 1);
297 VERIFY_IS_EQUAL(solver.nfev, 11);
298 VERIFY_IS_EQUAL(solver.njev, 1);
299
300 // check norm
301 VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
302
303
304// check x
305 VectorXd x_ref(n);
306 x_ref <<
307 -0.5706545, -0.6816283, -0.7017325,
308 -0.7042129, -0.701369, -0.6918656,
309 -0.665792, -0.5960342, -0.4164121;
310 VERIFY_IS_APPROX(x, x_ref);
311}
312
313void testHybrj()
314{

Callers 1

Calls 2

hybrj1Method · 0.80
blueNormMethod · 0.45

Tested by

no test coverage detected