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

Function testHybrd1

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

Source from the content-addressed store, hash-verified

369};
370
371void testHybrd1()
372{
373 int n=9, info;
374 VectorXd x(n);
375
376 /* the following starting values provide a rough solution. */
377 x.setConstant(n, -1.);
378
379 // do the computation
380 hybrd_functor functor;
381 HybridNonLinearSolver<hybrd_functor> solver(functor);
382 info = solver.hybrd1(x);
383
384 // check return value
385 VERIFY_IS_EQUAL(info, 1);
386 VERIFY_IS_EQUAL(solver.nfev, 20);
387
388 // check norm
389 VERIFY_IS_APPROX(solver.fvec.blueNorm(), 1.192636e-08);
390
391 // check x
392 VectorXd x_ref(n);
393 x_ref << -0.5706545, -0.6816283, -0.7017325, -0.7042129, -0.701369, -0.6918656, -0.665792, -0.5960342, -0.4164121;
394 VERIFY_IS_APPROX(x, x_ref);
395}
396
397void testHybrd()
398{

Callers 1

Calls 2

hybrd1Method · 0.80
blueNormMethod · 0.45

Tested by

no test coverage detected