[petsc-dev] coding style

Munson, Todd tmunson at mcs.anl.gov
Thu Aug 18 12:35:56 CDT 2016

If the user supplied only a g(x) to a solver meant for 
quadratic problems, we would call grad[g(0)] [thanks 
Matt!] to get the linear term and hess[g(0)] to get 
the Hessian matrix.  So that is possible as well.

Maybe we should just keep things as they exist now
and not add extra complications.

I do still worry about a user providing a truly nonlinear
g(x) to a solver meant for quadratic programs.  I could 
test to see if the Hessian is constant  if I really
wanted to though.


> On Aug 18, 2016, at 11:52 AM, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>   Seems reasonable. Note for SNES we have something similar in that user can solve either F(x) = b or F(x) - b = 0 depending on if they provide the b explicitly.
> I'd just say that the algorithm should still work correctly if the user
> doesn't separate everything since that can be inefficient (multiple
> communications and passes over memory) and/or unnatural.  How does the
> algorithm work if the user has only g(x)?  Would they need to define
>  H := \nabla^2 g(x)
>  f(x) = g(x) - x'*H*x
> so that you can put it back together?

More information about the petsc-dev mailing list