| 279 | |
| 280 | |
| 281 | void 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 | |
| 313 | void testHybrj() |
| 314 | { |
no test coverage detected