29 bool scip_available();
30 const std::string& scip_unavailable_reason();
75 std::unique_ptr<SolverSettings>
clone()
const override
77 return std::make_unique<SCIPSettings>(*
this);
82 if (!detail::scip_available())
84 throw std::runtime_error(
"SCIPSettings: " + detail::scip_unavailable_reason());
92 ss <<
"SCIPSettings (unset fields use SCIP defaults):\n";
93 auto opt_int = [&](
const char*
n,
const std::optional<int>& v) {
if (v) ss <<
" " <<
n <<
" = " << *v <<
"\n"; };
94 auto opt_dbl = [&](
const char*
n,
const std::optional<double>& v) {
if (v) ss <<
" " <<
n <<
" = " << *v <<
"\n"; };
100 opt_dbl(
"MIPGap",
MIPGap);
104 opt_int(
"Seed",
Seed);
107 for (
const auto& kv :
bool_params) ss <<
" [bool] " << kv.first <<
" = " << (kv.second ?
"true" :
"false") <<
"\n";
108 for (
const auto& kv :
int_params) ss <<
" [int] " << kv.first <<
" = " << kv.second <<
"\n";
109 for (
const auto& kv :
longint_params) ss <<
" [longint] " << kv.first <<
" = " << kv.second <<
"\n";
110 for (
const auto& kv :
real_params) ss <<
" [real] " << kv.first <<
" = " << kv.second <<
"\n";
111 for (
const auto& kv :
char_params) ss <<
" [char] " << kv.first <<
" = '" << kv.second <<
"'\n";
112 for (
const auto& kv :
str_params) ss <<
" [str] " << kv.first <<
" = \"" << kv.second <<
"\"\n";
152 std::shared_ptr<ExternalSolverResults>
clone()
const override
154 return std::make_shared<SCIPSolverResults>(*
this);
159 std::stringstream ss;
160 ss <<
"SCIPSolverResults:\n";
161 ss <<
" status: " <<
status <<
"\n";
163 ss <<
" mip_gap: " <<
mip_gap <<
"\n";
int n
Definition GurobiSolver.cpp:86
Optimization settings and solution data structures for ZonoOpt library.
Definition ZonoOpt.hpp:51
Abstract base for external-solver-specific solution metadata.
Definition SolverDataStructures.hpp:271
Settings for the dynamically-loaded SCIP solver backend.
Definition SCIPSettings.hpp:44
SCIPSettings()
Construct a new SCIPSettings object.
Definition SCIPSettings.hpp:120
std::string solver_name() const override
Return name of the solver backend selected by this settings type, e.g., "ZonoOpt",...
Definition SCIPSettings.hpp:122
std::optional< double > MIPGapAbs
absolute MIP optimality gap ("limits/absgap")
Definition SCIPSettings.hpp:53
std::map< std::string, std::string > str_params
Definition SCIPSettings.hpp:72
std::string print() const
Definition SCIPSettings.hpp:89
std::map< std::string, char > char_params
Definition SCIPSettings.hpp:71
std::optional< double > TimeLimit
wall-clock time limit in seconds ("limits/time")
Definition SCIPSettings.hpp:46
std::map< std::string, double > real_params
Definition SCIPSettings.hpp:70
std::optional< double > FeasibilityTol
feasibility tolerance ("numerics/feastol")
Definition SCIPSettings.hpp:54
std::optional< int > SolutionLimit
stop after this many MIP solutions ("limits/solutions")
Definition SCIPSettings.hpp:48
std::map< std::string, bool > bool_params
Definition SCIPSettings.hpp:67
std::optional< int > Seed
random seed shift ("randomization/randomseedshift")
Definition SCIPSettings.hpp:58
std::optional< double > MemLimit
memory limit in MB ("limits/memory")
Definition SCIPSettings.hpp:47
std::optional< int > NodeLimit
max B&B nodes ("limits/totalnodes" → applied to "limits/nodes")
Definition SCIPSettings.hpp:49
std::map< std::string, int > int_params
Definition SCIPSettings.hpp:68
std::optional< int > Threads
worker threads ("parallel/maxnthreads"); SCIP default is sequential unless built with parallel
Definition SCIPSettings.hpp:57
std::optional< int > VerbLevel
SCIP verbosity 0..5 ("display/verblevel"); 0 = silent. SCIP default is 4.
Definition SCIPSettings.hpp:62
void verify_available() const override
Verify the solver backend selected by this settings type is usable.
Definition SCIPSettings.hpp:80
std::optional< double > MIPGap
relative MIP optimality gap ("limits/gap")
Definition SCIPSettings.hpp:52
std::unique_ptr< SolverSettings > clone() const override
Polymorphic copy. Must be overridden by every concrete subclass.
Definition SCIPSettings.hpp:75
std::map< std::string, long long > longint_params
Definition SCIPSettings.hpp:69
Solver-native solution metadata produced by the SCIP backend.
Definition SCIPSettings.hpp:136
int status
Raw SCIP_Status code (see SCIP's status enum; layout differs across versions).
Definition SCIPSettings.hpp:138
std::shared_ptr< ExternalSolverResults > clone() const override
Polymorphic copy; required so callers can deep-copy an OptSolution.
Definition SCIPSettings.hpp:152
double dual_bound
Best dual bound found (SCIPgetDualbound).
Definition SCIPSettings.hpp:147
long long node_count
Total branch-and-bound nodes explored (SCIPgetNTotalNodes).
Definition SCIPSettings.hpp:141
double mip_gap
Relative gap at termination (SCIPgetGap). +infinity if no primal bound found.
Definition SCIPSettings.hpp:144
int n_sols_pool
Number of feasible solutions in SCIP's solution storage at termination (SCIPgetNSols).
Definition SCIPSettings.hpp:150
std::string print() const override
Human-readable summary of the solver-specific fields.
Definition SCIPSettings.hpp:157
Abstract base for all solver settings.
Definition SolverDataStructures.hpp:38