OR-Tools  9.6
gurobi_init_arguments.cc
Go to the documentation of this file.
1 // Copyright 2010-2022 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 <string>
18 #include <type_traits>
19 
20 #include "absl/status/statusor.h"
21 #include "ortools/math_opt/solvers/gurobi.pb.h"
23 
24 namespace operations_research {
25 namespace math_opt {
26 
27 absl::StatusOr<GRBenvUniquePtr> NewPrimaryEnvironment(
28  std::optional<GurobiInitializerProto::ISVKey> proto_isv_key) {
29  std::optional<GurobiIsvKey> isv_key;
30  if (proto_isv_key.has_value()) {
31  GurobiIsvKey key;
32  key.name = proto_isv_key->name();
33  key.application_name = proto_isv_key->application_name();
34  key.expiration = proto_isv_key->expiration();
35  key.key = proto_isv_key->key();
36  isv_key = key;
37  }
38  return GurobiNewPrimaryEnv(isv_key);
39 }
40 
41 } // namespace math_opt
42 } // namespace operations_research
absl::StatusOr< GRBenvUniquePtr > NewPrimaryEnvironment(std::optional< GurobiInitializerProto::ISVKey > proto_isv_key)
absl::StatusOr< GRBenvUniquePtr > GurobiNewPrimaryEnv(const std::optional< GurobiIsvKey > &isv_key)
Definition: g_gurobi.cc:72
Collection of objects used to extend the Constraint Solver library.