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

Function rosen_hessian

examples/optimization_ex.cpp:72–84  ·  view source on GitHub ↗

This function computes the Hessian matrix for the rosen() function. This is the matrix of second derivatives.

Source from the content-addressed store, hash-verified

70// This function computes the Hessian matrix for the rosen() function. This is
71// the matrix of second derivatives.
72matrix<double> rosen_hessian (const column_vector& m)
73{
74 const double x = m(0);
75 const double y = m(1);
76
77 matrix<double> res(2,2);
78
79 // now compute the second derivatives
80 res(0,0) = 1200*x*x - 400*y + 2; // second derivative with respect to x
81 res(1,0) = res(0,1) = -400*x; // derivative with respect to x and y
82 res(1,1) = 200; // second derivative with respect to y
83 return res;
84}
85
86// ----------------------------------------------------------------------------------------
87

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected