17#ifndef OR_TOOLS_MATH_OPT_CPP_SOLUTION_H_
18#define OR_TOOLS_MATH_OPT_CPP_SOLUTION_H_
22#include "absl/container/flat_hash_map.h"
23#include "absl/status/status.h"
24#include "absl/status/statusor.h"
31#include "ortools/math_opt/result.pb.h"
32#include "ortools/math_opt/solution.pb.h"
69 static absl::StatusOr<PrimalSolution>
FromProto(
70 const ModelStorage*
model,
71 const PrimalSolutionProto& primal_solution_proto);
74 PrimalSolutionProto
Proto()
const;
114 static absl::StatusOr<PrimalRay>
FromProto(
115 const ModelStorage*
model,
const PrimalRayProto& primal_ray_proto);
118 PrimalRayProto
Proto()
const;
141 static absl::StatusOr<DualSolution>
FromProto(
142 const ModelStorage*
model,
const DualSolutionProto& dual_solution_proto);
145 DualSolutionProto
Proto()
const;
182 static absl::StatusOr<DualRay>
FromProto(
const ModelStorage*
model,
183 const DualRayProto& dual_ray_proto);
186 DualRayProto
Proto()
const;
222 const BasisProto& basis_proto);
232 BasisProto
Proto()
const;
264 static absl::StatusOr<Solution>
FromProto(
265 const ModelStorage*
model,
const SolutionProto& solution_proto);
268 SolutionProto
Proto()
const;
#define MATH_OPT_DEFINE_ENUM(CppEnum, proto_unspecified_value)
absl::flat_hash_map< Variable, V > VariableMap
absl::flat_hash_map< LinearConstraint, V > LinearConstraintMap
SolutionStatus
Feasibility of a primal or dual solution as claimed by the solver.
@ kUndetermined
Solver does not claim a feasibility status.
@ kFeasible
Solver claims the solution is feasible.
@ kInfeasible
Solver claims the solution is infeasible.
In SWIG mode, we don't want anything besides these top-level includes.
absl::Status CheckModelStorage(const ModelStorage *expected_storage) const
LinearConstraintMap< BasisStatus > constraint_status
static absl::StatusOr< Basis > FromProto(const ModelStorage *model, const BasisProto &basis_proto)
VariableMap< BasisStatus > variable_status
std::optional< SolutionStatus > basic_dual_feasibility
DualRayProto Proto() const
Returns the proto equivalent of this.
static absl::StatusOr< DualRay > FromProto(const ModelStorage *model, const DualRayProto &dual_ray_proto)
LinearConstraintMap< double > dual_values
VariableMap< double > reduced_costs
static absl::StatusOr< DualSolution > FromProto(const ModelStorage *model, const DualSolutionProto &dual_solution_proto)
LinearConstraintMap< double > dual_values
absl::flat_hash_map< QuadraticConstraint, double > quadratic_dual_values
std::optional< double > objective_value
DualSolutionProto Proto() const
Returns the proto equivalent of this.
SolutionStatus feasibility_status
VariableMap< double > reduced_costs
PrimalRayProto Proto() const
Returns the proto equivalent of this.
VariableMap< double > variable_values
static absl::StatusOr< PrimalRay > FromProto(const ModelStorage *model, const PrimalRayProto &primal_ray_proto)
absl::flat_hash_map< Objective, double > auxiliary_objective_values
static absl::StatusOr< PrimalSolution > FromProto(const ModelStorage *model, const PrimalSolutionProto &primal_solution_proto)
PrimalSolutionProto Proto() const
Returns the proto equivalent of this.
SolutionStatus feasibility_status
double get_objective_value(Objective objective) const
VariableMap< double > variable_values
std::optional< Basis > basis
std::optional< PrimalSolution > primal_solution
std::optional< DualSolution > dual_solution
SolutionProto Proto() const
Returns the proto equivalent of this.
static absl::StatusOr< Solution > FromProto(const ModelStorage *model, const SolutionProto &solution_proto)