MCPcopy Create free account
hub / github.com/cvanaret/Uno / objective_gradient

Function objective_gradient

interfaces/Python/example/example_hs015.py:16–19  ·  view source on GitHub ↗
(x, gradient)

Source from the content-addressed store, hash-verified

14 constraint_values[:] = [x[0]*x[1], x[0] + x[1]**2]
15
16def objective_gradient(x, gradient):
17 # the modeler should throw an exception if the function cannot be evaluated
18 gradient[:] = [400.*x[0]**3 - 400.*x[0]*x[1] + 2.*x[0] - 2.,
19 200.*(x[1] - x[0]**2)]
20
21def jacobian(x, jacobian_values):
22 # the modeler should throw an exception if the function cannot be evaluated

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected