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