[petsc-dev] coding style

Oxberry, Geoffrey Malcolm oxberry1 at llnl.gov
Thu Aug 18 15:34:13 CDT 2016


I realize this point was brought up earlier, but doesn’t this discussion still assume that evaluating g at zero is defined and makes sense? Though I see the appeal in this design, I’m not sure it will necessarily work in practice. For instance, we definitely have formulations that involve terms like sqrt(x), which isn’t differentiable at zero, and would break this interface. (We would bound the feasible set away from zero, so the optimization algorithm should still work.)

> On Aug 18, 2016, at 11:02 AM, Munson, Todd <tmunson at mcs.anl.gov> wrote:
> 
>> 
>> People are free to use MatShell to create a "matrix" that is actually a
>> nonlinear operator.  Solvers won't work properly if it's not, but that's
>> their problem.
> 
> The quadratic programming solvers in our case will happily go and tell
> you it solved the problem...however, the problem it solved uses
> 
>  c = grad[g(0)]
>  H = hess[g(0)]
> 
> I'd be happier if the solver barfed and told the user to select a method 
> appropriate for their real problem -- it it truly is nonlinear -- rather 
> than going off and solving the wrong problem, which is what is done 
> today.
> 
> Todd.
> 



More information about the petsc-dev mailing list