1#ifndef ZONOOPT_SCIP_SETTINGS_HPP_
2#define ZONOOPT_SCIP_SETTINGS_HPP_
30 bool scip_available();
31 const std::string& scip_unavailable_reason();
76 std::unique_ptr<SolverSettings>
clone()
const override
78 return std::make_unique<SCIPSettings>(*
this);
83 if (!detail::scip_available())
85 throw std::runtime_error(
"SCIPSettings: " + detail::scip_unavailable_reason());
93 ss <<
"SCIPSettings (unset fields use SCIP defaults):\n";
94 auto opt_int = [&](
const char*
n,
const std::optional<int>& v) {
if (v) ss <<
" " <<
n <<
" = " << *v <<
"\n"; };
95 auto opt_dbl = [&](
const char*
n,
const std::optional<double>& v) {
if (v) ss <<
" " <<
n <<
" = " << *v <<
"\n"; };
101 opt_dbl(
"MIPGap",
MIPGap);
105 opt_int(
"Seed",
Seed);
108 for (
const auto& kv :
bool_params) ss <<
" [bool] " << kv.first <<
" = " << (kv.second ?
"true" :
"false") <<
"\n";
109 for (
const auto& kv :
int_params) ss <<
" [int] " << kv.first <<
" = " << kv.second <<
"\n";
110 for (
const auto& kv :
longint_params) ss <<
" [longint] " << kv.first <<
" = " << kv.second <<
"\n";
111 for (
const auto& kv :
real_params) ss <<
" [real] " << kv.first <<
" = " << kv.second <<
"\n";
112 for (
const auto& kv :
char_params) ss <<
" [char] " << kv.first <<
" = '" << kv.second <<
"'\n";
113 for (
const auto& kv :
str_params) ss <<
" [str] " << kv.first <<
" = \"" << kv.second <<
"\"\n";
153 std::shared_ptr<ExternalSolverResults>
clone()
const override
155 return std::make_shared<SCIPSolverResults>(*
this);
160 std::stringstream ss;
161 ss <<
"SCIPSolverResults:\n";
162 ss <<
" status: " <<
status <<
"\n";
164 ss <<
" mip_gap: " <<
mip_gap <<
"\n";
int n
Definition GurobiSolver.cpp:83
Optimization settings and solution data structures for ZonoOpt library.
Definition ZonoOpt.hpp:58
Abstract base for external-solver-specific solution metadata.
Definition SolverDataStructures.hpp:267
Settings for the dynamically-loaded SCIP solver backend.
Definition SCIPSettings.hpp:45
SCIPSettings()
Construct a new SCIPSettings object.
Definition SCIPSettings.hpp:121
std::string solver_name() const override
Return name of the solver backend selected by this settings type, e.g., "ZonoOpt",...
Definition SCIPSettings.hpp:123
std::optional< double > MIPGapAbs
absolute MIP optimality gap ("limits/absgap")
Definition SCIPSettings.hpp:54
std::map< std::string, std::string > str_params
Definition SCIPSettings.hpp:73
std::string print() const
Definition SCIPSettings.hpp:90
std::map< std::string, char > char_params
Definition SCIPSettings.hpp:72
std::optional< double > TimeLimit
wall-clock time limit in seconds ("limits/time")
Definition SCIPSettings.hpp:47
std::map< std::string, double > real_params
Definition SCIPSettings.hpp:71
std::optional< double > FeasibilityTol
feasibility tolerance ("numerics/feastol")
Definition SCIPSettings.hpp:55
std::optional< int > SolutionLimit
stop after this many MIP solutions ("limits/solutions")
Definition SCIPSettings.hpp:49
std::map< std::string, bool > bool_params
Definition SCIPSettings.hpp:68
std::optional< int > Seed
random seed shift ("randomization/randomseedshift")
Definition SCIPSettings.hpp:59
std::optional< double > MemLimit
memory limit in MB ("limits/memory")
Definition SCIPSettings.hpp:48
std::optional< int > NodeLimit
max B&B nodes ("limits/totalnodes" → applied to "limits/nodes")
Definition SCIPSettings.hpp:50
std::map< std::string, int > int_params
Definition SCIPSettings.hpp:69
std::optional< int > Threads
worker threads ("parallel/maxnthreads"); SCIP default is sequential unless built with parallel
Definition SCIPSettings.hpp:58
std::optional< int > VerbLevel
SCIP verbosity 0..5 ("display/verblevel"); 0 = silent. SCIP default is 4.
Definition SCIPSettings.hpp:63
void verify_available() const override
Verify the solver backend selected by this settings type is usable.
Definition SCIPSettings.hpp:81
std::optional< double > MIPGap
relative MIP optimality gap ("limits/gap")
Definition SCIPSettings.hpp:53
std::unique_ptr< SolverSettings > clone() const override
Polymorphic copy. Must be overridden by every concrete subclass.
Definition SCIPSettings.hpp:76
std::map< std::string, long long > longint_params
Definition SCIPSettings.hpp:70
Solver-native solution metadata produced by the SCIP backend.
Definition SCIPSettings.hpp:137
int status
Raw SCIP_Status code (see SCIP's status enum; layout differs across versions).
Definition SCIPSettings.hpp:139
std::shared_ptr< ExternalSolverResults > clone() const override
Polymorphic copy; required so callers can deep-copy an OptSolution.
Definition SCIPSettings.hpp:153
double dual_bound
Best dual bound found (SCIPgetDualbound).
Definition SCIPSettings.hpp:148
long long node_count
Total branch-and-bound nodes explored (SCIPgetNTotalNodes).
Definition SCIPSettings.hpp:142
double mip_gap
Relative gap at termination (SCIPgetGap). +infinity if no primal bound found.
Definition SCIPSettings.hpp:145
int n_sols_pool
Number of feasible solutions in SCIP's solution storage at termination (SCIPgetNSols).
Definition SCIPSettings.hpp:151
std::string print() const override
Human-readable summary of the solver-specific fields.
Definition SCIPSettings.hpp:158
Abstract base for all solver settings.
Definition SolverDataStructures.hpp:35