DOpE
reducedtrustregionnewton.h
Go to the documentation of this file.
1 
24 #ifndef REDUCEDTRUSTREGION_NEWTON__ALGORITHM_H_
25 #define REDUCEDTRUSTREGION_NEWTON__ALGORITHM_H_
26 
27 #include "reducedalgorithm.h"
28 #include "parameterreader.h"
29 
30 #include <iostream>
31 #include <assert.h>
32 #include <iomanip>
33 namespace DOpE
34 {
49  template <typename PROBLEM, typename VECTOR>
51  {
52  public:
68  ParameterReader &param_reader,
69  DOpEExceptionHandler<VECTOR>* Except=NULL,
70  DOpEOutputHandler<VECTOR>* Output=NULL,
71  int base_priority=0);
73 
79  static void declare_params(ParameterReader &param_reader);
80 
81 
91  virtual int Solve(ControlVector<VECTOR>& q,double global_tol=-1.);
92 
99  double NewtonResidual(const ControlVector<VECTOR>& q);
100  protected:
127  const ControlVector<VECTOR>& gradient,
128  const ControlVector<VECTOR>& gradient_transposed,
129  ControlVector<VECTOR>& hessian,
130  ControlVector<VECTOR>& hessian_transposed,
133  ControlVector<VECTOR> & min,
134  double tr_delta,
135  double& cost,
136  double& model,
137  double& expand,
138  int& liniter);
139 
158  virtual int SolveReducedLinearSystem(const ControlVector<VECTOR>& q,
159  const ControlVector<VECTOR>& gradient,
160  const ControlVector<VECTOR>& gradient_transposed,
165  virtual double Residual(const ControlVector<VECTOR>& gradient,
166  const ControlVector<VECTOR>& gradient_transposed)
167  {return gradient*gradient_transposed;}
168  private:
169  unsigned int nonlinear_maxiter_;
170  double nonlinear_tol_, nonlinear_global_tol_, tr_delta_max_, tr_delta_null_, tr_delta_eta_;
171  unsigned int linear_max_iter_;
172  double linear_tol_, linear_global_tol_;
173  std::string postindex_;
174  std::string tr_method_;
175  };
176 
177  /***************************************************************************************/
178  /****************************************IMPLEMENTATION*********************************/
179  /***************************************************************************************/
180  using namespace dealii;
181 
182  /******************************************************/
183 
184 template <typename PROBLEM, typename VECTOR>
186  {
187  param_reader.SetSubsection("reducedtrustregionnewtonalgorithm parameters");
188  param_reader.declare_entry("nonlinear_maxiter", "10",Patterns::Integer(0));
189  param_reader.declare_entry("nonlinear_tol", "1.e-7",Patterns::Double(0));
190  param_reader.declare_entry("nonlinear_global_tol", "1.e-11",Patterns::Double(0));
191  param_reader.declare_entry("tr_delta_max", "1.",Patterns::Double(0));
192  param_reader.declare_entry("tr_delta_null", "0.25",Patterns::Double(0));
193  param_reader.declare_entry("tr_delta_eta", "0.01",Patterns::Double(0,0.25));
194 
195  param_reader.declare_entry("linear_maxiter", "40",Patterns::Integer(0));
196  param_reader.declare_entry("linear_tol", "1.e-10",Patterns::Double(0));
197  param_reader.declare_entry("linear_global_tol", "1.e-12",Patterns::Double(0));
198 
199  param_reader.declare_entry("tr_method", "dogleg",Patterns::Selection("dogleg|exact|steinhaug"));
200 
202  }
203 /******************************************************/
204 
205 template <typename PROBLEM, typename VECTOR>
209  ParameterReader &param_reader,
212  int base_priority)
213  : ReducedAlgorithm<PROBLEM,VECTOR>(OP,S,param_reader,Except,Output,base_priority)
214  {
215  param_reader.SetSubsection("reducedtrustregionnewtonalgorithm parameters");
216  nonlinear_maxiter_ = param_reader.get_integer ("nonlinear_maxiter");
217  nonlinear_tol_ = param_reader.get_double ("nonlinear_tol");
218  nonlinear_global_tol_ = param_reader.get_double ("nonlinear_global_tol");
219  tr_delta_max_ = param_reader.get_double("tr_delta_max");
220  tr_delta_null_ = param_reader.get_double("tr_delta_null");
221  tr_delta_eta_ = param_reader.get_double("tr_delta_eta");
222 
223  assert(tr_delta_eta_ < 0.25);
224  assert(tr_delta_null_<tr_delta_max_);
225 
226  linear_max_iter_ = param_reader.get_integer ("linear_maxiter");
227  linear_tol_ = param_reader.get_double ("linear_tol");
228  linear_global_tol_ = param_reader.get_double ("linear_global_tol");
229 
230  tr_method_ = param_reader.get_string("tr_method");
231 
232  postindex_ = "_"+this->GetProblem()->GetName();
233  }
234 
235 /******************************************************/
236 
237 template <typename PROBLEM, typename VECTOR>
239  {
240 
241  }
242 /******************************************************/
243 
244 template <typename PROBLEM, typename VECTOR>
246 {
247  //Solve j'(q) = 0
248  ControlVector<VECTOR> gradient(q), gradient_transposed(q);
249 
250  try
251  {
252  this->GetReducedProblem()->ComputeReducedCostFunctional(q);
253  }
254  catch(DOpEException& e)
255  {
256  this->GetExceptionHandler()->HandleCriticalException(e);
257  }
258 
259  try
260  {
261  this->GetReducedProblem()->ComputeReducedGradient(q,gradient,gradient_transposed);
262  }
263  catch(DOpEException& e)
264  {
265  this->GetExceptionHandler()->HandleCriticalException(e);
266  }
267 
268  return sqrt(Residual(gradient,gradient_transposed));
269 }
270 /******************************************************/
274 template <typename PROBLEM, typename VECTOR>
276 {
277 
278  q.ReInit();
279  //Solve j'(q) = 0
280  ControlVector<VECTOR> p_u(q), p_b(q), gradient(q), gradient_transposed(q), hessian(q), hessian_transposed(q),dq(q);
281 
282  unsigned int iter=0;
283  double cost=0.;
284  std::stringstream out;
285 
286  unsigned int n_good =0;
287  unsigned int n_bad =0;
288  this->GetOutputHandler()->InitNewtonOut(out);
289 
290  out << "**************************************************************\n";
291  out << "* Starting Reduced Trustregion_Newton Algorithm *\n";
292  out << "* Solving : "<<this->GetProblem()->GetName()<<"\t\t\t*\n";
293  out << "* CDoFs : ";
294  q.PrintInfos(out);
295  out << "* SDoFs : ";
296  this->GetReducedProblem()->StateSizeInfo(out);
297  out << "**************************************************";
298  this->GetOutputHandler()->Write(out,1+this->GetBasePriority(),1,1);
299 
300  this->GetOutputHandler()->SetIterationNumber(iter,"OptNewton"+postindex_);
301 
302  this->GetOutputHandler()->Write(q,"Control"+postindex_,"control");
303 
304  try
305  {
306  cost = this->GetReducedProblem()->ComputeReducedCostFunctional(q);
307  }
308  catch(DOpEException& e)
309  {
310  this->GetExceptionHandler()->HandleCriticalException(e);
311  }
312 
313  this->GetOutputHandler()->InitOut(out);
314  out<< "CostFunctional: " << cost;
315  this->GetOutputHandler()->Write(out,2+this->GetBasePriority());
316  this->GetOutputHandler()->InitNewtonOut(out);
317 
318  //try
319  //{
320  // this->GetReducedProblem()->ComputeReducedFunctionals(q);
321  //}
322  //catch(DOpEException& e)
323  //{
324  // this->GetExceptionHandler()->HandleCriticalException(e);
325  //}
326 
327  try
328  {
329  this->GetReducedProblem()->ComputeReducedGradient(q,gradient,gradient_transposed);
330  }
331  catch(DOpEException& e)
332  {
333  this->GetExceptionHandler()->HandleCriticalException(e);
334  }
335 
336  double res = Residual(gradient,gradient_transposed);
337  double firstres = res;
338 
339  double tr_delta_max = tr_delta_max_;
340  double tr_delta = tr_delta_null_;
341  double tr_eta = 0.01;
342  double tr_rho = 0.;
343  double tr_model = 0.;
344  double point_norm = sqrt(q*q);
345 
346  assert(res >= 0);
347 
348  this->GetOutputHandler()->Write(gradient,"NewtonResidual"+postindex_,"control");
349  out<< "\t Newton step: " <<iter<<"\t Residual (abs.): "<<sqrt(res)<<"\n";
350  out<< "\t Newton step: " <<iter<<"\t Residual (rel.): "<<std::scientific<<sqrt(res)/sqrt(res)<<"\n";
351  this->GetOutputHandler()->Write(out,3+this->GetBasePriority());
352  int liniter = 0;
353  global_tol = std::max(nonlinear_global_tol_,global_tol);
354  //while( (res >= global_tol*global_tol) && (res >= nonlinear_tol_*nonlinear_tol_*firstres) )
355  while( iter==0 || iter ==1 || ((res >= global_tol*global_tol) && (res >= nonlinear_tol_*nonlinear_tol_*firstres) ))
356  {
357  this->GetOutputHandler()->SetIterationNumber(iter,"OptNewton"+postindex_);
358  tr_model = 0.;
359  if(iter > nonlinear_maxiter_)
360  {
361  out << "**************************************************\n";
362  out << "* Aborting Reduced Trustregion_Newton Algorithm *\n";
363  out << "* after "<<std::setw(6)<<iter<<" Iterations *\n";
364  out.precision(4);
365  out << "* with Residual "<<std::scientific << std::setw(11) << sqrt(res)<<" *\n";
366  out << "* with Cost "<<std::scientific << std::setw(11) << cost<<" *\n";
367  out << "* n_good: "<<n_good<<" n_bad: "<<n_bad<<" *\n";
368  out.precision(10);
369  out << "**************************************************";
370  this->GetOutputHandler()->Write(out,1+this->GetBasePriority(),1,1);
371  throw DOpEIterationException("Iteration count exceeded bounds!","ReducedTrustregion_NewtonAlgorithm::Solve");
372  }
373  if(tr_delta <= 1.e-8*point_norm)
374  {
375  out << "**************************************************\n";
376  out << "* Aborting Reduced Trustregion_Newton Algorithm *\n";
377  out << "* after "<<std::setw(6)<<iter<<" Iterations *\n";
378  out.precision(4);
379  out << "* with Residual "<<std::scientific << std::setw(11) << sqrt(res)<<" *\n";
380  out << "* with Cost "<<std::scientific << std::setw(11) << cost<<" *\n";
381  out << "* n_good: "<<n_good<<" n_bad: "<<n_bad<<" *\n";
382  out.precision(10);
383  out << "**************************************************";
384  this->GetOutputHandler()->Write(out,1+this->GetBasePriority(),1,1);
385  throw DOpEIterationException("Iteration aborted due to too small Trustregion radius!","ReducedTrustregion_NewtonAlgorithm::Solve");
386  }
387 
388  iter++;
389 
390  //Compute Minimizer p of the Model on the set \|p\| \le tr_delta
391  double last_cost = cost;
392  double expand = 2.;
393  bool good = ComputeTRModelMinimizer(q,gradient,gradient_transposed,hessian,hessian_transposed,p_u,p_b,dq,tr_delta,cost,tr_model,expand,liniter);
394 
395  if(tr_model != 0.)
396  {
397  double loc_delta = 1.e-8*std::max(1.,fabs(last_cost));
398  if(std::max(fabs(last_cost-cost),fabs(tr_model)) < loc_delta)
399  {
400  tr_rho = 1.;
401  }
402  else
403  tr_rho = (last_cost-cost-loc_delta)/(0.-tr_model-loc_delta);
404  }
405  else
406  tr_rho = 0.;
407 
408  double norm = sqrt(dq*dq);
409  if(norm <= 1.e-8*point_norm && good)
410  {
411  out << "**************************************************\n";
412  out << "* Aborting Reduced Trustregion_Newton Algorithm *\n";
413  out << "* after "<<std::setw(6)<<iter<<" Iterations *\n";
414  out.precision(4);
415  out << "* with Residual "<<std::scientific << std::setw(11) << sqrt(res)<<" *\n";
416  out << "* with Cost "<<std::scientific << std::setw(11) << cost<<" *\n";
417  out << "* n_good: "<<n_good<<" n_bad: "<<n_bad<<" *\n";
418  out.precision(10);
419  out << "**************************************************";
420  this->GetOutputHandler()->Write(out,1+this->GetBasePriority(),1,1);
421  throw DOpEIterationException("Iteration aborted due to too small update!","ReducedTrustregion_NewtonAlgorithm::Solve");
422  }
423 
424  out<<"TR-Newton Predicted Reduction: "<<-tr_model<<" Actual Reduction: "<<last_cost-cost<<" rho: "<<tr_rho<<" where TR-Minimizer is "<<good<<" with lenght: "<<norm;
425  this->GetOutputHandler()->Write(out,4+this->GetBasePriority());
426  out<<"\t TR-Newton step: " <<iter<<"\t";
427  out<<"delta: "<<tr_delta<<"->";
428  if((tr_rho < 0.01) || !good)
429  {
430  tr_delta=std::max(0.5*norm,0.125*tr_delta);
431  }
432  else
433  {
434  if((tr_rho > 0.9))
435  {
436  tr_delta = std::min(expand*tr_delta,tr_delta_max);
437  }
438 
439  //else tr_delta = tr_delta;
440  }
441  out<<tr_delta;
442 
443  if(tr_rho > tr_eta)
444  {
445  out<<" accepting step!";
446  q.add(1.,dq);
447  point_norm = sqrt(q*q);
448  n_good++;
449  }
450  else
451  {
452  out<<" rejecting step!";
453  n_bad++;
454  }
455  //Compute all values
456  try
457  {
458  cost = this->GetReducedProblem()->ComputeReducedCostFunctional(q);
459  }
460  catch(DOpEException& e)
461  {
462  this->GetExceptionHandler()->HandleCriticalException(e);
463  }
464  try
465  {
466  this->GetReducedProblem()->ComputeReducedGradient(q,gradient,gradient_transposed);
467  }
468  catch(DOpEException& e)
469  {
470  this->GetExceptionHandler()->HandleCriticalException(e);
471  }
472 
473  res = Residual(gradient,gradient_transposed);
474 
475  out<<"\t Residual: (rel.):"<<this->GetOutputHandler()->ZeroTolerance(sqrt(res)/sqrt(firstres),1.0)<<"\t LinearIters ["<<liniter<<"]";
476  this->GetOutputHandler()->Write(out,3+this->GetBasePriority());
477 
478  out<< "CostFunctional: " << cost;
479  this->GetOutputHandler()->Write(out,3+this->GetBasePriority());
480 
481  this->GetOutputHandler()->Write(q,"Control"+postindex_,"control");
482  this->GetOutputHandler()->Write(gradient,"NewtonResidual"+postindex_,"control");
483  }
484 
485  //We are done write total evaluation
486  out<< "CostFunctional: " << cost;
487  this->GetOutputHandler()->Write(out,2+this->GetBasePriority());
488  try
489  {
490  this->GetReducedProblem()->ComputeReducedFunctionals(q);
491  }
492  catch(DOpEException& e)
493  {
494  this->GetExceptionHandler()->HandleCriticalException(e);
495  }
496 
497  out << "**************************************************\n";
498  out << "* Stopping Reduced Trustregion_Newton Algorithm *\n";
499  out << "* after "<<std::setw(6)<<iter<<" Iterations *\n";
500  out.precision(4);
501  out << "* with rel. Residual "<<std::scientific << std::setw(11) << this->GetOutputHandler()->ZeroTolerance(sqrt(res)/sqrt(firstres),1.0)<<" *\n";
502  out << "* with Cost "<<std::scientific << std::setw(11) << cost<<" *\n";
503  out << "* n_good: "<<n_good<<" n_bad: "<<n_bad<<" *\n";
504  out.precision(10);
505  out << "**************************************************";
506  this->GetOutputHandler()->Write(out,1+this->GetBasePriority(),1,1);
507 
508  return iter;
509 }
510 /******************************************************/
511 
512 template <typename PROBLEM, typename VECTOR>
515  const ControlVector<VECTOR>& gradient,
516  const ControlVector<VECTOR>& gradient_transposed,
517  ControlVector<VECTOR>& hessian,
518  ControlVector<VECTOR>& hessian_transposed,
521  ControlVector<VECTOR> & min,
522  double tr_delta,
523  double& cost,
524  double& model,
525  double& expand,
526  int& liniter)
527 {
528 
529  bool ret = true;
530  if("dogleg" == tr_method_)
531  {
532  //Compute the unconstraint model minimizer
533  try
534  {
535  liniter = SolveReducedLinearSystem(q,gradient,gradient_transposed,p_b);
536  }
537  catch(DOpEIterationException& e)
538  {
539  //Seems uncritical too many linear solves, it'll probably work
540  //So only write a warning, and continue.
541  this->GetExceptionHandler()->HandleException(e);
542  liniter = -1;
543  }
544  catch(DOpEException& e)
545  {
546  this->GetExceptionHandler()->HandleCriticalException(e);
547  }
548  //compute the stepest descend direction...
549  try{
550  this->GetReducedProblem()->ComputeReducedHessianVector(q,gradient,hessian,hessian_transposed);
551  }
552  catch(DOpEException& e)
553  {
554  this->GetExceptionHandler()->HandleCriticalException(e);
555  }
556  {
557  double scale = (gradient*gradient_transposed)/(gradient*hessian_transposed);
558  p_u.equ(-1.*scale,gradient);
559  }
560 
561  ControlVector<VECTOR> tmp1(q), tmp2(q);
562 
563  //Check if p_b is feasible
564  double n_b = sqrt(p_b*p_b);
565 
566  if(n_b <= tr_delta)
567  {
568  min = p_b;
569  }
570  else
571  {
572  //compute the relaxation factor...
573  //This is such that for a quadratic functional after one iteration
574  //the solution is within the TR-radius if not prevented by the maximal radius.
575  expand = std::max(n_b/tr_delta,2.);
576  //but shouldnot grow too fast
577  expand = std::min(expand, 10.);
578 
579  //Check if p_u is feasible
580  double n_u = sqrt(p_u*p_u);
581 // assert(n_u < n_b);
582 
583  if(n_u <= tr_delta)
584  {
585  //solution between p_u and p_b
586  double a = n_u*n_u;
587  double b = n_b*n_b;
588  double c = p_u*p_b;
589  //l solves l^2(a+b-2c) + l(2c-2a) = tr_delta^2-a
590  double d = (c-a)/(a+b-2.*c);
591  double e = (tr_delta*tr_delta-a)/(a+b-2.*c);
592  assert(e+d*d >= 0.);
593  double l = sqrt(e+d*d) - d;
594  assert(l >= 0.);
595  assert(l <= 1.);
596  min.equ(l,p_b);
597  min.add(1-l,p_u);
598  }
599  else
600  {
601  //solution between 0 und p_u
602  min.equ(1./n_u*tr_delta,p_u);
603  }
604  }
605  //Check if the choice is in the domain of definition of f!
606  tmp1 = q;
607  tmp1 += min;
608 
609  try
610  {
611  cost = this->GetReducedProblem()->ComputeReducedCostFunctional(tmp1);
612  }
613  catch(DOpEException& e)
614  {
615  //this failed... we need to move closer to q!
616  ret = false;
617  min = 0.;
618  }
619  //reset Precomputations
620  this->GetReducedProblem()->ComputeReducedCostFunctional(q);
621  if(ret)
622  {
623  //Evaluate the model.
624  model = gradient*min;
625  //second order term
626  try{
627  this->GetReducedProblem()->ComputeReducedHessianVector(q,min,tmp1,tmp2);
628  }
629  catch(DOpEException& e)
630  {
631  this->GetExceptionHandler()->HandleCriticalException(e);
632  }
633  model += 0.5*(tmp1*min);
634  }
635  else
636  model = 0.;
637  }
638  else if("exact" == tr_method_)
639  {
640  throw DOpEException("Method not yet implemented: "+tr_method_,"ReducedTrustregion_NewtonAlgorithm::ComputeTRModelMinimizer");
641  }
642  else if("steinhaug" == tr_method_)
643  {
644  throw DOpEException("Method not yet implemented: "+tr_method_,"ReducedTrustregion_NewtonAlgorithm::ComputeTRModelMinimizer");
645  }
646  else
647  {
648  throw DOpEException("Unknown Method: "+tr_method_,"ReducedTrustregion_NewtonAlgorithm::ComputeTRModelMinimizer");
649  }
650 
651  return ret;
652 }
653 
654 /******************************************************/
655 
656 template <typename PROBLEM, typename VECTOR>
659  const ControlVector<VECTOR>& gradient,
660  const ControlVector<VECTOR>& gradient_transposed,
662 {
663  std::stringstream out;
664  dq = 0.;
665  ControlVector<VECTOR> r(q), r_transposed(q), d(q), Hd(q), Hd_transposed(q);
666 
667  r = gradient;
668  r_transposed = gradient_transposed;
669  d = gradient_transposed;
670 
671  double res = Residual(r,r_transposed);//r*r_transposed;
672  double firstres = res;
673 
674  assert(res >= 0.);
675 
676  out << "Starting Reduced Linear Solver with Residual: "<<sqrt(res);
677  this->GetOutputHandler()->Write(out,5+this->GetBasePriority());
678 
679  unsigned int iter = 0;
680  double cgalpha, cgbeta, oldres;
681 
682  this->GetOutputHandler()->SetIterationNumber(iter,"OptNewtonCg"+postindex_);
683 
684  //while(res>=linear_tol_*linear_tol_*firstres && res>=linear_global_tol_*linear_global_tol_)
685  //using Algorithm 6.1 from Nocedal Wright
686  while(res>= std::min(0.25,sqrt(firstres))*firstres && res>=linear_global_tol_*linear_global_tol_)
687  {
688  iter++;
689  this->GetOutputHandler()->SetIterationNumber(iter,"OptNewtonCg"+postindex_);
690  if(iter > linear_max_iter_)
691  {
692  throw DOpEIterationException("Iteration count exceeded bounds!","ReducedNewtonAlgorithm::SolveReducedLinearSystem");
693  }
694 
695  try
696  {
697  this->GetReducedProblem()->ComputeReducedHessianVector(q,d,Hd,Hd_transposed);
698  }
699  catch(DOpEException& e)
700  {
701  this->GetExceptionHandler()->HandleCriticalException(e);
702  }
703 
704  cgalpha = res / (Hd*d);
705 
706  if(cgalpha < 0)
707  {
708  if(iter==1)
709  {
710  dq.add(cgalpha,d);
711  }
712  throw DOpENegativeCurvatureException("Negative curvature detected!","ReducedNewtonAlgorithm::SolveReducedLinearSystem");
713  }
714 
715  dq.add(cgalpha,d);
716  r.add(cgalpha,Hd);
717  r_transposed.add(cgalpha,Hd_transposed);
718 
719  oldres = res;
720  res = Residual(r,r_transposed);//r*r_transposed;
721  if(res < 0.)
722  {
723  //something is broken, maybe don't use update formula and
724  //calculate res from scratch.
725  try
726  {
727  this->GetReducedProblem()->ComputeReducedHessianVector(q,dq,Hd,Hd_transposed);
728  }
729  catch(DOpEException& e)
730  {
731  this->GetExceptionHandler()->HandleCriticalException(e);
732  }
733  r = gradient;
734  r_transposed = gradient_transposed;
735  r.add(1.,Hd);
736  r_transposed.add(1.,Hd_transposed);
737  res = Residual(r,r_transposed);
738  }
739  assert(res >= 0.);
740  out<<"\t Cg step: " <<iter<<"\t Residual: "<<sqrt(res);
741  this->GetOutputHandler()->Write(out,5+this->GetBasePriority());
742 
743  cgbeta = res / oldres; //Fletcher-Reeves
744  d*= cgbeta;
745  d.equ(-1,r_transposed);
746  }
747  return iter;
748 }
749 
750 }
751 #endif
Definition: dopeexception.h:76
ReducedTrustregion_NewtonAlgorithm(PROBLEM *OP, ReducedProblemInterface< PROBLEM, VECTOR > *S, ParameterReader &param_reader, DOpEExceptionHandler< VECTOR > *Except=NULL, DOpEOutputHandler< VECTOR > *Output=NULL, int base_priority=0)
Definition: reducedtrustregionnewton.h:207
void PrintInfos(std::stringstream &out)
Definition: controlvector.cc:896
double get_double(const std::string &entry_name)
Definition: parameterreader.h:115
Definition: dopeexception.h:90
Definition: parameterreader.h:36
virtual double Residual(const ControlVector< VECTOR > &gradient, const ControlVector< VECTOR > &gradient_transposed)
Definition: reducedtrustregionnewton.h:165
Definition: optproblemcontainer.h:70
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
Definition: parameterreader.h:98
Definition: controlvector.h:49
Definition: reducedtrustregionnewton.h:50
Definition: reducedalgorithm.h:54
void add(double s, const ControlVector &dq)
Definition: controlvector.cc:629
void ReInit()
Definition: controlvector.cc:96
virtual int Solve(ControlVector< VECTOR > &q, double global_tol=-1.)
Definition: reducedtrustregionnewton.h:275
std::string get_string(const std::string &entry_name)
Definition: parameterreader.h:137
bool ComputeTRModelMinimizer(const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &gradient, const ControlVector< VECTOR > &gradient_transposed, ControlVector< VECTOR > &hessian, ControlVector< VECTOR > &hessian_transposed, ControlVector< VECTOR > &p_u, ControlVector< VECTOR > &p_b, ControlVector< VECTOR > &min, double tr_delta, double &cost, double &model, double &expand, int &liniter)
Definition: reducedtrustregionnewton.h:514
static void declare_params(ParameterReader &param_reader)
Definition: reducedalgorithm.h:241
int get_integer(const std::string &entry_name)
Definition: parameterreader.h:126
virtual int SolveReducedLinearSystem(const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &gradient, const ControlVector< VECTOR > &gradient_transposed, ControlVector< VECTOR > &dq)
Definition: reducedtrustregionnewton.h:658
~ReducedTrustregion_NewtonAlgorithm()
Definition: reducedtrustregionnewton.h:238
void SetSubsection(const std::string subsection)
Definition: parameterreader.h:93
Definition: reducedprobleminterface.h:335
void equ(double s, const ControlVector &dq)
Definition: controlvector.cc:665
static void declare_params(ParameterReader &param_reader)
Definition: reducedtrustregionnewton.h:185
Definition: dopeexception.h:35
double NewtonResidual(const ControlVector< VECTOR > &q)
Definition: reducedtrustregionnewton.h:245
Definition: optproblemcontainer.h:72