[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: An issue with function signatures
From: |
Julien Bect |
Subject: |
Re: An issue with function signatures |
Date: |
Fri, 21 Dec 2018 11:54:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
Le 21/12/2018 à 09:16, Juan Pablo Carbajal a écrit :
Thank you for your thoughts. Unless we get another answer I see this
as a weakness on the signature and we should discourage it in future
function.
I agree with you. It think that is usually better to require that user
should provide *one* objective function :
[f_val, f_grad, f_hessian] = objfun (x)
One further argument in this direction : this is the Matlab-way ; see, e.g.,
https://fr.mathworks.com/help/optim/ug/writing-scalar-objective-functions.html
This is also the NLopt-way :
https://nlopt.readthedocs.io/en/latest/NLopt_Matlab_Reference/
Switching to this kind of signature for sqp (the only nonlinear solver
in Octave core) would mean breaking compatibility with earlier versions
of Octave. @OctaveMaintainer : what is your position about this ?
In the optim package, as far as I can see, the current situation is a
mix of both signatures. For instance, bfgs_min uses the all-in-one
signature, while cg_min has a separate df argument. @Olaf : can you
comment on that ?
@++
Julien