Google OR-Tools
v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
glop_proto_solver.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_LINEAR_SOLVER_PROTO_SOLVER_GLOP_PROTO_SOLVER_H_
15
#define ORTOOLS_LINEAR_SOLVER_PROTO_SOLVER_GLOP_PROTO_SOLVER_H_
16
17
#include <atomic>
18
#include <functional>
19
#include <string>
20
21
#include "
ortools/glop/parameters.pb.h
"
22
#include "
ortools/linear_solver/linear_solver.pb.h
"
23
#include "
ortools/util/lazy_mutable_copy.h
"
24
25
namespace
operations_research
{
26
27
// Solve the input LP model with the GLOP solver.
28
//
29
// If possible, std::move the request into this function call to avoid a copy.
30
//
31
// If you need to change the solver parameters, please use the
32
// EncodeParametersAsString() function to set the solver_specific_parameters
33
// field.
34
//
35
// The optional interrupt_solve can be used to interrupt the solve early. It
36
// must only be set to true, never reset to false. It is also used internally by
37
// the solver that will set it to true for its own internal logic. As a
38
// consequence the caller should ignore the stored value and should not use the
39
// same atomic for different concurrent calls.
40
//
41
// The optional logging_callback will be called when the GLOP parameter
42
// log_search_progress is set to true. Passing a callback will disable the
43
// default logging to INFO. Note though that by default the GLOP parameter
44
// log_to_stdout is true so even with a callback, the logs will appear on stdout
45
// too unless log_to_stdout is set to false. The enable_internal_solver_output
46
// in the request will act as the GLOP parameter log_search_progress.
47
MPSolutionResponse
GlopSolveProto
(
48
LazyMutableCopy<MPModelRequest>
request,
49
std::atomic<bool>* interrupt_solve =
nullptr
,
50
std::function<
void
(
const
std::string&)> logging_callback =
nullptr
);
51
52
// Returns a string that describes the version of the GLOP solver.
53
std::string
GlopSolverVersion
();
54
55
}
// namespace operations_research
56
57
#endif
// ORTOOLS_LINEAR_SOLVER_PROTO_SOLVER_GLOP_PROTO_SOLVER_H_
operations_research::LazyMutableCopy
Definition
lazy_mutable_copy.h:44
operations_research::MPSolutionResponse
Definition
linear_solver.pb.h:3749
parameters.pb.h
lazy_mutable_copy.h
linear_solver.pb.h
operations_research
OR-Tools root namespace.
Definition
binary_indexed_tree.h:21
operations_research::GlopSolverVersion
std::string GlopSolverVersion()
Definition
glop_proto_solver.cc:234
operations_research::GlopSolveProto
MPSolutionResponse GlopSolveProto(LazyMutableCopy< MPModelRequest > request, std::atomic< bool > *interrupt_solve, std::function< void(const std::string &)> logging_callback)
Definition
glop_proto_solver.cc:107
ortools
linear_solver
proto_solver
glop_proto_solver.h
Generated by
1.15.0