14#ifndef PDLP_QUADRATIC_PROGRAM_H_
15#define PDLP_QUADRATIC_PROGRAM_H_
25#include "Eigen/SparseCore"
26#include "absl/status/status.h"
27#include "absl/status/statusor.h"
28#include "ortools/linear_solver/linear_solver.pb.h"
108 constexpr double kInfinity = std::numeric_limits<double>::infinity();
113 Eigen::VectorXd::Constant(num_constraints, -kInfinity);
115 Eigen::VectorXd::Constant(num_constraints, kInfinity);
117 Eigen::VectorXd::Constant(num_variables, -kInfinity);
172 const MPModelProto&
proto,
bool relax_integer_variables,
173 bool include_names =
false);
192std::string
ToString(
const QuadraticProgram& qp, int64_t max_size = 1'000'000);
203 std::vector<Eigen::Triplet<double, int64_t>> triplets,
204 Eigen::SparseMatrix<double, Eigen::ColMajor, int64_t>& matrix);
213 int64_t largest_ok_size);
220 std::vector<Eigen::Triplet<double, int64_t>>& triplets);
CpModelProto proto
The output proto.
absl::Status TestableCanFitInMpModelProto(const QuadraticProgram &qp, const int64_t largest_ok_size)
void CombineRepeatedTripletsInPlace(std::vector< Eigen::Triplet< double, int64_t > > &triplets)
Validation utilities for solvers.proto.
absl::StatusOr< MPModelProto > QpToMpModelProto(const QuadraticProgram &qp)
absl::Status ValidateQuadraticProgramDimensions(const QuadraticProgram &qp)
absl::StatusOr< QuadraticProgram > QpFromMpModelProto(const MPModelProto &proto, bool relax_integer_variables, bool include_names)
bool IsLinearProgram(const QuadraticProgram &qp)
std::string ToString(const QuadraticProgram &qp, int64_t max_size)
void SetEigenMatrixFromTriplets(std::vector< Eigen::Triplet< double, int64_t > > triplets, Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > &matrix)
absl::Status CanFitInMpModelProto(const QuadraticProgram &qp)
double ApplyObjectiveScalingAndOffset(double objective) const
double objective_scaling_factor
QuadraticProgram & operator=(QuadraticProgram &&other)
QuadraticProgram(const QuadraticProgram &other)=default
Eigen::VectorXd variable_lower_bounds
Eigen::VectorXd constraint_lower_bounds
std::optional< std::string > problem_name
Eigen::VectorXd objective_vector
std::optional< Eigen::DiagonalMatrix< double, Eigen::Dynamic > > objective_matrix
Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > constraint_matrix
QuadraticProgram & operator=(const QuadraticProgram &other)=default
Eigen::VectorXd variable_upper_bounds
std::optional< std::vector< std::string > > constraint_names
QuadraticProgram(int64_t num_variables, int64_t num_constraints)
std::optional< std::vector< std::string > > variable_names
void ResizeAndInitialize(int64_t num_variables, int64_t num_constraints)
Eigen::VectorXd constraint_upper_bounds
QuadraticProgram(QuadraticProgram &&other) noexcept