36 if (separable_function_difference)
38 delete separable_function_difference;
39 separable_function_difference=0;
42 assert(num_separable_calls > 0);
45 separable_function_difference =
new dvector(1,num_separable_calls);
47 fmm** pfmc1 =
new pfmm[
static_cast<unsigned int>(num_separable_calls)];
49 ivector ishape(1,num_separable_calls);
50 dvector gmax(1,num_separable_calls);
53 int* pishapei = ishape.
get_v() + 1;
54 for (
int i=1;i<=num_separable_calls;i++)
56 int m = (*derindex)(i).indexmax();
62 pfmc1i->
crit=inner_crit;
81 dmatrix gg(1,num_separable_calls,1,ishape);
82 dmatrix ggb(1,num_separable_calls,1,ishape);
83 dmatrix uu(1,num_separable_calls,1,ishape);
84 dmatrix uub(1,num_separable_calls,1,ishape);
85 dvector ff(1,num_separable_calls);
86 dvector ffb(1,num_separable_calls);
87 ivector icon(1,num_separable_calls);
111 for (
int ii=1;ii<=2;ii++)
115 for (
int i=1;i<=num_separable_calls;i++)
117 int m=(*derindex)(i).indexmax();
118 double* puuij = puui->
get_v() + 1;
119 for (
int j=1;j<=m;j++)
121 *puuij = u((*derindex)(i)(j));
129 bool loop_flag =
false;
130 int loop_counter = 0;
140 if (loop_flag) loop_counter++;
141 if (loop_counter > 18)
143 cout << loop_counter;
150 for (
int i=1;i<=num_separable_calls;i++)
157 (pfmc1[i])->
fmin(ff[i],uuu,gg(i));
158 gmax(i)=
fabs(pfmc1[i]->gmax);
161 if (gmax(i)<1.e-4 || pfmc1[i]->ireturn<=0)
174 for (
int i2=1;i2<=num_separable_calls;i2++)
176 int m=(*derindex)(i2).indexmax();
177 for (
int j=1;j<=m;j++)
179 u((*derindex)(i2)(j))=uu(i2,j);
191 pmin->inner_opt_flag=1;
193 pmin->inner_opt_flag=0;
210 for (
int i=1;i<=num_separable_calls;i++)
212 int m=(*derindex)(i).indexmax();
213 double* pggij = pggi->
get_v() + 1;
214 for (
int j=1;j<=m;j++)
216 *pggij = g((*derindex)(i)(j));
229 if (saddlepointflag==2)
231 ff[1]=-(*separable_function_difference)(1);
232 for (
int i=2;i<=num_separable_calls;i++)
234 ff[i]=-(*separable_function_difference)(i);
248 ff[1]=(*separable_function_difference)(1);
249 for (
int i=2;i<=num_separable_calls;i++)
251 ff[i]=(*separable_function_difference)(i);
264 for (
int i2=1;i2<=num_separable_calls;i2++)
276 double tmax=
max(gmax);
277 output_stream <<
" inner maxg = " << std::scientific << setprecision(10) << tmax;
278 if (tmax< 1.e-4)
break;
284 pmin->inner_opt_flag=1;
286 pmin->inner_opt_flag=0;
292 for (
int i=1;i<=num_separable_calls;i++)
virtual void AD_uf_inner()
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Description not yet available.
Vector of double precision numbers.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
df1_two_variable fabs(const df1_two_variable &x)
static dvariable reset(const dvar_vector &x)
double gmax
maximum gradient
void gradcalc(int nvar, const dvector &g)
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
Functions and variables for function minimizer.
Description not yet available.
void initialize(void)
Initialze all elements of dvector to zero.
std::ostream & get_output_stream()
void initialize(void)
Description not yet available.
dvector get_uhat_quasi_newton_block_diagonal(const dvector &x, function_minimizer *pfmin)
Description not yet available.
Description not yet available.
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
dvector value(const df1_one_vector &v)
static int get_num_quadratic_prior(void)
static double fun_without_pen
Fundamental data type for reverse mode automatic differentiation.
static void get_M_calculations(void)
Description not yet available.