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

#include <preprocessor.h>

Inheritance diagram for operations_research::glop::MainLpPreprocessor:
operations_research::glop::Preprocessor

Public Member Functions

 MainLpPreprocessor (const GlopParameters *parameters)
 
 MainLpPreprocessor (const MainLpPreprocessor &)=delete
 
MainLpPreprocessoroperator= (const MainLpPreprocessor &)=delete
 
 ~MainLpPreprocessor () override=default
 
bool Run (LinearProgram *lp) final
 
void RecoverSolution (ProblemSolution *solution) const override
 
void DestructiveRecoverSolution (ProblemSolution *solution)
 
void SetLogger (SolverLogger *logger)
 
- Public Member Functions inherited from operations_research::glop::Preprocessor
 Preprocessor (const GlopParameters *parameters)
 
 Preprocessor (const Preprocessor &)=delete
 
Preprocessoroperator= (const Preprocessor &)=delete
 
virtual ~Preprocessor ()
 
ProblemStatus status () const
 
virtual void UseInMipContext ()
 
void SetTimeLimit (TimeLimit *time_limit)
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::glop::Preprocessor
bool IsSmallerWithinFeasibilityTolerance (Fractional a, Fractional b) const
 
bool IsSmallerWithinPreprocessorZeroTolerance (Fractional a, Fractional b) const
 
- Protected Attributes inherited from operations_research::glop::Preprocessor
ProblemStatus status_
 
const GlopParameters & parameters_
 
bool in_mip_context_
 
std::unique_ptr< TimeLimitinfinite_time_limit_
 
TimeLimittime_limit_
 

Detailed Description

MainLpPreprocessor This is the main LP preprocessor responsible for calling all the other preprocessors in this file, possibly more than once.

Definition at line 111 of file preprocessor.h.

Constructor & Destructor Documentation

◆ MainLpPreprocessor() [1/2]

operations_research::glop::MainLpPreprocessor::MainLpPreprocessor ( const GlopParameters * parameters)
inlineexplicit

Definition at line 113 of file preprocessor.h.

◆ MainLpPreprocessor() [2/2]

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

◆ ~MainLpPreprocessor()

operations_research::glop::MainLpPreprocessor::~MainLpPreprocessor ( )
overridedefault

Member Function Documentation

◆ DestructiveRecoverSolution()

void operations_research::glop::MainLpPreprocessor::DestructiveRecoverSolution ( ProblemSolution * solution)

Like RecoverSolution but destroys data structures as it goes to reduce peak RAM use. After calling this the MainLpPreprocessor object may no longer be used.

Definition at line 207 of file preprocessor.cc.

◆ operator=()

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

◆ RecoverSolution()

void operations_research::glop::MainLpPreprocessor::RecoverSolution ( ProblemSolution * solution) const
overridevirtual

Stores the optimal solution of the linear program that was passed to Run(). The given solution needs to be set to the optimal solution of the linear program "modified" by Run().

Implements operations_research::glop::Preprocessor.

Definition at line 200 of file preprocessor.cc.

◆ Run()

bool operations_research::glop::MainLpPreprocessor::Run ( LinearProgram * lp)
finalvirtual

Runs the preprocessor by modifying the given linear program. Returns true if a postsolve step will be needed (i.e. RecoverSolution() is not the identity function). Also updates status_ to something different from ProblemStatus::INIT if the problem was solved (including bad statuses like ProblemStatus::ABNORMAL, ProblemStatus::INFEASIBLE, etc.).

We run it a few times because running one preprocessor may allow another one to remove more stuff.

Abort early if none of the preprocessors did something. Technically this is true if none of the preprocessors above needs postsolving, which has exactly the same meaning for these particular preprocessors.

We use i here because the last pass did nothing.

Todo
(user): Run them in the loop above if the effect on the running time is good. This needs more investigation.

If DualizerPreprocessor was run, we need to do some extra preprocessing. This is because it currently adds a lot of zero-cost singleton columns.

Todo
(user): We probably want to scale the costs before and after this preprocessor so that the rhs/objective of the dual are with a good magnitude.

The scaling is controlled by use_scaling, not use_preprocessing.

Implements operations_research::glop::Preprocessor.

Definition at line 80 of file preprocessor.cc.

◆ SetLogger()

void operations_research::glop::MainLpPreprocessor::SetLogger ( SolverLogger * logger)
inline

Definition at line 127 of file preprocessor.h.


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