73#ifndef OR_TOOLS_GLOP_MARKOWITZ_H_
74#define OR_TOOLS_GLOP_MARKOWITZ_H_
79#include "absl/container/inlined_vector.h"
82#include "ortools/glop/parameters.pb.h"
108 void Reset(RowIndex num_rows, ColIndex num_cols);
116 std::vector<ColIndex>* singleton_columns,
117 std::vector<RowIndex>* singleton_rows);
151 void Update(RowIndex pivot_row, ColIndex pivot_col,
158 return col_degree_[
col];
169 return row_non_zero_[
row];
175 void MergeInto(RowIndex pivot_row, RowIndex
row);
182 void MergeIntoSorted(RowIndex pivot_row, RowIndex
row);
196 std::vector<ColIndex> col_scratchpad_;
197 ColIndex num_non_deleted_columns_;
214 void Reset(int32_t max_degree, ColIndex num_cols);
228 std::vector<std::vector<ColIndex>> col_by_degree_;
242 void Reset(ColIndex num_cols);
265 std::vector<int> free_columns_;
266 std::vector<SparseColumn> columns_;
284 ABSL_MUST_USE_RESULT
Status
310 std::string
StatString()
const {
return stats_.StatString(); }
322 basis_singleton_column_ratio(
"basis_singleton_column_ratio", this),
323 basis_residual_singleton_column_ratio(
324 "basis_residual_singleton_column_ratio", this),
325 pivots_without_fill_in_ratio(
"pivots_without_fill_in_ratio", this),
326 degree_two_pivot_columns(
"degree_two_pivot_columns", this) {}
340 void ExtractSingletonColumns(
const CompactSparseMatrixView& basis_matrix,
351 void ExtractResidualSingletonColumns(
352 const CompactSparseMatrixView& basis_matrix,
RowPermutation* row_perm,
357 bool IsResidualSingletonColumn(
const ColumnView& column,
382 ColIndex* pivot_col,
Fractional* pivot_coefficient);
386 void UpdateDegree(ColIndex
col,
int degree);
390 void RemoveRowFromResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
391 void RemoveColumnFromResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
397 void UpdateResidualMatrix(RowIndex pivot_row, ColIndex pivot_col);
400 CompactSparseMatrixView
const* basis_matrix_;
405 SparseMatrixWithReusableColumnMemory permuted_lower_;
406 SparseMatrixWithReusableColumnMemory permuted_upper_;
411 TriangularMatrix lower_;
412 TriangularMatrix upper_;
421 MatrixNonZeroPattern residual_matrix_non_zero_;
424 ColumnPriorityQueue col_by_degree_;
427 bool contains_only_singleton_columns_;
430 bool is_col_by_degree_initialized_;
434 std::vector<ColIndex> examined_col_;
439 std::vector<ColIndex> singleton_column_;
442 std::vector<RowIndex> singleton_row_;
445 GlopParameters parameters_;
448 int64_t num_fp_operations_;
#define DCHECK(condition)
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)
bool IsColumnDeleted(ColIndex col) const
void RemoveDeletedColumnsFromRow(RowIndex row)
int32_t DecreaseColDegree(ColIndex col)
const absl::InlinedVector< ColIndex, 6 > & RowNonZero(RowIndex row) const
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.