Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <matrix_scaler.h>
Public Member Functions | |
SparseMatrixScaler () | |
SparseMatrixScaler (const SparseMatrixScaler &)=delete | |
This type is neither copyable nor movable. | |
SparseMatrixScaler & | operator= (const SparseMatrixScaler &)=delete |
void | Init (SparseMatrix *matrix) |
void | Clear () |
Fractional | ColScalingFactor (ColIndex col) const |
Fractional | RowScalingFactor (RowIndex row) const |
Fractional | ColUnscalingFactor (ColIndex col) const |
Fractional | RowUnscalingFactor (RowIndex row) const |
const DenseRow & | col_scales () const |
These are unscaling factor, same as [Col|Row]UnscalingFactor(). | |
const DenseColumn & | row_scales () const |
void | Scale (GlopParameters::ScalingAlgorithm method) |
Scales the matrix. | |
void | ScaleRowVector (bool up, DenseRow *row_vector) const |
void | ScaleColumnVector (bool up, DenseColumn *column_vector) const |
Definition at line 76 of file matrix_scaler.h.
operations_research::glop::SparseMatrixScaler::SparseMatrixScaler | ( | ) |
Definition at line 41 of file matrix_scaler.cc.
|
delete |
This type is neither copyable nor movable.
void operations_research::glop::SparseMatrixScaler::Clear | ( | ) |
Clears the object, and puts it back into the same state as after being constructed.
Definition at line 51 of file matrix_scaler.cc.
|
inline |
These are unscaling factor, same as [Col|Row]UnscalingFactor().
Definition at line 109 of file matrix_scaler.h.
Fractional operations_research::glop::SparseMatrixScaler::ColScalingFactor | ( | ColIndex | col | ) | const |
The column col of the matrix was multiplied by ColScalingFactor(col). The variable bounds and objective coefficient at the same columsn where DIVIDED by that same factor. If col is outside the matrix size, this returns 1.0.
Definition at line 71 of file matrix_scaler.cc.
Fractional operations_research::glop::SparseMatrixScaler::ColUnscalingFactor | ( | ColIndex | col | ) | const |
The inverse of both factor above (this is how we keep them) so this direction should be faster to query (no 1.0 / factor).
Definition at line 62 of file matrix_scaler.cc.
void operations_research::glop::SparseMatrixScaler::Init | ( | SparseMatrix * | matrix | ) |
Initializes the object with the SparseMatrix passed as argument. The row and column scaling factors are all set to 1.0 (i.e. no scaling.) In terms of matrices, R and C are set to identity matrices.
Definition at line 44 of file matrix_scaler.cc.
|
delete |
|
inline |
Definition at line 110 of file matrix_scaler.h.
Fractional operations_research::glop::SparseMatrixScaler::RowScalingFactor | ( | RowIndex | row | ) | const |
The constraint row of the matrix was multiplied by RowScalingFactor(row), same for the constraint bounds (which is not the same as for the variable bounds for a column!). If row is outside the matrix size, this returns 1.0.
Definition at line 67 of file matrix_scaler.cc.
Fractional operations_research::glop::SparseMatrixScaler::RowUnscalingFactor | ( | RowIndex | row | ) | const |
Definition at line 57 of file matrix_scaler.cc.
void operations_research::glop::SparseMatrixScaler::Scale | ( | GlopParameters::ScalingAlgorithm | method | ) |
Scales the matrix.
This is an implementation of the algorithm described in Benichou, M., Gauthier, J-M., Hentges, G., and Ribiere, G., "The efficient solution of large-scale linear programming problems — some algorithmic techniques and computational results," Mathematical Programming 13(3) (December 1977). http://www.springerlink.com/content/j3367676856m0064/
Revert to the default scaling method if there is an error with the LP.
Definition at line 100 of file matrix_scaler.cc.
void operations_research::glop::SparseMatrixScaler::ScaleColumnVector | ( | bool | up, |
DenseColumn * | column_vector ) const |
Scales a column vector up or down (depending whether parameter up is true or false) using the scaling factors determined by Scale(). Scaling up means multiplying by the scaling factors, while scaling down means dividing by the scaling factors.
Definition at line 186 of file matrix_scaler.cc.
void operations_research::glop::SparseMatrixScaler::ScaleRowVector | ( | bool | up, |
DenseRow * | row_vector ) const |
Scales a row vector up or down (depending whether parameter up is true or false) using the scaling factors determined by Scale(). Scaling up means multiplying by the scaling factors, while scaling down means dividing by the scaling factors.
Definition at line 181 of file matrix_scaler.cc.