#include "petsctao.h" PetscErrorCode TaoGetObjectiveAndGradient(Tao tao, Vec *g, PetscErrorCode (**func)(Tao, Vec, PetscReal*, Vec, void*), void **ctx)Not collective
tao | - the Tao context |
g | - the vector to internally hold the gradient computation | |
func | - the gradient function | |
ctx | - user-defined context for private data for the gradient evaluation routine |
func (Tao tao, Vec x, PetscReal *f, Vec g, void *ctx);
x | - input vector | |
f | - objective value (output) | |
g | - gradient value (output) | |
ctx | - [optional] user-defined function context |