OR-Tools  9.2
streamable_solver_init_arguments.h
Go to the documentation of this file.
1// Copyright 2010-2021 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14// This headers defines C++ wrappers of solver specific initialization
15// parameters that can be streamed to be exchanged with another process.
16//
17// Parameters that can't be streamed (for example instances of C/C++ types that
18// only exist in the process memory) are dealt with implementations of
19// the NonStreamableSolverInitArguments.
20#ifndef OR_TOOLS_MATH_OPT_CPP_STREAMABLE_SOLVER_INIT_ARGUMENTS_H_
21#define OR_TOOLS_MATH_OPT_CPP_STREAMABLE_SOLVER_INIT_ARGUMENTS_H_
22
23#include <cstdint>
24#include <optional>
25#include <string>
26
27#include "ortools/math_opt/parameters.pb.h"
28#include "ortools/math_opt/solvers/gurobi.pb.h"
29
30namespace operations_research {
31namespace math_opt {
32
33// Streamable Pdlp specific parameters for solver instantiation.
35
36// Streamable CpSat specific parameters for solver instantiation.
38
39// Streamable GScip specific parameters for solver instantiation.
41
42// Streamable Glop specific parameters for solver instantiation.
44
45// Streamable Glpk specific parameters for solver instantiation.
47
48// An ISV key for the Gurobi solver.
49//
50// See http://www.gurobi.com/products/licensing-pricing/isv-program.
52 std::string name;
53 std::string application_name;
54 int64_t expiration = 0;
55 std::string key;
56
57 GurobiInitializerProto::ISVKey Proto() const;
58};
59
60// Streamable Gurobi specific parameters for solver instantiation.
62 // An optional ISV key to use to instantiate the solver. This is ignored if a
63 // `master_env` is provided in `NonStreamableGurobiInitArguments`.
64 std::optional<GurobiISVKey> isv_key;
65
66 // Returns the proto corresponding to these parameters.
67 GurobiInitializerProto Proto() const;
68};
69
70// Solver specific initialization parameters that can be streamed to be
71// exchanged with another process.
72//
73// Parameters that can't be streamed (for example instances of C/C++ types that
74// only exist in the process memory) are dealt with implementations of
75// the NonStreamableSolverInitArguments.
77 std::optional<StreamableCpSatInitArguments> cp_sat;
78 std::optional<StreamableGScipInitArguments> gscip;
79 std::optional<StreamableGlopInitArguments> glop;
80 std::optional<StreamableGlpkInitArguments> glpk;
81 std::optional<StreamableGurobiInitArguments> gurobi;
82
83 // Returns the proto corresponding to these parameters.
84 SolverInitializerProto Proto() const;
85};
86
87} // namespace math_opt
88} // namespace operations_research
89
90#endif // OR_TOOLS_MATH_OPT_CPP_STREAMABLE_SOLVER_INIT_ARGUMENTS_H_
Collection of objects used to extend the Constraint Solver library.