20 #ifndef MIRTK_OptimizationMethod_H 21 #define MIRTK_OptimizationMethod_H 23 #include "mirtk/String.h" 37 OM_GradientDescentConstrained,
38 OM_SteepestGradientDescent,
39 OM_ConjugateGradientDescent,
54 case OM_DownhillDescent: str =
"DownhillDescent";
break;
55 case OM_GradientDescent: str =
"GradientDescent";
break;
56 case OM_GradientDescentConstrained: str =
"GradientDescentConstrained";
break;
57 case OM_SteepestGradientDescent: str =
"SteepestGradientDescent";
break;
58 case OM_ConjugateGradientDescent: str =
"ConjugateGradientDescent";
break;
59 case OM_ClosedForm: str =
"ClosedForm";
break;
60 case OM_LBFGS: str =
"LBFGS";
break;
61 case OM_LineSearch: str =
"LineSearch";
break;
65 default: str =
"Unknown";
break;
74 if (strcmp(str,
"DownhillDescent") == 0 ||
75 strcmp(str,
"Downhill") == 0) {
76 m = OM_DownhillDescent;
77 }
else if (strcmp(str,
"GradientDescent") == 0 ||
78 strcmp(str,
"GD") == 0) {
79 m = OM_GradientDescent;
80 }
else if (strcmp(str,
"ConstrainedGradientDescent") == 0 ||
81 strcmp(str,
"GradientDescentConstrained") == 0) {
82 m = OM_GradientDescentConstrained;
83 }
else if (strcmp(str,
"SteepestGradientDescent") == 0 ||
84 strcmp(str,
"SteepestGradient") == 0 ||
85 strcmp(str,
"SGD") == 0) {
86 m = OM_SteepestGradientDescent;
87 }
else if (strcmp(str,
"ConjugateGradientDescent") == 0 ||
88 strcmp(str,
"ConjugateGradient") == 0 ||
89 strcmp(str,
"CGD") == 0) {
90 m = OM_ConjugateGradientDescent;
91 }
else if (strcmp(str,
"ClosedForm") == 0) {
93 }
else if (strcmp(str,
"LBFGS") == 0) {
95 }
else if (strcmp(str,
"LineSearch") == 0) {
97 }
else if (strcmp(str,
"EulerMethod") == 0) {
99 }
else if (strcmp(str,
"EulerMethodWithDamping") == 0) {
101 }
else if (strcmp(str,
"EulerMethodWithMomentum") == 0) {
118 return std::hash<int>()(enum_value);
126 #endif // MIRTK_OptimizationMethod_H
Explicit Euler method for deformable surface models.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
Explicit Euler method with momentum for deformable surface models.
OptimizationMethod
Enumeration of available optimization methods.
Explicit Euler method with momentum for deformable surface models.