20 #ifndef MIRTK_FreeFormTransformationIntegrationMethod_H 21 #define MIRTK_FreeFormTransformationIntegrationMethod_H 23 #include "mirtk/String.h" 34 FFDIM_RKE1, FFDIM_RKE2, FFDIM_RKH2, FFDIM_RK4,
35 FFDIM_RKEH12, FFDIM_RKBS23, FFDIM_RKF45, FFDIM_RKDP45, FFDIM_RKCK45,
36 FFDIM_SS, FFDIM_FastSS,
45 inline string ToString(
const FFDIM &m,
int w,
char c,
bool left)
49 case FFDIM_SS: str =
"SS";
break;
50 case FFDIM_FastSS: str =
"FastSS";
break;
51 case FFDIM_RKE1: str =
"RKE1";
break;
52 case FFDIM_RKE2: str =
"RKE2";
break;
53 case FFDIM_RKH2: str =
"RKH2";
break;
54 case FFDIM_RK4: str =
"RK4";
break;
55 case FFDIM_RKEH12: str =
"RKEH12";
break;
56 case FFDIM_RKBS23: str =
"RKBS23";
break;
57 case FFDIM_RKF45: str =
"RKF45";
break;
58 case FFDIM_RKDP45: str =
"RKDP45";
break;
59 case FFDIM_RKCK45: str =
"RKCK45";
break;
60 default: str =
"Unknown";
break;
71 const string lstr =
ToLower(str);
72 if (lstr ==
"scalingandsquaring") value = FFDIM_SS;
73 else if (lstr ==
"scaling and squaring") value = FFDIM_SS;
74 else if (lstr ==
"fastscalingandsquaring") value = FFDIM_FastSS;
75 else if (lstr ==
"fast scaling and squaring") value = FFDIM_FastSS;
76 else if (lstr ==
"euler") value = FFDIM_RKE1;
77 else if (lstr ==
"forwardeuler") value = FFDIM_RKE1;
78 else if (lstr ==
"forward euler") value = FFDIM_RKE1;
79 else if (lstr ==
"fwdeuler") value = FFDIM_RKE1;
80 else if (lstr ==
"modifiedeuler") value = FFDIM_RKE2;
81 else if (lstr ==
"modified euler") value = FFDIM_RKE2;
82 else if (lstr ==
"modeuler") value = FFDIM_RKE2;
83 else if (lstr ==
"heun") value = FFDIM_RKH2;
84 else if (lstr ==
"improvedeuler") value = FFDIM_RKH2;
85 else if (lstr ==
"improved euler") value = FFDIM_RKH2;
86 else if (lstr ==
"impeuler") value = FFDIM_RKH2;
87 else if (lstr ==
"rk1") value = FFDIM_RKE1;
88 else if (lstr ==
"rk2") value = FFDIM_RKH2;
89 else if (lstr ==
"rk12") value = FFDIM_RKEH12;
90 else if (lstr ==
"rk23") value = FFDIM_RKBS23;
91 else if (lstr ==
"rk45") value = FFDIM_RKCK45;
92 else value = FFDIM_Unknown;
94 if (value == FFDIM_Unknown) {
95 value =
static_cast<FFDIM
>(FFDIM_Last - 1);
96 while (value != FFDIM_Unknown) {
98 value =
static_cast<FFDIM
>(value - 1);
102 return (value != FFDIM_Unknown);
108 #endif // MIRTK_FreeFormTransformationIntegrationMethod_H bool iequal(char const *a, char const *b)
Case insensitive string comparison.
string ToLower(const string &)
Convert string to lowercase letters.
FFDIntegrationMethod
Enumeration of implemented numerical integration methods.
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.