#include <sharded_quadratic_program.h>
|
| ShardedQuadraticProgram (QuadraticProgram qp, int num_threads, int num_shards, operations_research::SolverLogger *logger=nullptr) |
|
| ShardedQuadraticProgram (const ShardedQuadraticProgram &)=delete |
| Movable but not copyable.
|
|
ShardedQuadraticProgram & | operator= (const ShardedQuadraticProgram &)=delete |
|
| ShardedQuadraticProgram (ShardedQuadraticProgram &&)=default |
|
ShardedQuadraticProgram & | operator= (ShardedQuadraticProgram &&)=default |
|
const QuadraticProgram & | Qp () const |
|
const Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > & | TransposedConstraintMatrix () const |
| Returns a reference to the transpose of the QP's constraint matrix.
|
|
const Sharder & | ConstraintMatrixSharder () const |
| Returns a Sharder intended for the columns of the QP's constraint matrix.
|
|
const Sharder & | TransposedConstraintMatrixSharder () const |
| Returns a Sharder intended for the rows of the QP's constraint matrix.
|
|
const Sharder & | PrimalSharder () const |
| Returns a Sharder intended for primal vectors.
|
|
const Sharder & | DualSharder () const |
| Returns a Sharder intended for dual vectors.
|
|
int64_t | PrimalSize () const |
|
int64_t | DualSize () const |
|
void | RescaleQuadraticProgram (const Eigen::VectorXd &col_scaling_vec, const Eigen::VectorXd &row_scaling_vec) |
|
void | SwapVariableBounds (Eigen::VectorXd &variable_lower_bounds, Eigen::VectorXd &variable_upper_bounds) |
|
void | SwapConstraintBounds (Eigen::VectorXd &constraint_lower_bounds, Eigen::VectorXd &constraint_upper_bounds) |
|
void | SetConstraintBounds (int64_t constraint_index, std::optional< double > lower_bound, std::optional< double > upper_bound) |
|
void | SwapObjectiveVector (Eigen::VectorXd &objective) |
|
void | ReplaceLargeConstraintBoundsWithInfinity (double threshold) |
|
This class stores:
- A
QuadraticProgram
(QP)
- A transposed version of the QP's constraint matrix
- A thread pool
- Various
Sharder
objects for doing sharded matrix and vector computations.
Definition at line 37 of file sharded_quadratic_program.h.
◆ ShardedQuadraticProgram() [1/3]
Requires num_shards
>= num_threads
>= 1.
- Note
- the
qp
is intentionally passed by value. If logger
is not nullptr, warns about unbalanced matrices using it; otherwise warns via Google standard logging.
Definition at line 77 of file sharded_quadratic_program.cc.
◆ ShardedQuadraticProgram() [2/3]
Movable but not copyable.
◆ ShardedQuadraticProgram() [3/3]
◆ ConstraintMatrixSharder()
const Sharder & operations_research::pdlp::ShardedQuadraticProgram::ConstraintMatrixSharder |
( |
| ) |
const |
|
inline |
◆ DualSharder()
const Sharder & operations_research::pdlp::ShardedQuadraticProgram::DualSharder |
( |
| ) |
const |
|
inline |
◆ DualSize()
int64_t operations_research::pdlp::ShardedQuadraticProgram::DualSize |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ PrimalSharder()
const Sharder & operations_research::pdlp::ShardedQuadraticProgram::PrimalSharder |
( |
| ) |
const |
|
inline |
◆ PrimalSize()
int64_t operations_research::pdlp::ShardedQuadraticProgram::PrimalSize |
( |
| ) |
const |
|
inline |
◆ Qp()
const QuadraticProgram & operations_research::pdlp::ShardedQuadraticProgram::Qp |
( |
| ) |
const |
|
inline |
◆ ReplaceLargeConstraintBoundsWithInfinity()
void operations_research::pdlp::ShardedQuadraticProgram::ReplaceLargeConstraintBoundsWithInfinity |
( |
double | threshold | ) |
|
Replaces constraint bounds whose absolute value is >= threshold
with the corresponding infinity.
Definition at line 183 of file sharded_quadratic_program.cc.
◆ RescaleQuadraticProgram()
void operations_research::pdlp::ShardedQuadraticProgram::RescaleQuadraticProgram |
( |
const Eigen::VectorXd & | col_scaling_vec, |
|
|
const Eigen::VectorXd & | row_scaling_vec ) |
Rescales the QP (including objective, variable bounds, constraint bounds, constraint matrix, and transposed constraint matrix) based on col_scaling_vec
and row_scaling_vec
. That is, rescale the problem so that each variable is rescaled as variable[i] <- variable[i] / col_scaling_vec[i]
, and the j-th constraint is multiplied by row_scaling_vec[j]
. col_scaling_vec
and row_scaling_vec
must be positive.
Definition at line 148 of file sharded_quadratic_program.cc.
◆ SetConstraintBounds()
void operations_research::pdlp::ShardedQuadraticProgram::SetConstraintBounds |
( |
int64_t | constraint_index, |
|
|
std::optional< double > | lower_bound, |
|
|
std::optional< double > | upper_bound ) |
◆ SwapConstraintBounds()
void operations_research::pdlp::ShardedQuadraticProgram::SwapConstraintBounds |
( |
Eigen::VectorXd & | constraint_lower_bounds, |
|
|
Eigen::VectorXd & | constraint_upper_bounds ) |
|
inline |
◆ SwapObjectiveVector()
void operations_research::pdlp::ShardedQuadraticProgram::SwapObjectiveVector |
( |
Eigen::VectorXd & | objective | ) |
|
|
inline |
Swaps objective
with the objective_vector
in the quadratic program. Swapping objective_matrix
is not yet supported because it hasn't been needed.
Definition at line 105 of file sharded_quadratic_program.h.
◆ SwapVariableBounds()
void operations_research::pdlp::ShardedQuadraticProgram::SwapVariableBounds |
( |
Eigen::VectorXd & | variable_lower_bounds, |
|
|
Eigen::VectorXd & | variable_upper_bounds ) |
|
inline |
◆ TransposedConstraintMatrix()
const Eigen::SparseMatrix< double, Eigen::ColMajor, int64_t > & operations_research::pdlp::ShardedQuadraticProgram::TransposedConstraintMatrix |
( |
| ) |
const |
|
inline |
◆ TransposedConstraintMatrixSharder()
const Sharder & operations_research::pdlp::ShardedQuadraticProgram::TransposedConstraintMatrixSharder |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: