Google OR-Tools
v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
compute_infeasible_subsystem_arguments.h
Go to the documentation of this file.
1
// Copyright 2010-2025 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
#ifndef ORTOOLS_MATH_OPT_CPP_COMPUTE_INFEASIBLE_SUBSYSTEM_ARGUMENTS_H_
15
#define ORTOOLS_MATH_OPT_CPP_COMPUTE_INFEASIBLE_SUBSYSTEM_ARGUMENTS_H_
16
17
#include "absl/base/nullability.h"
18
#include "
ortools/math_opt/cpp/message_callback.h
"
// IWYU pragma: export
19
#include "
ortools/math_opt/cpp/parameters.h
"
// IWYU pragma: export
20
#include "
ortools/util/solve_interrupter.h
"
// IWYU pragma: export
21
22
namespace
operations_research::math_opt
{
23
24
// Arguments passed to ComputeInfeasibleSubsystem() to control the solver.
25
struct
ComputeInfeasibleSubsystemArguments
{
26
// Model independent parameters, e.g. time limit.
27
SolveParameters
parameters
;
28
29
// An optional callback for messages emitted by the solver.
30
//
31
// When set it enables the solver messages and ignores the `enable_output` in
32
// solve parameters; messages are redirected to the callback and not printed
33
// on stdout/stderr/logs anymore.
34
//
35
// See PrinterMessageCallback() for logging to stdout/stderr.
36
//
37
// Usage:
38
//
39
// // To print messages to stdout with a prefix.
40
// ASSIGN_OR_RETURN(
41
// const ComputeInfeasibleSubsystemResult result,
42
// ComputeInfeasibleSubsystem(model, SolverType::kGurobi,
43
// { .message_callback = PrinterMessageCallback(std::cout,
44
// "logs| "); });
45
MessageCallback
message_callback
=
nullptr
;
46
47
// An optional interrupter that the solver can use to interrupt the solve
48
// early.
49
//
50
// Usage:
51
// auto interrupter = std::make_shared<SolveInterrupter>();
52
//
53
// // Use another thread to trigger the interrupter.
54
// RunInOtherThread([interrupter](){
55
// ... wait for something that should interrupt the solve ...
56
// interrupter->Interrupt();
57
// });
58
//
59
// ASSIGN_OR_RETURN(const ComputeInfeasibleSubsystemResult result,
60
// ComputeInfeasibleSubsystem(model, SolverType::kGurobi,
61
// { .interrupter = interrupter.get() });
62
//
63
const
SolveInterrupter
* absl_nullable
interrupter
=
nullptr
;
64
};
65
66
}
// namespace operations_research::math_opt
67
68
#endif
// ORTOOLS_MATH_OPT_CPP_COMPUTE_INFEASIBLE_SUBSYSTEM_ARGUMENTS_H_
operations_research::SolveInterrupter
Definition
solve_interrupter.h:37
message_callback.h
operations_research::math_opt
Definition
gurobi_isv.cc:28
operations_research::math_opt::MessageCallback
std::function< void(const std::vector< std::string > &)> MessageCallback
Definition
message_callback.h:40
parameters.h
solve_interrupter.h
operations_research::math_opt::ComputeInfeasibleSubsystemArguments
Definition
compute_infeasible_subsystem_arguments.h:25
operations_research::math_opt::ComputeInfeasibleSubsystemArguments::interrupter
const SolveInterrupter *absl_nullable interrupter
Definition
compute_infeasible_subsystem_arguments.h:63
operations_research::math_opt::ComputeInfeasibleSubsystemArguments::message_callback
MessageCallback message_callback
Definition
compute_infeasible_subsystem_arguments.h:45
operations_research::math_opt::ComputeInfeasibleSubsystemArguments::parameters
SolveParameters parameters
Definition
compute_infeasible_subsystem_arguments.h:27
operations_research::math_opt::SolveParameters
Definition
parameters.h:308
ortools
math_opt
cpp
compute_infeasible_subsystem_arguments.h
Generated by
1.15.0