OR-Tools  9.3
gurobi_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
18#include "absl/status/statusor.h"
19#include "ortools/math_opt/solvers/gurobi.pb.h"
20
21namespace operations_research {
22namespace math_opt {
23
24absl::StatusOr<GRBenvUniquePtr> NewMasterEnvironment(
25 std::optional<GurobiInitializerProto::ISVKey> proto_isv_key) {
26 std::optional<GurobiIsvKey> isv_key;
27 if (proto_isv_key.has_value()) {
28 GurobiIsvKey key;
29 key.name = proto_isv_key->name();
30 key.application_name = proto_isv_key->application_name();
31 key.expiration = proto_isv_key->expiration();
32 key.key = proto_isv_key->key();
33 isv_key = key;
34 }
35 return GurobiNewMasterEnv(isv_key);
36}
37
38} // namespace math_opt
39} // namespace operations_research
absl::StatusOr< GRBenvUniquePtr > NewMasterEnvironment(std::optional< GurobiInitializerProto::ISVKey > proto_isv_key)
absl::StatusOr< GRBenvUniquePtr > GurobiNewMasterEnv(const std::optional< GurobiIsvKey > &isv_key)
Definition: g_gurobi.cc:66
Collection of objects used to extend the Constraint Solver library.