cr.sparse.opt.build_grad_val_func

cr.sparse.opt.build_grad_val_func(func, grad)[source]

Constructs a grad_val function from the definitions of function \(f(x)\) and gradient \(g(x)\)

Parameters
  • func – Definition of the smooth function \(f : \RR^n \to \RR\)

  • grad – Definition of the gradient \(g = \nabla f : \RR^n \to \RR^n\)

Returns

A function which computes the pair \((g(x), f(x))\) for input \(x\)