ROL
ROL_Types.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
15 #ifndef ROL_TYPES_HPP
16 #define ROL_TYPES_HPP
17 
18 #ifdef HAVE_ROL_DEBUG
19 #define ROL_VALIDATE( A ) A
20 #else
21 #define ROL_VALIDATE( A ) /* empty */
22 #endif
23 
24 #include <algorithm>
25 #include <complex>
26 #include <exception>
27 #include <string>
28 #include <sstream>
29 #include <limits>
30 #include <type_traits>
31 #include <ROL_stacktrace.hpp>
32 #include "ROL_ScalarTraits.hpp"
33 #include <ROL_Ptr.hpp>
34 #include <ROL_Vector.hpp>
35 #include <ROL_config.h>
36 
40 #define ROL_NUM_CHECKDERIV_STEPS 13
41 
42 
43 
44 namespace ROL {
45 
46  template<class T>
47  std::string NumberToString( T Number )
48  {
49  std::ostringstream ss;
50  ss << Number;
51  return ss.str();
52  }
53 
56  template<class Real>
57  inline Real ROL_EPSILON(void) { return std::abs(ROL::ScalarTraits<Real>::eps()); }
58  //static const Real ROL_EPSILON<Real>() = std::abs(ROL::ScalarTraits<Real>::eps());
59 
62  template<class Real>
63  inline Real ROL_THRESHOLD(void) { return 10.0 * ROL_EPSILON<Real>(); }
64 
67  template<class Real>
68  inline Real ROL_OVERFLOW(void) { return std::abs(ROL::ScalarTraits<Real>::rmax()); }
69 
70  template<class Real>
71  inline Real ROL_INF(void) { return 0.1*ROL_OVERFLOW<Real>(); }
72 
73  template<class Real>
74  inline Real ROL_NINF(void) { return -ROL_INF<Real>(); }
75 
78  template<class Real>
79  inline Real ROL_UNDERFLOW(void) { return std::abs(ROL::ScalarTraits<Real>::rmin()); }
80 
83  enum EExitStatus {
90  };
91 
92  inline std::string EExitStatusToString(EExitStatus tr) {
93  std::string retString;
94  switch(tr) {
95  case EXITSTATUS_CONVERGED: retString = "Converged"; break;
96  case EXITSTATUS_MAXITER: retString = "Iteration Limit Exceeded"; break;
97  case EXITSTATUS_STEPTOL: retString = "Step Tolerance Met"; break;
98  case EXITSTATUS_NAN: retString = "Step and/or Gradient Returned NaN"; break;
99  case EXITSTATUS_USERDEFINED: retString = "User Defined"; break;
100  case EXITSTATUS_LAST: retString = "Last Type (Dummy)"; break;
101  default: retString = "INVALID EExitStatus";
102  }
103  return retString;
104  }
105 
108  template<class Real>
109  struct AlgorithmState {
110  int iter;
111  int minIter;
112  int nfval;
113  int ncval;
114  int ngrad;
115  Real value;
116  Real minValue;
117  Real gnorm;
118  Real cnorm;
119  Real snorm;
122  bool flag;
123  ROL::Ptr<Vector<Real> > iterateVec;
124  ROL::Ptr<Vector<Real> > lagmultVec;
125  ROL::Ptr<Vector<Real> > minIterVec;
127 
128  AlgorithmState(void) : iter(0), minIter(0), nfval(0), ngrad(0), value(0), minValue(0),
129  gnorm(std::numeric_limits<Real>::max()),
130  cnorm(std::numeric_limits<Real>::max()),
131  snorm(std::numeric_limits<Real>::max()),
132  aggregateGradientNorm(std::numeric_limits<Real>::max()),
133  aggregateModelError(std::numeric_limits<Real>::max()),
134  flag(false),
135  iterateVec(ROL::nullPtr), lagmultVec(ROL::nullPtr), minIterVec(ROL::nullPtr),
137 
138  virtual ~AlgorithmState() {}
139 
140  void reset(void) {
141  iter = 0;
142  minIter = 0;
143  nfval = 0;
144  ncval = 0;
145  ngrad = 0;
146  value = ROL_INF<Real>();
147  minValue = ROL_INF<Real>();
148  gnorm = ROL_INF<Real>();
149  cnorm = ROL_INF<Real>();
150  snorm = ROL_INF<Real>();
151  aggregateGradientNorm = ROL_INF<Real>();
152  aggregateModelError = ROL_INF<Real>();
153  flag = false;
154  if (iterateVec != ROL::nullPtr) {
155  iterateVec->zero();
156  }
157  if (lagmultVec != ROL::nullPtr) {
158  lagmultVec->zero();
159  }
160  if (minIterVec != ROL::nullPtr) {
161  minIterVec->zero();
162  }
163  }
164  };
165 
168  template<class Real>
169  struct StepState {
170  ROL::Ptr<Vector<Real> > gradientVec;
171  ROL::Ptr<Vector<Real> > descentVec;
172  ROL::Ptr<Vector<Real> > constraintVec;
173  int nfval;
174  int ngrad;
175  Real searchSize; // line search parameter (alpha) or trust-region radius (delta)
176  int flag; // Was step successful?
177  int SPiter; // Subproblem iteration count
178  int SPflag; // Subproblem termination flag
179 
180  StepState(void) : gradientVec(ROL::nullPtr),
181  descentVec(ROL::nullPtr),
182  constraintVec(ROL::nullPtr),
183  nfval(0),
184  ngrad(0),
185  searchSize(0),
186  flag(0),
187  SPiter(0),
188  SPflag(0) {}
189 
190  void reset(const Real searchSizeInput = 1.0) {
191  if (gradientVec != ROL::nullPtr) {
192  gradientVec->zero();
193  }
194  if (descentVec != ROL::nullPtr) {
195  descentVec->zero();
196  }
197  if (constraintVec != ROL::nullPtr) {
198  constraintVec->zero();
199  }
200  nfval = 0;
201  ngrad = 0;
202  searchSize = searchSizeInput;
203  flag = 0;
204  SPiter = 0;
205  SPflag = 0;
206  }
207  };
208 
210  bool operator()(char c) {
211  return (c ==' ' || c =='-' || c == '(' || c == ')' || c=='\'' || c=='\r' || c=='\n' || c=='\t');
212  }
213  };
214 
215  inline std::string removeStringFormat( std::string s ) {
216  std::string output = s;
217  output.erase( std::remove_if( output.begin(), output.end(), removeSpecialCharacters()), output.end() );
218  std::transform( output.begin(), output.end(), output.begin(), ::tolower );
219  return output;
220  }
221 
222  // Types of optimization problem
223  enum EProblem {
224  TYPE_U = 0,
230  };
231 
243  enum EStep{
254  };
255 
256  inline std::string EStepToString(EStep tr) {
257  std::string retString;
258  switch(tr) {
259  case STEP_AUGMENTEDLAGRANGIAN: retString = "Augmented Lagrangian"; break;
260  case STEP_BUNDLE: retString = "Bundle"; break;
261  case STEP_COMPOSITESTEP: retString = "Composite Step"; break;
262  case STEP_LINESEARCH: retString = "Line Search"; break;
263  case STEP_MOREAUYOSIDAPENALTY: retString = "Moreau-Yosida Penalty"; break;
264  case STEP_PRIMALDUALACTIVESET: retString = "Primal Dual Active Set"; break;
265  case STEP_TRUSTREGION: retString = "Trust Region"; break;
266  case STEP_INTERIORPOINT: retString = "Interior Point"; break;
267  case STEP_FLETCHER: retString = "Fletcher"; break;
268  case STEP_LAST: retString = "Last Type (Dummy)"; break;
269  default: retString = "INVALID EStep";
270  }
271  return retString;
272  }
273 
274  inline bool isCompatibleStep( EProblem p, EStep s ) {
275  bool comp = false;
276  switch(p) {
277 
278  case TYPE_U: comp = ( (s == STEP_LINESEARCH) ||
279  (s == STEP_TRUSTREGION) ||
280  (s == STEP_BUNDLE) );
281  break;
282  case TYPE_P: comp = ( (s == STEP_LINESEARCH) ||
283  (s == STEP_TRUSTREGION));
284  break;
285  case TYPE_B: comp = ( (s == STEP_LINESEARCH) ||
286  (s == STEP_TRUSTREGION) ||
287  (s == STEP_MOREAUYOSIDAPENALTY) ||
288  (s == STEP_PRIMALDUALACTIVESET) ||
289  (s == STEP_INTERIORPOINT) );
290  break;
291 
292  case TYPE_E: comp = ( (s == STEP_COMPOSITESTEP) ||
293  (s == STEP_AUGMENTEDLAGRANGIAN) ||
294  (s == STEP_FLETCHER) );
295  break;
296 
297  case TYPE_EB: comp = ( (s == STEP_AUGMENTEDLAGRANGIAN) ||
298  (s == STEP_MOREAUYOSIDAPENALTY) ||
299  (s == STEP_INTERIORPOINT) ||
300  (s == STEP_FLETCHER) );
301  break;
302 
303  case TYPE_LAST: comp = false; break;
304  default: comp = false;
305  }
306  return comp;
307  }
308 
309  inline std::string EProblemToString( EProblem p ) {
310  std::string retString;
311  switch(p) {
312  case TYPE_U: retString = "Type-U"; break;
313  case TYPE_P: retString = "Type-P"; break;
314  case TYPE_E: retString = "Type-E"; break;
315  case TYPE_B: retString = "Type-B"; break;
316  case TYPE_EB: retString = "Type-EB"; break;
317  case TYPE_LAST: retString = "Type-Last (Dummy)"; break;
318  default: retString = "Invalid EProblem";
319  }
320  return retString;
321  }
322 
323 
329  inline int isValidStep(EStep ls) {
330  return( (ls == STEP_AUGMENTEDLAGRANGIAN) ||
331  (ls == STEP_BUNDLE) ||
332  (ls == STEP_COMPOSITESTEP) ||
333  (ls == STEP_LINESEARCH) ||
334  (ls == STEP_MOREAUYOSIDAPENALTY) ||
335  (ls == STEP_PRIMALDUALACTIVESET) ||
336  (ls == STEP_TRUSTREGION) ||
337  (ls == STEP_INTERIORPOINT) ||
338  (ls == STEP_FLETCHER) ) ;
339  }
340 
341  inline EStep & operator++(EStep &type) {
342  return type = static_cast<EStep>(type+1);
343  }
344 
345  inline EStep operator++(EStep &type, int) {
346  EStep oldval = type;
347  ++type;
348  return oldval;
349  }
350 
351  inline EStep & operator--(EStep &type) {
352  return type = static_cast<EStep>(type-1);
353  }
354 
355  inline EStep operator--(EStep &type, int) {
356  EStep oldval = type;
357  --type;
358  return oldval;
359  }
360 
361  inline EStep StringToEStep(std::string s) {
362  s = removeStringFormat(s);
363  for ( EStep st = STEP_AUGMENTEDLAGRANGIAN; st < STEP_LAST; ++st ) {
364  if ( !s.compare(removeStringFormat(EStepToString(st))) ) {
365  return st;
366  }
367  }
368  return STEP_LAST;
369  }
370 
381  enum EDescent{
388  };
389 
390  inline std::string EDescentToString(EDescent tr) {
391  std::string retString;
392  switch(tr) {
393  case DESCENT_STEEPEST: retString = "Steepest Descent"; break;
394  case DESCENT_NONLINEARCG: retString = "Nonlinear CG"; break;
395  case DESCENT_SECANT: retString = "Quasi-Newton Method"; break;
396  case DESCENT_NEWTON: retString = "Newton's Method"; break;
397  case DESCENT_NEWTONKRYLOV: retString = "Newton-Krylov"; break;
398  case DESCENT_LAST: retString = "Last Type (Dummy)"; break;
399  default: retString = "INVALID ESecant";
400  }
401  return retString;
402  }
403 
409  inline int isValidDescent(EDescent d){
410  return( (d == DESCENT_STEEPEST) ||
411  (d == DESCENT_NONLINEARCG) ||
412  (d == DESCENT_SECANT) ||
413  (d == DESCENT_NEWTON) ||
414  (d == DESCENT_NEWTONKRYLOV)
415  );
416  }
417 
418  inline EDescent & operator++(EDescent &type) {
419  return type = static_cast<EDescent>(type+1);
420  }
421 
422  inline EDescent operator++(EDescent &type, int) {
423  EDescent oldval = type;
424  ++type;
425  return oldval;
426  }
427 
428  inline EDescent & operator--(EDescent &type) {
429  return type = static_cast<EDescent>(type-1);
430  }
431 
432  inline EDescent operator--(EDescent &type, int) {
433  EDescent oldval = type;
434  --type;
435  return oldval;
436  }
437 
438  inline EDescent StringToEDescent(std::string s) {
439  s = removeStringFormat(s);
440  for ( EDescent des = DESCENT_STEEPEST; des < DESCENT_LAST; des++ ) {
441  if ( !s.compare(removeStringFormat(EDescentToString(des))) ) {
442  return des;
443  }
444  }
445  return DESCENT_SECANT;
446  }
447 
456  enum ESecant{
463  };
464 
465  inline std::string ESecantToString(ESecant tr) {
466  std::string retString;
467  switch(tr) {
468  case SECANT_LBFGS: retString = "Limited-Memory BFGS"; break;
469  case SECANT_LDFP: retString = "Limited-Memory DFP"; break;
470  case SECANT_LSR1: retString = "Limited-Memory SR1"; break;
471  case SECANT_BARZILAIBORWEIN: retString = "Barzilai-Borwein"; break;
472  case SECANT_USERDEFINED: retString = "User-Defined"; break;
473  case SECANT_LAST: retString = "Last Type (Dummy)"; break;
474  default: retString = "INVALID ESecant";
475  }
476  return retString;
477  }
478 
484  inline int isValidSecant(ESecant s) {
485  return( (s == SECANT_LBFGS) ||
486  (s == SECANT_LDFP) ||
487  (s == SECANT_LSR1) ||
488  (s == SECANT_BARZILAIBORWEIN) ||
489  (s == SECANT_USERDEFINED)
490  );
491  }
492 
493  inline ESecant & operator++(ESecant &type) {
494  return type = static_cast<ESecant>(type+1);
495  }
496 
497  inline ESecant operator++(ESecant &type, int) {
498  ESecant oldval = type;
499  ++type;
500  return oldval;
501  }
502 
503  inline ESecant & operator--(ESecant &type) {
504  return type = static_cast<ESecant>(type-1);
505  }
506 
507  inline ESecant operator--(ESecant &type, int) {
508  ESecant oldval = type;
509  --type;
510  return oldval;
511  }
512 
513  inline ESecant StringToESecant(std::string s) {
514  s = removeStringFormat(s);
515  for ( ESecant sec = SECANT_LBFGS; sec < SECANT_LAST; sec++ ) {
516  if ( !s.compare(removeStringFormat(ESecantToString(sec))) ) {
517  return sec;
518  }
519  }
520  return SECANT_LBFGS;
521  }
522 
548  };
549 
550  inline std::string ENonlinearCGToString(ENonlinearCG tr) {
551  std::string retString;
552  switch(tr) {
553  case NONLINEARCG_HESTENES_STIEFEL: retString = "Hestenes-Stiefel"; break;
554  case NONLINEARCG_FLETCHER_REEVES: retString = "Fletcher-Reeves"; break;
555  case NONLINEARCG_DANIEL: retString = "Daniel (uses Hessian)"; break;
556  case NONLINEARCG_POLAK_RIBIERE: retString = "Polak-Ribiere"; break;
557  case NONLINEARCG_FLETCHER_CONJDESC: retString = "Fletcher Conjugate Descent"; break;
558  case NONLINEARCG_LIU_STOREY: retString = "Liu-Storey"; break;
559  case NONLINEARCG_DAI_YUAN: retString = "Dai-Yuan"; break;
560  case NONLINEARCG_HAGER_ZHANG: retString = "Hager-Zhang"; break;
561  case NONLINEARCG_OREN_LUENBERGER: retString = "Oren-Luenberger"; break;
562  case NONLINEARCG_USERDEFINED: retString = "User Defined"; break;
563  case NONLINEARCG_LAST: retString = "Last Type (Dummy)"; break;
564  default: retString = "INVALID ENonlinearCG";
565  }
566  return retString;
567  }
568 
575  return( (s == NONLINEARCG_HESTENES_STIEFEL) ||
577  (s == NONLINEARCG_DANIEL) ||
578  (s == NONLINEARCG_POLAK_RIBIERE) ||
580  (s == NONLINEARCG_LIU_STOREY) ||
581  (s == NONLINEARCG_DAI_YUAN) ||
582  (s == NONLINEARCG_HAGER_ZHANG) ||
585  );
586  }
587 
589  return type = static_cast<ENonlinearCG>(type+1);
590  }
591 
592  inline ENonlinearCG operator++(ENonlinearCG &type, int) {
593  ENonlinearCG oldval = type;
594  ++type;
595  return oldval;
596  }
597 
599  return type = static_cast<ENonlinearCG>(type-1);
600  }
601 
602  inline ENonlinearCG operator--(ENonlinearCG &type, int) {
603  ENonlinearCG oldval = type;
604  --type;
605  return oldval;
606  }
607 
608  inline ENonlinearCG StringToENonlinearCG(std::string s) {
609  s = removeStringFormat(s);
610  for ( ENonlinearCG nlcg = NONLINEARCG_HESTENES_STIEFEL; nlcg < NONLINEARCG_LAST; nlcg++ ) {
611  if ( !s.compare(removeStringFormat(ENonlinearCGToString(nlcg))) ) {
612  return nlcg;
613  }
614  }
616  }
617 
638  };
639 
640  inline std::string ELineSearchToString(ELineSearch ls) {
641  std::string retString;
642  switch(ls) {
643  case LINESEARCH_ITERATIONSCALING: retString = "Iteration Scaling"; break;
644  case LINESEARCH_PATHBASEDTARGETLEVEL: retString = "Path-Based Target Level"; break;
645  case LINESEARCH_BACKTRACKING: retString = "Backtracking"; break;
646  case LINESEARCH_BISECTION: retString = "Bisection"; break;
647  case LINESEARCH_GOLDENSECTION: retString = "Golden Section"; break;
648  case LINESEARCH_CUBICINTERP: retString = "Cubic Interpolation"; break;
649  case LINESEARCH_BRENTS: retString = "Brent's"; break;
650  case LINESEARCH_USERDEFINED: retString = "User Defined"; break;
651  case LINESEARCH_LAST: retString = "Last Type (Dummy)"; break;
652  default: retString = "INVALID ELineSearch";
653  }
654  return retString;
655  }
656 
663  return( (ls == LINESEARCH_BACKTRACKING) ||
664  (ls == LINESEARCH_ITERATIONSCALING) ||
666  (ls == LINESEARCH_BISECTION) ||
667  (ls == LINESEARCH_GOLDENSECTION) ||
668  (ls == LINESEARCH_CUBICINTERP) ||
669  (ls == LINESEARCH_BRENTS) ||
670  (ls == LINESEARCH_USERDEFINED)
671  );
672  }
673 
675  return type = static_cast<ELineSearch>(type+1);
676  }
677 
678  inline ELineSearch operator++(ELineSearch &type, int) {
679  ELineSearch oldval = type;
680  ++type;
681  return oldval;
682  }
683 
685  return type = static_cast<ELineSearch>(type-1);
686  }
687 
688  inline ELineSearch operator--(ELineSearch &type, int) {
689  ELineSearch oldval = type;
690  --type;
691  return oldval;
692  }
693 
694  inline ELineSearch StringToELineSearch(std::string s) {
695  s = removeStringFormat(s);
696  for ( ELineSearch ls = LINESEARCH_ITERATIONSCALING; ls < LINESEARCH_LAST; ls++ ) {
697  if ( !s.compare(removeStringFormat(ELineSearchToString(ls))) ) {
698  return ls;
699  }
700  }
702  }
703 
719  };
720 
722  std::string retString;
723  switch(ls) {
724  case CURVATURECONDITION_WOLFE: retString = "Wolfe Conditions"; break;
725  case CURVATURECONDITION_STRONGWOLFE: retString = "Strong Wolfe Conditions"; break;
726  case CURVATURECONDITION_GENERALIZEDWOLFE: retString = "Generalized Wolfe Conditions"; break;
727  case CURVATURECONDITION_APPROXIMATEWOLFE: retString = "Approximate Wolfe Conditions"; break;
728  case CURVATURECONDITION_GOLDSTEIN: retString = "Goldstein Conditions"; break;
729  case CURVATURECONDITION_NULL: retString = "Null Curvature Condition"; break;
730  case CURVATURECONDITION_LAST: retString = "Last Type (Dummy)"; break;
731  default: retString = "INVALID ECurvatureCondition";
732  }
733  return retString;
734  }
735 
742  return( (ls == CURVATURECONDITION_WOLFE) ||
748  );
749  }
750 
752  return type = static_cast<ECurvatureCondition>(type+1);
753  }
754 
756  ECurvatureCondition oldval = type;
757  ++type;
758  return oldval;
759  }
760 
762  return type = static_cast<ECurvatureCondition>(type-1);
763  }
764 
766  ECurvatureCondition oldval = type;
767  --type;
768  return oldval;
769  }
770 
772  s = removeStringFormat(s);
774  if ( !s.compare(removeStringFormat(ECurvatureConditionToString(cc))) ) {
775  return cc;
776  }
777  }
779  }
780 
791  enum ECGFlag {
798  };
799 
800 
801  inline std::string ECGFlagToString(ECGFlag cgf) {
802  std::string retString;
803  switch(cgf) {
804  case CG_FLAG_SUCCESS:
805  retString = "Residual tolerance met";
806  break;
807  case CG_FLAG_ITEREXCEED:
808  retString = "Iteration limit exceeded";
809  break;
810  case CG_FLAG_NEGCURVE:
811  retString = "Negative curvature detected";
812  break;
813  case CG_FLAG_TRRADEX:
814  retString = "Trust-Region radius exceeded";
815  break;
816  case CG_FLAG_ZERORHS:
817  retString = "Initial right hand side is zero";
818  break;
819  default:
820  retString = "INVALID ECGFlag";
821  }
822  return retString;
823  }
824 
825 
826 
827  // For use in gradient and Hessian checks
828  namespace Finite_Difference_Arrays {
829 
830  // Finite difference steps in axpy form
831  const int shifts[4][4] = { { 1, 0, 0, 0 }, // First order
832  { -1, 2, 0, 0 }, // Second order
833  { -1, 2, 1, 0 }, // Third order
834  { -1, -1, 3, 1 } // Fourth order
835  };
836 
837  // Finite difference weights
838  const double weights[4][5] = { { -1.0, 1.0, 0.0, 0.0, 0.0 }, // First order
839  { 0.0, -1.0/2.0, 1.0/2.0, 0.0, 0.0 }, // Second order
840  { -1.0/2.0, -1.0/3.0, 1.0, -1.0/6.0, 0.0 }, // Third order
841  { 0.0, -2.0/3.0, 1.0/12.0, 2.0/3.0, -1.0/12.0 } // Fourth order
842  };
843 
844  }
845 
846 
847 // Generic conversion from Element type to Real type
848 template<class Real, class Element>
849 struct TypeCaster {
850  static Real ElementToReal( const Element &val ) {
851  return Real(0);
852  }
853 };
854 
855 // Partially specialize for complex<Real>
856 template<class Real>
857 struct TypeCaster<Real, std::complex<Real> > {
858  static Real ElementToReal( const std::complex<Real> &val ) {
859  return val.real();
860  }
861 };
862 
863 // Fully specialize for double,float
864 template<>
865 struct TypeCaster<double,float> {
866  static double ElementToReal( const float &val ) {
867  return static_cast<double>(val);
868  }
869 };
870 
871 // Cast from Element type to Real type
872 template<class Element, class Real>
873 Real rol_cast(const Element &val) {
875 }
876 
877 
878 
879 
880 
881 
882 namespace Exception {
883 
884 class NotImplemented : public std::logic_error {
885 public:
886  NotImplemented( const std::string& what_arg ) :
887  std::logic_error(what_arg) {}
888 
889 
890 }; // class NotImplemented
891 
892 
893 #if __cplusplus >= 201402L // using C++14
894 
895 using std::enable_if_t;
896 
897 #else // No C++14
898 
899 template<bool B, class T=void>
900 using enable_if_t = typename std::enable_if<B,T>::type;
901 
902 #endif
903 
904 
905 
906 
907 
908 } // namespace Exception
909 
910 
911 } // namespace ROL
912 
913 
1132 #endif
std::string ECGFlagToString(ECGFlag cgf)
Definition: ROL_Types.hpp:801
EStep StringToEStep(std::string s)
Definition: ROL_Types.hpp:361
static Real ElementToReal(const Element &val)
Definition: ROL_Types.hpp:850
int isValidSecant(ESecant s)
Verifies validity of a Secant enum.
Definition: ROL_Types.hpp:484
Real ROL_THRESHOLD(void)
Tolerance for various equality tests.
Definition: ROL_Types.hpp:63
const double weights[4][5]
Definition: ROL_Types.hpp:838
EExitStatus statusFlag
Definition: ROL_Types.hpp:126
EPolyProjAlgo & operator++(EPolyProjAlgo &type)
ELineSearch StringToELineSearch(std::string s)
Definition: ROL_Types.hpp:694
virtual ~AlgorithmState()
Definition: ROL_Types.hpp:138
Real ROL_INF(void)
Definition: ROL_Types.hpp:71
NotImplemented(const std::string &what_arg)
Definition: ROL_Types.hpp:886
std::string removeStringFormat(std::string s)
Definition: ROL_Types.hpp:215
ELineSearch
Enumeration of line-search types.
Definition: ROL_Types.hpp:628
ESecant StringToESecant(std::string s)
Definition: ROL_Types.hpp:513
std::string EDescentToString(EDescent tr)
Definition: ROL_Types.hpp:390
static Real ElementToReal(const std::complex< Real > &val)
Definition: ROL_Types.hpp:858
ECGFlag
Enumation of flags used by conjugate gradient methods.
Definition: ROL_Types.hpp:791
ROL::Ptr< Vector< Real > > gradientVec
Definition: ROL_Types.hpp:170
EDescent StringToEDescent(std::string s)
Definition: ROL_Types.hpp:438
State for algorithm class. Will be used for restarts.
Definition: ROL_Types.hpp:109
std::string NumberToString(T Number)
Definition: ROL_Types.hpp:47
ENonlinearCG
Enumeration of nonlinear CG algorithms.
Definition: ROL_Types.hpp:536
std::string ECurvatureConditionToString(ECurvatureCondition ls)
Definition: ROL_Types.hpp:721
Real rol_cast(const Element &val)
Definition: ROL_Types.hpp:873
std::string EExitStatusToString(EExitStatus tr)
Definition: ROL_Types.hpp:92
typename std::enable_if< B, T >::type enable_if_t
Definition: ROL_Types.hpp:900
EPolyProjAlgo & operator--(EPolyProjAlgo &type)
EExitStatus
Enum for algorithm termination.
Definition: ROL_Types.hpp:83
ESecant
Enumeration of secant update algorithms.
Definition: ROL_Types.hpp:456
ROL::Ptr< Vector< Real > > constraintVec
Definition: ROL_Types.hpp:172
ROL::Ptr< Vector< Real > > iterateVec
Definition: ROL_Types.hpp:123
std::string ENonlinearCGToString(ENonlinearCG tr)
Definition: ROL_Types.hpp:550
ENonlinearCG StringToENonlinearCG(std::string s)
Definition: ROL_Types.hpp:608
int isValidDescent(EDescent d)
Verifies validity of a Secant enum.
Definition: ROL_Types.hpp:409
std::string ELineSearchToString(ELineSearch ls)
Definition: ROL_Types.hpp:640
Real ROL_OVERFLOW(void)
Platform-dependent maximum double.
Definition: ROL_Types.hpp:68
int isValidLineSearch(ELineSearch ls)
Verifies validity of a LineSearch enum.
Definition: ROL_Types.hpp:662
State for step class. Will be used for restarts.
Definition: ROL_Types.hpp:169
std::string EProblemToString(EProblem p)
Definition: ROL_Types.hpp:309
int isValidStep(EStep ls)
Verifies validity of a TrustRegion enum.
Definition: ROL_Types.hpp:329
ROL::Ptr< Vector< Real > > descentVec
Definition: ROL_Types.hpp:171
static double ElementToReal(const float &val)
Definition: ROL_Types.hpp:866
int isValidCurvatureCondition(ECurvatureCondition ls)
Verifies validity of a CurvatureCondition enum.
Definition: ROL_Types.hpp:741
ECurvatureCondition
Enumeration of line-search curvature conditions.
Definition: ROL_Types.hpp:711
void reset(const Real searchSizeInput=1.0)
Definition: ROL_Types.hpp:190
ROL::Ptr< Vector< Real > > lagmultVec
Definition: ROL_Types.hpp:124
ECurvatureCondition StringToECurvatureCondition(std::string s)
Definition: ROL_Types.hpp:771
Real ROL_EPSILON(void)
Platform-dependent machine epsilon.
Definition: ROL_Types.hpp:57
ROL::Ptr< Vector< Real > > minIterVec
Definition: ROL_Types.hpp:125
std::string ESecantToString(ESecant tr)
Definition: ROL_Types.hpp:465
std::string EStepToString(EStep tr)
Definition: ROL_Types.hpp:256
EStep
Enumeration of step types.
Definition: ROL_Types.hpp:243
Real ROL_UNDERFLOW(void)
Platform-dependent minimum double.
Definition: ROL_Types.hpp:79
EProblem
Definition: ROL_Types.hpp:223
int isValidNonlinearCG(ENonlinearCG s)
Verifies validity of a NonlinearCG enum.
Definition: ROL_Types.hpp:574
EDescent
Enumeration of descent direction types.
Definition: ROL_Types.hpp:381
Real ROL_NINF(void)
Definition: ROL_Types.hpp:74
bool isCompatibleStep(EProblem p, EStep s)
Definition: ROL_Types.hpp:274