OR-Tools  9.2
streamable_solver_init_arguments.cc
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
15
16#include <optional>
17#include <type_traits>
18
19#include "ortools/math_opt/parameters.pb.h"
20#include "ortools/math_opt/solvers/gurobi.pb.h"
21
22namespace operations_research {
23namespace math_opt {
24
25GurobiInitializerProto::ISVKey GurobiISVKey::Proto() const {
26 GurobiInitializerProto::ISVKey isv_key_proto;
27 isv_key_proto.set_name(name);
28 isv_key_proto.set_application_name(application_name);
29 isv_key_proto.set_expiration(expiration);
30 isv_key_proto.set_key(key);
31 return isv_key_proto;
32}
33
34GurobiInitializerProto StreamableGurobiInitArguments::Proto() const {
35 GurobiInitializerProto params_proto;
36
37 if (isv_key) {
38 *params_proto.mutable_isv_key() = isv_key->Proto();
39 }
40
41 return params_proto;
42}
43
44SolverInitializerProto StreamableSolverInitArguments::Proto() const {
45 SolverInitializerProto params_proto;
46
47 if (gurobi) {
48 *params_proto.mutable_gurobi() = gurobi->Proto();
49 }
50
51 return params_proto;
52}
53
54} // namespace math_opt
55} // namespace operations_research
Collection of objects used to extend the Constraint Solver library.