73 #ifndef OR_TOOLS_GLOP_MARKOWITZ_H_
74 #define OR_TOOLS_GLOP_MARKOWITZ_H_
81 #include "absl/container/inlined_vector.h"
84 #include "ortools/glop/parameters.pb.h"
110 void Reset(RowIndex num_rows, ColIndex num_cols);
118 std::vector<ColIndex>* singleton_columns,
119 std::vector<RowIndex>* singleton_rows);
153 void Update(RowIndex pivot_row, ColIndex pivot_col,
159 DCHECK(!deleted_columns_[
col]);
160 return col_degree_[
col];
171 return row_non_zero_[
row];
177 void MergeInto(RowIndex pivot_row, RowIndex
row);
184 void MergeIntoSorted(RowIndex pivot_row, RowIndex
row);
198 std::vector<ColIndex> col_scratchpad_;
199 ColIndex num_non_deleted_columns_;
216 void Reset(int32_t max_degree, ColIndex num_cols);
230 std::vector<std::vector<ColIndex>> col_by_degree_;
244 void Reset(ColIndex num_cols);
267 std::vector<int> free_columns_;
268 std::vector<SparseColumn> columns_;
286 ABSL_MUST_USE_RESULT
Status
312 std::string
StatString()
const {
return stats_.StatString(); }
324 basis_singleton_column_ratio(
"basis_singleton_column_ratio", this),
325 basis_residual_singleton_column_ratio(
326 "basis_residual_singleton_column_ratio", this),
327 pivots_without_fill_in_ratio(
"pivots_without_fill_in_ratio", this),
328 degree_two_pivot_columns(
"degree_two_pivot_columns", this) {}
342 void ExtractSingletonColumns(
const CompactSparseMatrixView& basis_matrix,
353 void ExtractResidualSingletonColumns(
354 const CompactSparseMatrixView& basis_matrix,
RowPermutation* row_perm,
359 bool IsResidualSingletonColumn(
const ColumnView&
column,
384 ColIndex* pivot_col,
Fractional* pivot_coefficient);
388 void UpdateDegree(ColIndex
col,
int degree);
392 void RemoveRowFromResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
393 void RemoveColumnFromResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
399 void UpdateResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
402 CompactSparseMatrixView
const* basis_matrix_;
407 SparseMatrixWithReusableColumnMemory permuted_lower_;
408 SparseMatrixWithReusableColumnMemory permuted_upper_;
413 TriangularMatrix lower_;
414 TriangularMatrix upper_;
423 MatrixNonZeroPattern residual_matrix_non_zero_;
426 ColumnPriorityQueue col_by_degree_;
429 bool contains_only_singleton_columns_;
432 bool is_col_by_degree_initialized_;
436 std::vector<ColIndex> examined_col_;
441 std::vector<ColIndex> singleton_column_;
444 std::vector<RowIndex> singleton_row_;
447 GlopParameters parameters_;
450 int64_t num_fp_operations_;
void Reset(int32_t max_degree, ColIndex num_cols)
void PushOrAdjust(ColIndex col, int32_t degree)
double DeterministicTimeOfLastFactorization() const
ABSL_MUST_USE_RESULT Status ComputeLU(const CompactSparseMatrixView &basis_matrix, RowPermutation *row_perm, ColumnPermutation *col_perm, TriangularMatrix *lower, TriangularMatrix *upper)
void SetParameters(const GlopParameters ¶meters)
std::string StatString() const
ABSL_MUST_USE_RESULT Status ComputeRowAndColumnPermutation(const CompactSparseMatrixView &basis_matrix, RowPermutation *row_perm, ColumnPermutation *col_perm)
const absl::InlinedVector< ColIndex, 6 > & RowNonZero(RowIndex row) const
bool IsColumnDeleted(ColIndex col) const
void RemoveDeletedColumnsFromRow(RowIndex row)
int32_t DecreaseColDegree(ColIndex col)
void DeleteRowAndColumn(RowIndex pivot_row, ColIndex pivot_col)
int32_t RowDegree(RowIndex row) const
void AddEntry(RowIndex row, ColIndex col)
void Reset(RowIndex num_rows, ColIndex num_cols)
void Update(RowIndex pivot_row, ColIndex pivot_col, const SparseColumn &column)
int32_t DecreaseRowDegree(RowIndex row)
int32_t ColDegree(ColIndex col) const
ColIndex GetFirstNonDeletedColumnFromRow(RowIndex row) const
void InitializeFromMatrixSubset(const CompactSparseMatrixView &basis_matrix, const RowPermutation &row_perm, const ColumnPermutation &col_perm, std::vector< ColIndex > *singleton_columns, std::vector< RowIndex > *singleton_rows)
void Reset(ColIndex num_cols)
void ClearAndReleaseColumn(ColIndex col)
SparseColumn * mutable_column(ColIndex col)
const SparseColumn & column(ColIndex col) const
SparseMatrixWithReusableColumnMemory()
Permutation< ColIndex > ColumnPermutation
StrictITIVector< ColIndex, bool > DenseBooleanRow
Permutation< RowIndex > RowPermutation
Collection of objects used to extend the Constraint Solver library.