Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <pdlp_bridge.h>
Public Member Functions | |
PdlpBridge ()=default | |
const pdlp::QuadraticProgram & | pdlp_lp () const |
InvertedBounds | ListInvertedBounds () const |
Returns the ids of variables and linear constraints with inverted bounds. | |
absl::StatusOr< SparseDoubleVectorProto > | PrimalVariablesToProto (const Eigen::VectorXd &primal_values, const SparseVectorFilterProto &variable_filter) const |
absl::StatusOr< SparseDoubleVectorProto > | DualVariablesToProto (const Eigen::VectorXd &dual_values, const SparseVectorFilterProto &linear_constraint_filter) const |
absl::StatusOr< SparseDoubleVectorProto > | ReducedCostsToProto (const Eigen::VectorXd &reduced_costs, const SparseVectorFilterProto &variable_filter) const |
pdlp::PrimalAndDualSolution | SolutionHintToWarmStart (const SolutionHintProto &solution_hint) const |
Static Public Member Functions | |
static absl::StatusOr< PdlpBridge > | FromProto (const ModelProto &model_proto) |
Builds a PDLP model (QuadraticProgram) from ModelProto, and provides methods to translate solutions back and forth.
The primary difference in the models are:
Throughout, it is assumed that the MathOpt protos have been validated, but no assumption is made on the PDLP output. Any Status errors resulting from invalid PDLP output use the status code kInternal.
Definition at line 48 of file pdlp_bridge.h.
|
default |
absl::StatusOr< SparseDoubleVectorProto > operations_research::math_opt::PdlpBridge::DualVariablesToProto | ( | const Eigen::VectorXd & | dual_values, |
const SparseVectorFilterProto & | linear_constraint_filter ) const |
Definition at line 196 of file pdlp_bridge.cc.
|
static |
MathOpt represents quadratic objectives in "terms" form, i.e. as a sum of double * Variable * Variable terms. They are stored in upper triangular form with row_index <= column_index. In contrast, PDLP represents quadratic objectives in "matrix" form as 1/2 x'Qx, where Q is diagonal. To get to the right format, we simply double each diagonal entry.
Definition at line 81 of file pdlp_bridge.cc.
InvertedBounds operations_research::math_opt::PdlpBridge::ListInvertedBounds | ( | ) | const |
Returns the ids of variables and linear constraints with inverted bounds.
Definition at line 170 of file pdlp_bridge.cc.
|
inline |
Definition at line 53 of file pdlp_bridge.h.
absl::StatusOr< SparseDoubleVectorProto > operations_research::math_opt::PdlpBridge::PrimalVariablesToProto | ( | const Eigen::VectorXd & | primal_values, |
const SparseVectorFilterProto & | variable_filter ) const |
Definition at line 190 of file pdlp_bridge.cc.
absl::StatusOr< SparseDoubleVectorProto > operations_research::math_opt::PdlpBridge::ReducedCostsToProto | ( | const Eigen::VectorXd & | reduced_costs, |
const SparseVectorFilterProto & | variable_filter ) const |
Definition at line 203 of file pdlp_bridge.cc.
pdlp::PrimalAndDualSolution operations_research::math_opt::PdlpBridge::SolutionHintToWarmStart | ( | const SolutionHintProto & | solution_hint | ) | const |
We are implicitly assuming that all missing IDs have correspoding value 0.
Definition at line 210 of file pdlp_bridge.cc.