14#ifndef OR_TOOLS_MATH_OPT_CPP_SOLVE_IMPL_H_
15#define OR_TOOLS_MATH_OPT_CPP_SOLVE_IMPL_H_
19#include "absl/functional/any_invocable.h"
20#include "absl/status/statusor.h"
51 absl::AnyInvocable<absl::StatusOr<std::unique_ptr<BaseSolver>>(
52 SolverTypeProto solver_type, ModelProto
model,
80 static absl::StatusOr<std::unique_ptr<IncrementalSolverImpl>>
New(
89 absl::StatusOr<UpdateResult>
Update()
override;
94 absl::StatusOr<ComputeInfeasibleSubsystemResult>
103 bool remove_names, std::shared_ptr<SolveInterrupter> local_canceller,
104 std::unique_ptr<const ScopedSolveInterrupterCallback> user_canceller_cb,
105 const ModelStorage* expected_storage,
106 std::unique_ptr<UpdateTracker> update_tracker,
107 std::unique_ptr<BaseSolver> solver);
111 const bool remove_names_;
115 std::shared_ptr<SolveInterrupter> local_canceller_;
116 std::unique_ptr<const ScopedSolveInterrupterCallback> user_canceller_cb_;
117 const ModelStorage*
const expected_storage_;
118 const std::unique_ptr<UpdateTracker> update_tracker_;
119 std::unique_ptr<BaseSolver> solver_;
absl::StatusOr< SolveResult > SolveWithoutUpdate() const
absl::StatusOr< ComputeInfeasibleSubsystemResult > ComputeInfeasibleSubsystemWithoutUpdate() const
absl::StatusOr< SolveResult > Solve()
absl::StatusOr< ComputeInfeasibleSubsystemResult > ComputeInfeasibleSubsystem()
Incremental solve of a model.
absl::StatusOr< UpdateResult > Update() override
SolverType solver_type() const override
Returns the underlying solver used.
static absl::StatusOr< std::unique_ptr< IncrementalSolverImpl > > New(BaseSolverFactory solver_factory, Model *model, SolverType solver_type, const SolveInterrupter *user_canceller, bool remove_names)
absl::StatusOr< ComputeInfeasibleSubsystemResult > ComputeInfeasibleSubsystemImpl(const BaseSolverFactory solver_factory, const Model &model, const SolverType solver_type, const ComputeInfeasibleSubsystemArguments &compute_args, const SolveInterrupter *const user_canceller, const bool remove_names)
absl::AnyInvocable< absl::StatusOr< std::unique_ptr< BaseSolver > >( SolverTypeProto solver_type, ModelProto model, SolveInterrupter *local_canceller) const > BaseSolverFactory
absl::StatusOr< SolveResult > SolveImpl(const BaseSolverFactory solver_factory, const Model &model, const SolverType solver_type, const SolveArguments &solve_args, const SolveInterrupter *const user_canceller, const bool remove_names)
SolverType
The solvers supported by MathOpt.
Arguments passed to ComputeInfeasibleSubsystem() to control the solver.