mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add some missing string-to-enum-to-string convertors.
LoggingTypeToString StringtoLoggingType DumpFormatTypeToString StringtoDumpFormatType Fixes https://github.com/ceres-solver/ceres-solver/issues/470 Change-Id: Ic7eb98dada008c869a686fbdf2c7ff9ab81dad54
This commit is contained in:
@@ -498,6 +498,12 @@ CERES_EXPORT bool StringToNumericDiffMethodType(
|
||||
std::string value,
|
||||
NumericDiffMethodType* type);
|
||||
|
||||
CERES_EXPORT const char* LoggingTypeToString(LoggingType type);
|
||||
CERES_EXPORT bool StringtoLoggingType(std::string value, LoggingType* type);
|
||||
|
||||
CERES_EXPORT const char* DumpFormatTypeToString(DumpFormatType type);
|
||||
CERES_EXPORT bool StringtoDumpFormatType(std::string value, LoggingType* type);
|
||||
|
||||
CERES_EXPORT const char* TerminationTypeToString(TerminationType type);
|
||||
|
||||
CERES_EXPORT bool IsSchurType(LinearSolverType type);
|
||||
|
||||
@@ -336,6 +336,39 @@ const char* TerminationTypeToString(TerminationType type) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* LoggingTypeToString(LoggingType type) {
|
||||
switch (type) {
|
||||
CASESTR(SILENT);
|
||||
CASESTR(PER_MINIMIZER_ITERATION);
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
bool StringtoLoggingType(std::string value, LoggingType* type) {
|
||||
UpperCase(&value);
|
||||
STRENUM(SILENT);
|
||||
STRENUM(PER_MINIMIZER_ITERATION);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char* DumpFormatTypeToString(DumpFormatType type) {
|
||||
switch (type) {
|
||||
CASESTR(CONSOLE);
|
||||
CASESTR(TEXTFILE);
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
bool StringtoDumpFormatType(std::string value, DumpFormatType* type) {
|
||||
UpperCase(&value);
|
||||
STRENUM(CONSOLE);
|
||||
STRENUM(TEXTFILE);
|
||||
return false;
|
||||
}
|
||||
|
||||
#undef CASESTR
|
||||
#undef STRENUM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user