Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
pdlp_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_MATH_OPT_SOLVERS_PDLP_SOLVER_H_
15#define ORTOOLS_MATH_OPT_SOLVERS_PDLP_SOLVER_H_
16
17#include <memory>
18
19#include "absl/base/nullability.h"
20#include "absl/status/statusor.h"
33
34namespace operations_research {
35namespace math_opt {
36
37class PdlpSolver : public SolverInterface {
38 public:
39 static absl::StatusOr<std::unique_ptr<SolverInterface>> New(
40 const ModelProto& model, const InitArgs& init_args);
41
42 absl::StatusOr<SolveResultProto> Solve(
43 const SolveParametersProto& parameters,
44 const ModelSolveParametersProto& model_parameters,
45 MessageCallback message_cb,
46 const CallbackRegistrationProto& callback_registration, Callback cb,
47 const SolveInterrupter* absl_nullable interrupter) override;
48 absl::StatusOr<bool> Update(const ModelUpdateProto& model_update) override;
49 absl::StatusOr<ComputeInfeasibleSubsystemResultProto>
51 const SolveParametersProto& parameters, MessageCallback message_cb,
52 const SolveInterrupter* absl_nullable interrupter) override;
53
54 // Returns the merged parameters and a list of warnings.
55 static absl::StatusOr<pdlp::PrimalDualHybridGradientParams> MergeParameters(
56 const SolveParametersProto& parameters, bool has_message_callback);
57
58 private:
59 PdlpSolver() = default;
60
61 absl::StatusOr<SolveResultProto> MakeSolveResult(
62 const pdlp::SolverResult& pdlp_result,
63 const ModelSolveParametersProto& model_params);
64
65 PdlpBridge pdlp_bridge_;
66};
67
68} // namespace math_opt
69} // namespace operations_research
70
71#endif // ORTOOLS_MATH_OPT_SOLVERS_PDLP_SOLVER_H_
static absl::StatusOr< std::unique_ptr< SolverInterface > > New(const ModelProto &model, const InitArgs &init_args)
absl::StatusOr< SolveResultProto > Solve(const SolveParametersProto &parameters, const ModelSolveParametersProto &model_parameters, MessageCallback message_cb, const CallbackRegistrationProto &callback_registration, Callback cb, const SolveInterrupter *absl_nullable interrupter) override
absl::StatusOr< ComputeInfeasibleSubsystemResultProto > ComputeInfeasibleSubsystem(const SolveParametersProto &parameters, MessageCallback message_cb, const SolveInterrupter *absl_nullable interrupter) override
static absl::StatusOr< pdlp::PrimalDualHybridGradientParams > MergeParameters(const SolveParametersProto &parameters, bool has_message_callback)
absl::StatusOr< bool > Update(const ModelUpdateProto &model_update) override
std::function< void(const std::vector< std::string > &)> MessageCallback
std::function< absl::StatusOr< CallbackResultProto >( const CallbackDataProto &)> Callback
OR-Tools root namespace.