Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::glop::SparseMatrixScaler Class Reference

#include <matrix_scaler.h>

Public Member Functions

 SparseMatrixScaler ()
 
 SparseMatrixScaler (const SparseMatrixScaler &)=delete
 This type is neither copyable nor movable.
 
SparseMatrixScaleroperator= (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 DenseRowcol_scales () const
 These are unscaling factor, same as [Col|Row]UnscalingFactor().
 
const DenseColumnrow_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
 

Detailed Description

Definition at line 76 of file matrix_scaler.h.

Constructor & Destructor Documentation

◆ SparseMatrixScaler() [1/2]

operations_research::glop::SparseMatrixScaler::SparseMatrixScaler ( )

Definition at line 41 of file matrix_scaler.cc.

◆ SparseMatrixScaler() [2/2]

operations_research::glop::SparseMatrixScaler::SparseMatrixScaler ( const SparseMatrixScaler & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ Clear()

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.

◆ col_scales()

const DenseRow & operations_research::glop::SparseMatrixScaler::col_scales ( ) const
inline

These are unscaling factor, same as [Col|Row]UnscalingFactor().

Definition at line 109 of file matrix_scaler.h.

◆ ColScalingFactor()

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.

◆ ColUnscalingFactor()

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.

◆ Init()

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.

◆ operator=()

SparseMatrixScaler & operations_research::glop::SparseMatrixScaler::operator= ( const SparseMatrixScaler & )
delete

◆ row_scales()

const DenseColumn & operations_research::glop::SparseMatrixScaler::row_scales ( ) const
inline

Definition at line 110 of file matrix_scaler.h.

◆ RowScalingFactor()

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.

◆ RowUnscalingFactor()

Fractional operations_research::glop::SparseMatrixScaler::RowUnscalingFactor ( RowIndex row) const

Definition at line 57 of file matrix_scaler.cc.

◆ Scale()

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.

Todo
(user): Decide precisely for which value of dynamic range we should cut off geometric scaling.

Definition at line 100 of file matrix_scaler.cc.

◆ ScaleColumnVector()

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.

◆ ScaleRowVector()

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.


The documentation for this class was generated from the following files: