otter at otter-rsch.com
Mon Aug 9 02:48:52 PDT 2010
John Sibert wrote:
But that is just the same difficulty in a different form.
the right way I think is to put a global pointer in
int * pointer_to_phase=0;
and then in the initial_params startup assign
if (ad_printf && pointer_to_phase) (*ad_printf)("Current Phase %d ",
> Or you could add an additional argument to fmmdisp(...), eg,
> void fmmdisp(_CONST dvector& x,_CONST dvector& g,
> const int& nvar, int scroll_flag,int noprintx, const int
> Giving phase a default value would not break calls to fmmdisp in other
> context, The problem would be that the code which calls fmmdisp would
> need to have access to the initial_params structure or the
> get_current_phase() function.
> On 08/08/2010 08:37 PM, dave fournier wrote:
>> There are a few issues involved here.
>> First here is how it migbht be done. the current phase is contained
>> as a static member of the class initial_params. Lets say we are working
>> with the quasi newton function minimizer in the file newfmin.cpp.
>> first we need to add
>> #include <admodel.h>
>> near the top of the file.
>> then at the right place(s) add something like
>> if (ad_printf) (*ad_printf)("Current Phase %d ",
>> initial_params::current_phase );
>> However this will break all code that just uses the autodif stuff
>> I think as the symbol initial_params::current_phase will be undefined.
>> Maybe someone has a better idea.
>> Developers mailing list
>> Developers at admb-project.org
More information about the Developers