 |
OR-Tools
8.0
|
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,
427 void DeleteZeroCostSingletonColumn(
const SparseMatrix& matrix_transpose,
447 bool MakeConstraintAnEqualityIfPossible(
const SparseMatrix& matrix_transpose,
453 void DeleteSingletonColumnInEquality(
const SparseMatrix& matrix_transpose,
458 std::vector<SingletonUndo> undo_stack_;
526 bool lp_is_maximization_problem_;
631 RowIndex
row[NUM_ROWS];
635 SparseColumn deleted_row_as_column;
638 std::vector<RestoreInfo> restore_stack_;
639 RowDeletionHelper row_deletion_helper_;
788 std::vector<ColIndex> changed_columns_;
814 NUM_DOUBLETON_COLS = 2,
816 static ColChoice OtherColChoice(ColChoice x) {
817 return x == DELETED ? MODIFIED : DELETED;
820 ColumnDeletionHelper column_deletion_helper_;
821 RowDeletionHelper row_deletion_helper_;
830 ColIndex
col[NUM_DOUBLETON_COLS];
834 SparseColumn column[NUM_DOUBLETON_COLS];
835 Fractional objective_coefficient[NUM_DOUBLETON_COLS];
850 ColChoiceAndStatus bound_backtracking_at_lower_bound;
851 ColChoiceAndStatus bound_backtracking_at_upper_bound;
853 void SwapDeletedAndModifiedVariableRestoreInfo(RestoreInfo* r);
855 std::vector<RestoreInfo> restore_stack_;
874 ProblemSolution* solution);
894 LOG(FATAL) <<
"In the presence of integer variables, "
895 <<
"there is no notion of a dual problem.";
905 RowIndex primal_num_rows_;
906 ColIndex primal_num_cols_;
907 bool primal_is_maximization_problem_;
1032 ColIndex first_slack_col_;
1038 #endif // OR_TOOLS_GLOP_PREPROCESSOR_H_
RowDeletionHelper & operator=(const RowDeletionHelper &)=delete
ImpliedFreePreprocessor(const ImpliedFreePreprocessor &)=delete
void UnmarkRow(RowIndex row)
ToMinimizationPreprocessor(const ToMinimizationPreprocessor &)=delete
@ ZERO_COST_SINGLETON_COLUMN
DoubletonFreeColumnPreprocessor(const DoubletonFreeColumnPreprocessor &)=delete
RemoveNearZeroEntriesPreprocessor(const RemoveNearZeroEntriesPreprocessor &)=delete
void RestoreDeletedColumns(ProblemSolution *solution) const
bool Run(LinearProgram *lp) final
void RecoverSolution(ProblemSolution *solution) const final
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
EmptyColumnPreprocessor(const EmptyColumnPreprocessor &)=delete
virtual bool Run(LinearProgram *lp)=0
void RecoverSolution(ProblemSolution *solution) const final
EmptyConstraintPreprocessor(const GlopParameters *parameters)
std::unique_ptr< TimeLimit > infinite_time_limit_
DoubletonFreeColumnPreprocessor & operator=(const DoubletonFreeColumnPreprocessor &)=delete
~FixedVariablePreprocessor() final
DualizerPreprocessor(const GlopParameters *parameters)
@ SINGLETON_COLUMN_IN_EQUALITY
AddSlackVariablesPreprocessor & operator=(const AddSlackVariablesPreprocessor &)=delete
const DenseRow & GetStoredValue() const
~MainLpPreprocessor() override
void RecoverSolution(ProblemSolution *solution) const final
void RecoverSolution(ProblemSolution *solution) const final
ProportionalColumnPreprocessor(const ProportionalColumnPreprocessor &)=delete
bool Run(LinearProgram *lp) final
DoubletonEqualityRowPreprocessor(const DoubletonEqualityRowPreprocessor &)=delete
bool Run(LinearProgram *lp) final
EmptyConstraintPreprocessor & operator=(const EmptyConstraintPreprocessor &)=delete
void MarkColumnForDeletion(ColIndex col)
void MarkRowForDeletion(RowIndex row)
~RemoveNearZeroEntriesPreprocessor() final
bool IsSmallerWithinFeasibilityTolerance(Fractional a, Fractional b) const
~SingletonPreprocessor() final
~ImpliedFreePreprocessor() final
bool Run(LinearProgram *lp) final
const GlopParameters & parameters_
MainLpPreprocessor & operator=(const MainLpPreprocessor &)=delete
bool IsColumnMarked(ColIndex col) const
void SetTimeLimit(TimeLimit *time_limit)
ForcingAndImpliedFreeConstraintPreprocessor(const GlopParameters *parameters)
~UnconstrainedVariablePreprocessor() final
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
SingletonColumnSignPreprocessor(const SingletonColumnSignPreprocessor &)=delete
EmptyColumnPreprocessor & operator=(const EmptyColumnPreprocessor &)=delete
DoubletonFreeColumnPreprocessor(const GlopParameters *parameters)
Preprocessor(const Preprocessor &)=delete
~ForcingAndImpliedFreeConstraintPreprocessor() final
~EmptyColumnPreprocessor() final
bool IsSmallerWithinPreprocessorZeroTolerance(Fractional a, Fractional b) const
virtual void UseInMipContext()
ScalingPreprocessor & operator=(const ScalingPreprocessor &)=delete
void RestoreDeletedRows(ProblemSolution *solution) const
bool Run(LinearProgram *lp) final
DoubletonEqualityRowPreprocessor & operator=(const DoubletonEqualityRowPreprocessor &)=delete
@ MAKE_CONSTRAINT_AN_EQUALITY
ColumnDeletionHelper(const ColumnDeletionHelper &)=delete
~ToMinimizationPreprocessor() final
void RecoverSolution(ProblemSolution *solution) const final
const DenseBooleanColumn & GetMarkedRows() const
FreeConstraintPreprocessor(const FreeConstraintPreprocessor &)=delete
ProportionalColumnPreprocessor & operator=(const ProportionalColumnPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const override
void RecoverSolution(ProblemSolution *solution) const final
void UseInMipContext() final
ShiftVariableBoundsPreprocessor(const GlopParameters *parameters)
ShiftVariableBoundsPreprocessor & operator=(const ShiftVariableBoundsPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
bool Run(LinearProgram *lp) final
SingletonPreprocessor & operator=(const SingletonPreprocessor &)=delete
bool Run(LinearProgram *lp) final
~EmptyConstraintPreprocessor() final
bool Run(LinearProgram *lp) final
ProblemStatus status() const
SharedTimeLimit * time_limit
void RemoveZeroCostUnconstrainedVariable(ColIndex col, Fractional target_bound, LinearProgram *lp)
void RecoverSolution(ProblemSolution *solution) const final
~ShiftVariableBoundsPreprocessor() final
ForcingAndImpliedFreeConstraintPreprocessor(const ForcingAndImpliedFreeConstraintPreprocessor &)=delete
Preprocessor & operator=(const Preprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
EmptyColumnPreprocessor(const GlopParameters *parameters)
~ProportionalColumnPreprocessor() final
SingletonUndo(OperationType type, const LinearProgram &lp, MatrixEntry e, ConstraintStatus status)
MainLpPreprocessor(const GlopParameters *parameters)
bool Run(LinearProgram *lp) final
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
RemoveNearZeroEntriesPreprocessor & operator=(const RemoveNearZeroEntriesPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
SingletonPreprocessor(const GlopParameters *parameters)
ShiftVariableBoundsPreprocessor(const ShiftVariableBoundsPreprocessor &)=delete
FreeConstraintPreprocessor & operator=(const FreeConstraintPreprocessor &)=delete
DualizerPreprocessor & operator=(const DualizerPreprocessor &)=delete
FixedVariablePreprocessor(const FixedVariablePreprocessor &)=delete
ProportionalRowPreprocessor & operator=(const ProportionalRowPreprocessor &)=delete
bool Run(LinearProgram *lp) final
bool Run(LinearProgram *lp) final
UnconstrainedVariablePreprocessor & operator=(const UnconstrainedVariablePreprocessor &)=delete
bool Run(LinearProgram *lp) final
RemoveNearZeroEntriesPreprocessor(const GlopParameters *parameters)
UnconstrainedVariablePreprocessor(const GlopParameters *parameters)
ForcingAndImpliedFreeConstraintPreprocessor & operator=(const ForcingAndImpliedFreeConstraintPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
bool Run(LinearProgram *lp) final
void RecoverSolution(ProblemSolution *solution) const final
~ProportionalRowPreprocessor() final
void RecoverSolution(ProblemSolution *solution) const final
MatrixEntry(RowIndex _row, ColIndex _col, Fractional _coeff)
SingletonPreprocessor(const SingletonPreprocessor &)=delete
RowDeletionHelper(const RowDeletionHelper &)=delete
void RecoverSolution(ProblemSolution *solution) const final
~DoubletonFreeColumnPreprocessor() final
ColumnDeletionHelper & operator=(const ColumnDeletionHelper &)=delete
bool Run(LinearProgram *lp) final
ProportionalColumnPreprocessor(const GlopParameters *parameters)
DoubletonEqualityRowPreprocessor(const GlopParameters *parameters)
bool Run(LinearProgram *lp) final
UnconstrainedVariablePreprocessor(const UnconstrainedVariablePreprocessor &)=delete
ToMinimizationPreprocessor & operator=(const ToMinimizationPreprocessor &)=delete
void Undo(const GlopParameters ¶meters, const SparseMatrix &deleted_columns, const SparseMatrix &deleted_rows, ProblemSolution *solution) const
ScalingPreprocessor(const ScalingPreprocessor &)=delete
SingletonColumnSignPreprocessor & operator=(const SingletonColumnSignPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
~DoubletonEqualityRowPreprocessor() final
AddSlackVariablesPreprocessor(const GlopParameters *parameters)
ProportionalRowPreprocessor(const ProportionalRowPreprocessor &)=delete
~AddSlackVariablesPreprocessor() final
ImpliedFreePreprocessor & operator=(const ImpliedFreePreprocessor &)=delete
bool IsRowMarked(RowIndex row) const
const DenseBooleanRow & GetMarkedColumns() const
void UseInMipContext() final
void RecoverSolution(ProblemSolution *solution) const final
StrictITIVector< RowIndex, Fractional > DenseColumn
AddSlackVariablesPreprocessor(const AddSlackVariablesPreprocessor &)=delete
bool Run(LinearProgram *lp) final
FixedVariablePreprocessor & operator=(const FixedVariablePreprocessor &)=delete
SingletonColumnSignPreprocessor(const GlopParameters *parameters)
void RecoverSolution(ProblemSolution *solution) const final
~SingletonColumnSignPreprocessor() final
void RecoverSolution(ProblemSolution *solution) const final
const DenseRow & offsets() const
~DualizerPreprocessor() final
ToMinimizationPreprocessor(const GlopParameters *parameters)
void UseInMipContext() final
DualizerPreprocessor(const DualizerPreprocessor &)=delete
void RecoverSolution(ProblemSolution *solution) const final
void FixConstraintWithFixedStatuses(const DenseColumn &row_lower_bounds, const DenseColumn &row_upper_bounds, ProblemSolution *solution)
ImpliedFreePreprocessor(const GlopParameters *parameters)
Preprocessor(const GlopParameters *parameters)
ScalingPreprocessor(const GlopParameters *parameters)
virtual void RecoverSolution(ProblemSolution *solution) const =0
ColChoiceAndStatus(ColChoice c, VariableStatus s, Fractional v)
bool IsSmallerWithinTolerance(FloatType x, FloatType y, FloatType tolerance)
bool Run(LinearProgram *lp) final
~FreeConstraintPreprocessor() final
EmptyConstraintPreprocessor(const EmptyConstraintPreprocessor &)=delete
bool Run(LinearProgram *lp) final
MainLpPreprocessor(const MainLpPreprocessor &)=delete
FixedVariablePreprocessor(const GlopParameters *parameters)
ProportionalRowPreprocessor(const GlopParameters *parameters)
FreeConstraintPreprocessor(const GlopParameters *parameters)
void MarkColumnForDeletionWithState(ColIndex col, Fractional value, VariableStatus status)
ProblemStatus ChangeStatusToDualStatus(ProblemStatus status) const
~ScalingPreprocessor() final