![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Preprocessor This is the base class for preprocessors.
Definition at line 48 of file preprocessor.h.
#include <preprocessor.h>
Public Member Functions | |
Preprocessor (const GlopParameters *parameters) | |
Preprocessor (const Preprocessor &)=delete | |
Preprocessor & | operator= (const Preprocessor &)=delete |
virtual | ~Preprocessor () |
virtual bool | Run (LinearProgram *lp)=0 |
virtual void | RecoverSolution (ProblemSolution *solution) const =0 |
ProblemStatus | status () const |
virtual void | UseInMipContext () |
void | SetTimeLimit (TimeLimit *time_limit) |
Protected Member Functions | |
bool | IsSmallerWithinFeasibilityTolerance (Fractional a, Fractional b) const |
bool | IsSmallerWithinPreprocessorZeroTolerance (Fractional a, Fractional b) const |
Protected Attributes | |
ProblemStatus | status_ |
const GlopParameters & | parameters_ |
bool | in_mip_context_ |
std::unique_ptr< TimeLimit > | infinite_time_limit_ |
TimeLimit * | time_limit_ |
|
explicit |
Definition at line 57 of file preprocessor.cc.
|
delete |
|
virtual |
Definition at line 63 of file preprocessor.cc.
|
inlineprotected |
Returns true if a is less than b (or slighlty greater than b with a given tolerance).
Definition at line 85 of file preprocessor.h.
|
inlineprotected |
Definition at line 89 of file preprocessor.h.
|
delete |
|
pure virtual |
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().
Implemented in operations_research::glop::AddSlackVariablesPreprocessor, operations_research::glop::DoubletonEqualityRowPreprocessor, operations_research::glop::DoubletonFreeColumnPreprocessor, operations_research::glop::DualizerPreprocessor, operations_research::glop::EmptyColumnPreprocessor, operations_research::glop::EmptyConstraintPreprocessor, operations_research::glop::FixedVariablePreprocessor, operations_research::glop::ForcingAndImpliedFreeConstraintPreprocessor, operations_research::glop::FreeConstraintPreprocessor, operations_research::glop::ImpliedFreePreprocessor, operations_research::glop::MainLpPreprocessor, operations_research::glop::ProportionalColumnPreprocessor, operations_research::glop::ProportionalRowPreprocessor, operations_research::glop::ScalingPreprocessor, operations_research::glop::ShiftVariableBoundsPreprocessor, operations_research::glop::SingletonColumnSignPreprocessor, operations_research::glop::SingletonPreprocessor, operations_research::glop::ToMinimizationPreprocessor, and operations_research::glop::UnconstrainedVariablePreprocessor.
|
pure virtual |
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.).
Implemented in operations_research::glop::AddSlackVariablesPreprocessor, operations_research::glop::DoubletonEqualityRowPreprocessor, operations_research::glop::DoubletonFreeColumnPreprocessor, operations_research::glop::DualizerPreprocessor, operations_research::glop::EmptyColumnPreprocessor, operations_research::glop::EmptyConstraintPreprocessor, operations_research::glop::FixedVariablePreprocessor, operations_research::glop::ForcingAndImpliedFreeConstraintPreprocessor, operations_research::glop::FreeConstraintPreprocessor, operations_research::glop::ImpliedFreePreprocessor, operations_research::glop::MainLpPreprocessor, operations_research::glop::ProportionalColumnPreprocessor, operations_research::glop::ProportionalRowPreprocessor, operations_research::glop::ScalingPreprocessor, operations_research::glop::ShiftVariableBoundsPreprocessor, operations_research::glop::SingletonColumnSignPreprocessor, operations_research::glop::SingletonPreprocessor, operations_research::glop::ToMinimizationPreprocessor, and operations_research::glop::UnconstrainedVariablePreprocessor.
|
inline |
Definition at line 80 of file preprocessor.h.
|
inline |
Returns the status of the preprocessor. A status different from ProblemStatus::INIT means that the problem is solved and there is not need to call subsequent preprocessors.
Definition at line 70 of file preprocessor.h.
|
inlinevirtual |
Some preprocessors only need minimal changes when used with integer variables in a MIP context. Setting this to true allows to consider integer variables as integer in these preprocessors.
Not all preprocessors handle integer variables correctly, calling this function on them will cause a LOG(FATAL).
Reimplemented in operations_research::glop::DualizerPreprocessor, operations_research::glop::ProportionalColumnPreprocessor, and operations_research::glop::ScalingPreprocessor.
Definition at line 78 of file preprocessor.h.
|
protected |
Definition at line 98 of file preprocessor.h.
|
protected |
Definition at line 99 of file preprocessor.h.
|
protected |
Definition at line 97 of file preprocessor.h.
|
protected |
Definition at line 96 of file preprocessor.h.
|
protected |
Definition at line 100 of file preprocessor.h.