Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
solver_interface.h File Reference
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "absl/base/attributes.h"
#include "absl/container/flat_hash_map.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "ortools/math_opt/callback.pb.h"
#include "ortools/math_opt/core/non_streamable_solver_init_arguments.h"
#include "ortools/math_opt/infeasible_subsystem.pb.h"
#include "ortools/math_opt/model.pb.h"
#include "ortools/math_opt/model_parameters.pb.h"
#include "ortools/math_opt/model_update.pb.h"
#include "ortools/math_opt/parameters.pb.h"
#include "ortools/math_opt/result.pb.h"
#include "ortools/util/solve_interrupter.h"

Go to the source code of this file.

Classes

class  operations_research::math_opt::SolverInterface
 
struct  operations_research::math_opt::SolverInterface::InitArgs
 Initialization arguments. More...
 
class  operations_research::math_opt::AllSolversRegistry
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::math_opt
 An object oriented wrapper for quadratic constraints in ModelStorage.
 

Macros

#define MATH_OPT_REGISTER_SOLVER(solver_type, solver_factory)
 

Macro Definition Documentation

◆ MATH_OPT_REGISTER_SOLVER

#define MATH_OPT_REGISTER_SOLVER ( solver_type,
solver_factory )
Value:
namespace { \
const void* const kRegisterSolver ABSL_ATTRIBUTE_UNUSED = [] { \
AllSolversRegistry::Instance()->Register(solver_type, solver_factory); \
return nullptr; \
}(); \
}

Use to ensure that a solver is registered exactly one time. Invoke in each cc file implementing a SolverInterface. Example use:

MATH_OPT_REGISTER_SOLVER(SOLVER_TYPE_GSCIP, GScipSolver::New)

Can only be used once per cc file.

Arguments: solver_type: A SolverTypeProto proto enum. solver_factory: A SolverInterface::Factory for solver_type.

Definition at line 204 of file solver_interface.h.