Google OR-Tools
v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
solver_init_arguments.h
Go to the documentation of this file.
1
// Copyright 2010-2024 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
// IWYU pragma: private, include "ortools/math_opt/cpp/math_opt.h"
15
// IWYU pragma: friend "ortools/math_opt/cpp/.*"
16
17
#ifndef OR_TOOLS_MATH_OPT_CPP_SOLVER_INIT_ARGUMENTS_H_
18
#define OR_TOOLS_MATH_OPT_CPP_SOLVER_INIT_ARGUMENTS_H_
19
20
#include "
ortools/math_opt/core/non_streamable_solver_init_arguments.h
"
// IWYU pragma: export
21
#include "
ortools/math_opt/cpp/streamable_solver_init_arguments.h
"
// IWYU pragma: export
22
23
namespace
operations_research::math_opt
{
24
25
// Arguments passed to Solve() and NewIncrementalSolver() to control the
26
// instantiation of the solver.
27
//
28
// Usage with streamable arguments:
29
//
30
// Solve(model, SOLVER_TYPE_GUROBI, /*solver_args=*/{},
31
// SolverInitArguments{
32
// .streamable = {
33
// .gurobi = StreamableGurobiInitArguments{
34
// .isv_key = GurobiISVKey{
35
// .name = "some name",
36
// .application_name = "some app name",
37
// .expiration = -1,
38
// .key = "random",
39
// }
40
// }
41
// }
42
// });
43
//
44
// Usage with non-streamable arguments:
45
//
46
// NonStreamableGurobiInitArguments gurobi_args;
47
// gurobi_args.primary_env = primary_env.get();
48
//
49
// Solve(model, SOLVER_TYPE_GUROBI, /*solver_args=*/{},
50
// SolverInitArguments{.non_streamable = gurobi_args});
51
//
52
struct
SolverInitArguments
{
53
// Solver initialization parameters that can be streamed to be exchanged with
54
// another process.
55
StreamableSolverInitArguments
streamable
;
56
57
// Solver specific initialization parameters that can't be streamed. This
58
// should either be the solver specific class or be unset.
59
//
60
// Solvers will fail (by returning an absl::Status) if called with arguments
61
// for another solver.
62
NonStreamableSolverInitArgumentsValue
non_streamable
;
63
64
// If true, the names of variables and constraints are discarded before
65
// sending them to the solver. This is particularly useful for models that
66
// need to be serialized and are near the two gigabyte limit in proto form.
67
bool
remove_names
=
false
;
68
};
69
70
}
// namespace operations_research::math_opt
71
72
#endif
// OR_TOOLS_MATH_OPT_CPP_SOLVER_INIT_ARGUMENTS_H_
operations_research::math_opt::NonStreamableSolverInitArgumentsValue
Definition
non_streamable_solver_init_arguments.h:142
operations_research::math_opt
An object oriented wrapper for quadratic constraints in ModelStorage.
Definition
gurobi_isv.cc:28
non_streamable_solver_init_arguments.h
streamable_solver_init_arguments.h
operations_research::math_opt::SolverInitArguments
Definition
solver_init_arguments.h:52
operations_research::math_opt::SolverInitArguments::streamable
StreamableSolverInitArguments streamable
Definition
solver_init_arguments.h:55
operations_research::math_opt::SolverInitArguments::remove_names
bool remove_names
Definition
solver_init_arguments.h:67
operations_research::math_opt::SolverInitArguments::non_streamable
NonStreamableSolverInitArgumentsValue non_streamable
Definition
solver_init_arguments.h:62
operations_research::math_opt::StreamableSolverInitArguments
Definition
streamable_solver_init_arguments.h:86
ortools
math_opt
cpp
solver_init_arguments.h
Generated by
1.12.0