warn("Only "trust-constr" method accept %s "
"options for "jac". Using "2-point" instead." % jac)
jac = None
elif notcallable(jac):
if bool(jac):
fun = MemoizeJac(fun)
jac = fun.derivative
After Change
// fun returns func and grad
fun = MemoizeJac(fun)
jac = fun.derivative
elif (jac in FD_METHODS and
meth in ["trust-constr", "bfgs", "cg", "l-bfgs-b", "tnc"]):
// finite differences
pass