6#include "delpi/util/Config.h"
12#include "delpi/util/error.h"
13#include "delpi/util/filesystem.h"
16Config::Config(std::string filename) : filename_{std::move(filename)} {}
17Config::Config(
const bool read_from_stdin) : read_from_stdin_{read_from_stdin} {}
18Config::Config(
const Format format) : format_{format} {}
20std::string Config::filename_extension()
const {
return GetExtension(filename_.get()); }
23 switch (lp_mode_.get()) {
27 return lp_mode_.get();
31 switch (format_.get()) {
33 if (filename_extension() ==
"mps") {
36 if (filename_extension() ==
"lp") {
39 DELPI_RUNTIME_ERROR(
"Cannot determine format from stdin or unknown file extension");
45std::ostream &operator<<(std::ostream &os,
const Config::LpSolver &lp_solver) {
48 return os <<
"qsoptex";
50 return os <<
"soplex";
56std::ostream &operator<<(std::ostream &os,
const Config::Format &format) {
69std::ostream &operator<<(std::ostream &os,
const Config::LpMode &mode) {
84std::ostream &operator<<(std::ostream &os,
const Config &config) {
85 return os <<
"Config {\n"
86 <<
"csv = " << config.csv() <<
",\n"
87 <<
"continuous_output = " << config.continuous_output() <<
",\n"
88 <<
"debug_parsing = " << config.debug_parsing() <<
",\n"
89 <<
"dry_run = " << config.dry_run() <<
",\n"
90 <<
"delta = " << config.delta() <<
",\n"
91 <<
"filename = '" << config.filename() <<
"',\n"
92 <<
"format = '" << config.format() <<
"',\n"
93 <<
"lp_mode = '" << config.lp_mode() <<
"',\n"
94 <<
"lp_solver = " << config.lp_solver() <<
",\n"
95 <<
"number_of_jobs = " << config.number_of_jobs() <<
",\n"
96 <<
"skip_optimise = '" << config.skip_optimise() <<
"',\n"
97 <<
"produce_model = " << config.produce_models() <<
",\n"
98 <<
"random_seed = " << config.random_seed() <<
",\n"
99 <<
"read_from_stdin = " << config.read_from_stdin() <<
",\n"
100 <<
"silent = " << config.silent() <<
",\n"
101 <<
"timeout = " << config.timeout() <<
",\n"
102 <<
"verbose_delpi = " << config.verbose_delpi() <<
",\n"
103 <<
"verbose_simplex = " << config.verbose_simplex() <<
",\n"
104 <<
"verify = " << config.verify() <<
",\n"
105 <<
"with_timings = " << config.with_timings() <<
",\n"
Simple dataclass used to store the configuration of the program.
LpSolver
Underlying LP solver used by the theory solver.
@ SOPLEX
Soplex Solver. Default option.
LpMode
LP mode used by the LP solver.
@ HYBRID
Use both modes, if available.
@ PURE_PRECISION_BOOSTING
Use the precision boosting mode, if available.
@ AUTO
Let the LP solver choose the mode. Default option.
@ PURE_ITERATIVE_REFINEMENT
Use the iterative refinement mode, if available.
Format
Format of the input file.
@ AUTO
Automatically detect the input format based on the file extension. Default option.
Global namespace for the delpi library.
std::string GetExtension(const std::string &name)
Get the extension of the file.