forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon_solver_option.h
42 lines (37 loc) · 1.46 KB
/
common_solver_option.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <ostream>
#include "drake/common/fmt_ostream.h"
namespace drake {
namespace solvers {
/**
* Some options can be applied to not one solver, but many solvers (for example,
* many solvers support printing out the progress in each iteration).
* CommonSolverOption contain the names of these supported options.
* The user can use these options as "key" in SolverOption::SetOption().
*/
enum class CommonSolverOption {
/** Many solvers support printing the progress of each iteration to a file.
* The user can call SolverOptions::SetOption(kPrintFileName, file_name) where
* file_name is a string. If the user doesn't want to print to a file, then
* use SolverOptions::SetOption(kPrintFileName, ""), where the empty string ""
* indicates no print.
*/
kPrintFileName,
/** Many solvers support printing the progress of each iteration to the
* console, the user can call SolverOptions::SetOption(kPrintToConsole, 1) to
* turn on printing to the console, or
* SolverOptions::SetOption(kPrintToConsole, 0) to turn off printing to the
* console.
*/
kPrintToConsole,
};
std::ostream& operator<<(std::ostream& os,
CommonSolverOption common_solver_option);
} // namespace solvers
} // namespace drake
// TODO(jwnimmer-tri) Add a real formatter and deprecate the operator<<.
namespace fmt {
template <>
struct formatter<drake::solvers::CommonSolverOption>
: drake::ostream_formatter {};
} // namespace fmt