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

Function brown_residual

dlib/test/optimization_test_functions.cpp:263–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 // ----------------------------------------------------------------------------------------
262
263 double brown_residual (int i, const matrix<double,4,1>& x)
264 /*!
265 requires
266 - 1 <= i <= 20
267 ensures
268 - returns the ith brown residual
269 !*/
270 {
271 double c;
272 double f;
273 double f1;
274 double f2;
275
276 f = 0.0E+00;
277
278
279 c = double ( i ) / 5.0E+00;
280 f1 = x(0) + c * x(1) - std::exp ( c );
281 f2 = x(2) + std::sin ( c ) * x(3) - std::cos ( c );
282
283 f = f1*f1 + f2*f2;
284
285 return f;
286 }
287
288 // ----------------------------------------------------------------------------------------
289

Callers 1

brownFunction · 0.85

Calls 2

xFunction · 0.85
expFunction · 0.85

Tested by

no test coverage detected