 |
OR-Tools
8.1
|
Go to the documentation of this file.
21 #ifndef OR_TOOLS_GLOP_PREPROCESSOR_H_
22 #define OR_TOOLS_GLOP_PREPROCESSOR_H_
116 void RunAndPushIfRelevant(std::unique_ptr<Preprocessor> preprocessor,
125 mutable std::vector<std::unique_ptr<Preprocessor>> preprocessors_;
128 EntryIndex initial_num_entries_;
129 RowIndex initial_num_rows_;
130 ColIndex initial_num_cols_;
161 return col < is_column_deleted_.
size() && is_column_deleted_[
col];
216 return row < is_row_deleted_.
size() && is_row_deleted_[
row];
314 bool lp_is_maximization_problem_;
367 void SingletonRowUndo(
const SparseMatrix& deleted_columns,
369 void ZeroCostSingletonColumnUndo(
const GlopParameters&
parameters,
372 void SingletonColumnInEqualityUndo(
const GlopParameters&
parameters,
379 bool is_maximization_;
409 MatrixEntry GetSingletonColumnMatrixEntry(ColIndex
col,
411 MatrixEntry GetSingletonRowMatrixEntry(RowIndex
row,
421 void UpdateConstraintBoundsWithVariableBounds(MatrixEntry e,
426 bool IntegerSingletonColumnIsRemovable(
const MatrixEntry& matrix_entry,
432 void DeleteZeroCostSingletonColumn(
const SparseMatrix& matrix_transpose,
452 bool MakeConstraintAnEqualityIfPossible(
const SparseMatrix& matrix_transpose,
458 void DeleteSingletonColumnInEquality(
const SparseMatrix& matrix_transpose,
463 std::vector<SingletonUndo> undo_stack_;
533 bool lp_is_maximization_problem_;
638 RowIndex
row[NUM_ROWS];
642 SparseColumn deleted_row_as_column;
645 std::vector<RestoreInfo> restore_stack_;
646 RowDeletionHelper row_deletion_helper_;
795 std::vector<ColIndex> changed_columns_;
821 NUM_DOUBLETON_COLS = 2,
823 static ColChoice OtherColChoice(ColChoice x) {
824 return x == DELETED ? MODIFIED : DELETED;
827 ColumnDeletionHelper column_deletion_helper_;
828 RowDeletionHelper row_deletion_helper_;
837 ColIndex
col[NUM_DOUBLETON_COLS];
841 SparseColumn column[NUM_DOUBLETON_COLS];
842 Fractional objective_coefficient[NUM_DOUBLETON_COLS];
857 ColChoiceAndStatus bound_backtracking_at_lower_bound;
858 ColChoiceAndStatus bound_backtracking_at_upper_bound;
860 void SwapDeletedAndModifiedVariableRestoreInfo(RestoreInfo* r);
862 std::vector<RestoreInfo> restore_stack_;
881 ProblemSolution* solution);
901 LOG(
FATAL) <<
"In the presence of integer variables, "
902 <<
"there is no notion of a dual problem.";
912 RowIndex primal_num_rows_;
913 ColIndex primal_num_cols_;
914 bool primal_is_maximization_problem_;
1039 ColIndex first_slack_col_;
1045 #endif // OR_TOOLS_GLOP_PREPROCESSOR_H_
ToMinimizationPreprocessor(const GlopParameters *parameters)
~FixedVariablePreprocessor() final
bool Run(LinearProgram *lp) final
bool IsRowMarked(RowIndex row) const
SingletonColumnSignPreprocessor(const SingletonColumnSignPreprocessor &)=delete
bool Run(LinearProgram *lp) final
RowDeletionHelper & operator=(const RowDeletionHelper &)=delete
void RecoverSolution(ProblemSolution *solution) const final
void MarkColumnForDeletionWithState(ColIndex col, Fractional value, VariableStatus status)
MainLpPreprocessor(const MainLpPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
SingletonPreprocessor(const GlopParameters *parameters)
ColumnDeletionHelper(const ColumnDeletionHelper &)=delete
ShiftVariableBoundsPreprocessor & operator=(const ShiftVariableBoundsPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
void RecoverSolution(ProblemSolution *solution) const final
const GlopParameters & parameters_
ColumnDeletionHelper & operator=(const ColumnDeletionHelper &)=delete
~RemoveNearZeroEntriesPreprocessor() final
~FreeConstraintPreprocessor() final
DoubletonEqualityRowPreprocessor(const DoubletonEqualityRowPreprocessor &)=delete
DoubletonFreeColumnPreprocessor & operator=(const DoubletonFreeColumnPreprocessor &)=delete
const DenseRow & offsets() const
~AddSlackVariablesPreprocessor() final
MainLpPreprocessor & operator=(const MainLpPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
void RestoreDeletedRows(ProblemSolution *solution) const
Preprocessor & operator=(const Preprocessor &)=delete
~ForcingAndImpliedFreeConstraintPreprocessor() final
FixedVariablePreprocessor & operator=(const FixedVariablePreprocessor &)=delete
~DualizerPreprocessor() final
ScalingPreprocessor(const ScalingPreprocessor &)=delete
void UseInMipContext() final
ImpliedFreePreprocessor(const GlopParameters *parameters)
~EmptyConstraintPreprocessor() final
ToMinimizationPreprocessor(const ToMinimizationPreprocessor &)=delete
ForcingAndImpliedFreeConstraintPreprocessor & operator=(const ForcingAndImpliedFreeConstraintPreprocessor &)=delete
FreeConstraintPreprocessor(const FreeConstraintPreprocessor &)=delete
bool Run(LinearProgram *lp) final
void RecoverSolution(ProblemSolution *solution) const final
RowDeletionHelper(const RowDeletionHelper &)=delete
const DenseBooleanColumn & GetMarkedRows() const
~MainLpPreprocessor() override
~ImpliedFreePreprocessor() final
ScalingPreprocessor & operator=(const ScalingPreprocessor &)=delete
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
ForcingAndImpliedFreeConstraintPreprocessor(const ForcingAndImpliedFreeConstraintPreprocessor &)=delete
bool Run(LinearProgram *lp) final
void RecoverSolution(ProblemSolution *solution) const final
~DoubletonFreeColumnPreprocessor() final
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
virtual void UseInMipContext()
SingletonPreprocessor(const SingletonPreprocessor &)=delete
ProblemStatus status() const
bool Run(LinearProgram *lp) final
EmptyConstraintPreprocessor(const GlopParameters *parameters)
SingletonUndo(OperationType type, const LinearProgram &lp, MatrixEntry e, ConstraintStatus status)
@ MAKE_CONSTRAINT_AN_EQUALITY
ColChoiceAndStatus(ColChoice c, VariableStatus s, Fractional v)
bool Run(LinearProgram *lp) final
Preprocessor(const Preprocessor &)=delete
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
ImpliedFreePreprocessor & operator=(const ImpliedFreePreprocessor &)=delete
void SetTimeLimit(TimeLimit *time_limit)
bool Run(LinearProgram *lp) final
void UseInMipContext() final
MatrixEntry(RowIndex _row, ColIndex _col, Fractional _coeff)
void RecoverSolution(ProblemSolution *solution) const final
ProportionalRowPreprocessor(const ProportionalRowPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
SharedTimeLimit * time_limit
bool Run(LinearProgram *lp) final
const DenseBooleanRow & GetMarkedColumns() const
UnconstrainedVariablePreprocessor(const UnconstrainedVariablePreprocessor &)=delete
bool Run(LinearProgram *lp) final
bool IsSmallerWithinPreprocessorZeroTolerance(Fractional a, Fractional b) const
SingletonColumnSignPreprocessor & operator=(const SingletonColumnSignPreprocessor &)=delete
void MarkRowForDeletion(RowIndex row)
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
virtual bool Run(LinearProgram *lp)=0
ScalingPreprocessor(const GlopParameters *parameters)
DoubletonEqualityRowPreprocessor & operator=(const DoubletonEqualityRowPreprocessor &)=delete
EmptyColumnPreprocessor(const GlopParameters *parameters)
EmptyConstraintPreprocessor(const EmptyConstraintPreprocessor &)=delete
DualizerPreprocessor & operator=(const DualizerPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
void MarkColumnForDeletion(ColIndex col)
ProportionalColumnPreprocessor(const GlopParameters *parameters)
AddSlackVariablesPreprocessor(const AddSlackVariablesPreprocessor &)=delete
~ProportionalRowPreprocessor() final
~SingletonPreprocessor() final
ImpliedFreePreprocessor(const ImpliedFreePreprocessor &)=delete
const DenseRow & GetStoredValue() const
FixedVariablePreprocessor(const GlopParameters *parameters)
bool Run(LinearProgram *lp) final
RemoveNearZeroEntriesPreprocessor(const RemoveNearZeroEntriesPreprocessor &)=delete
DualizerPreprocessor(const GlopParameters *parameters)
virtual void RecoverSolution(ProblemSolution *solution) const =0
void RecoverSolution(ProblemSolution *solution) const final
void RecoverSolution(ProblemSolution *solution) const final
SingletonPreprocessor & operator=(const SingletonPreprocessor &)=delete
void RemoveZeroCostUnconstrainedVariable(ColIndex col, Fractional target_bound, LinearProgram *lp)
Preprocessor(const GlopParameters *parameters)
void RecoverSolution(ProblemSolution *solution) const final
~EmptyColumnPreprocessor() final
DoubletonEqualityRowPreprocessor(const GlopParameters *parameters)
bool Run(LinearProgram *lp) final
AddSlackVariablesPreprocessor(const GlopParameters *parameters)
bool IsColumnMarked(ColIndex col) const
UnconstrainedVariablePreprocessor & operator=(const UnconstrainedVariablePreprocessor &)=delete
FreeConstraintPreprocessor & operator=(const FreeConstraintPreprocessor &)=delete
ProportionalColumnPreprocessor(const ProportionalColumnPreprocessor &)=delete
UnconstrainedVariablePreprocessor(const GlopParameters *parameters)
bool IsSmallerWithinFeasibilityTolerance(Fractional a, Fractional b) const
DualizerPreprocessor(const DualizerPreprocessor &)=delete
~DoubletonEqualityRowPreprocessor() final
~ProportionalColumnPreprocessor() final
DoubletonFreeColumnPreprocessor(const GlopParameters *parameters)
FixedVariablePreprocessor(const FixedVariablePreprocessor &)=delete
ToMinimizationPreprocessor & operator=(const ToMinimizationPreprocessor &)=delete
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
EmptyColumnPreprocessor(const EmptyColumnPreprocessor &)=delete
StrictITIVector< RowIndex, Fractional > DenseColumn
EmptyConstraintPreprocessor & operator=(const EmptyConstraintPreprocessor &)=delete
ProportionalRowPreprocessor & operator=(const ProportionalRowPreprocessor &)=delete
~UnconstrainedVariablePreprocessor() final
ProportionalRowPreprocessor(const GlopParameters *parameters)
~ScalingPreprocessor() final
void Undo(const GlopParameters ¶meters, const SparseMatrix &deleted_columns, const SparseMatrix &deleted_rows, ProblemSolution *solution) const
ShiftVariableBoundsPreprocessor(const GlopParameters *parameters)
void RecoverSolution(ProblemSolution *solution) const final
RemoveNearZeroEntriesPreprocessor & operator=(const RemoveNearZeroEntriesPreprocessor &)=delete
bool Run(LinearProgram *lp) final
~ToMinimizationPreprocessor() final
~SingletonColumnSignPreprocessor() final
RemoveNearZeroEntriesPreprocessor(const GlopParameters *parameters)
void UseInMipContext() final
void FixConstraintWithFixedStatuses(const DenseColumn &row_lower_bounds, const DenseColumn &row_upper_bounds, ProblemSolution *solution)
ShiftVariableBoundsPreprocessor(const ShiftVariableBoundsPreprocessor &)=delete
@ SINGLETON_COLUMN_IN_EQUALITY
void RecoverSolution(ProblemSolution *solution) const override
bool IsSmallerWithinTolerance(FloatType x, FloatType y, FloatType tolerance)
DoubletonFreeColumnPreprocessor(const DoubletonFreeColumnPreprocessor &)=delete
SingletonColumnSignPreprocessor(const GlopParameters *parameters)
ProblemStatus ChangeStatusToDualStatus(ProblemStatus status) const
AddSlackVariablesPreprocessor & operator=(const AddSlackVariablesPreprocessor &)=delete
void UnmarkRow(RowIndex row)
void RecoverSolution(ProblemSolution *solution) const final
void RestoreDeletedColumns(ProblemSolution *solution) const
MainLpPreprocessor(const GlopParameters *parameters)
void RecoverSolution(ProblemSolution *solution) const final
EmptyColumnPreprocessor & operator=(const EmptyColumnPreprocessor &)=delete
FreeConstraintPreprocessor(const GlopParameters *parameters)
@ ZERO_COST_SINGLETON_COLUMN
~ShiftVariableBoundsPreprocessor() final
void RecoverSolution(ProblemSolution *solution) const final
std::unique_ptr< TimeLimit > infinite_time_limit_
ForcingAndImpliedFreeConstraintPreprocessor(const GlopParameters *parameters)
void RecoverSolution(ProblemSolution *solution) const final
void RecoverSolution(ProblemSolution *solution) const final
ProportionalColumnPreprocessor & operator=(const ProportionalColumnPreprocessor &)=delete