| 369 | }; |
| 370 | |
| 371 | void 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 | |
| 397 | void testHybrd() |
| 398 | { |
no test coverage detected