[Ipopt] IDX_STY and NEW_X in the Fortran sample (fwd)

Stefan Vigerske stefan at math.hu-berlin.de
Wed Nov 14 13:20:05 EST 2018


Hi,

On 11/14/18 6:56 PM, Daniel Feenberg wrote:
> 
> I am using ipopt with gcc Fortran under Linux and have two questions.
> 
> 1) What does IDX_STY do? The sample fortran program sets it to 1,
> but I can't find any indication of what this means.

That is the "index style".
IDX_STY = 0 means that you start indices at 0, as in C.
IDX_STY = 1 means that you start indices at 1, as in Fortran.

> 2) I am unsure of how to handle NEW_X. Can I just add:
> 
>     IF(NEW_X.EQ.1) return

That would usually not give you what you want.

> at the start of EV_G,EV_JACG,EV_F and EV_GRAD_F, after the
> declarations and before any computations? Is the constant
> 1 or 0? When I print NEW_X, it always seems to be zero.

Yes, should be 0 or 1.

NEW_X gives can additional information about the point to be evaluated: 
It is 0 if any evaluation method was previously called with the same 
values in x, and is 1 otherwise.
So ignoring NEW_X would be fine, but it might help you to safe some 
computations in your implementations of the callbacks, but eventually 
the callbacks should still provide the function values, gradients, or 
Hessian.

Stefan


> 
> 
> Thanks
> Daniel Feenberg
> NBER
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BRcuJnQr5NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=qjxDf0rh5gr9GvBfN40i4xuxl5LKc3nJxCTmjUgKSyM&s=qJqAM5vS0bHQ3AR2AXEDKMrp7g6Rh8LJEZh6CMCiwBg&e= 
> 
> 



More information about the Ipopt mailing list