14#ifndef ORTOOLS_GLOP_BASIS_REPRESENTATION_H_
15#define ORTOOLS_GLOP_BASIS_REPRESENTATION_H_
60 EtaMatrix(
const EtaMatrix&) =
delete;
61 EtaMatrix& operator=(
const EtaMatrix&) =
delete;
89 void LeftSolveWithDenseEta(
DenseRow* y)
const;
90 void LeftSolveWithSparseEta(
DenseRow* y)
const;
101 const ColIndex eta_col_;
130 void Update(ColIndex entering_col, RowIndex leaving_variable_row,
146 std::vector<EtaMatrix*> eta_matrix_;
174 use_middle_product_form_update_ =
176 parameters_ = parameters;
177 lu_factorization_.SetParameters(parameters);
184 return lu_factorization_.GetColumnPermutation();
192 lu_factorization_.SetColumnPermutationToIdentity();
235 ABSL_MUST_USE_RESULT
Status Update(ColIndex entering_col,
236 RowIndex leaving_variable_row,
302 return stats_.StatString() + lu_factorization_.StatString();
314 return lu_factorization_.NumberOfEntries();
319 Status ComputeFactorization();
323 bool IsIdentityBasis()
const;
328 ABSL_MUST_USE_RESULT
Status
329 MiddleProductFormUpdate(ColIndex entering_col, RowIndex leaving_variable_row);
333 void BumpDeterministicTimeForSolve(
int num_entries)
const;
339 refactorization_interval(
"refactorization_interval", this) {}
345 mutable Stats stats_;
346 GlopParameters parameters_;
349 const CompactSparseMatrix& compact_matrix_;
354 RankOneUpdateFactorization rank_one_factorization_;
356 mutable std::vector<RowIndex> scratchpad_non_zeros_;
361 mutable ScatteredColumn tau_;
379 mutable bool tau_computation_can_be_optimized_;
380 mutable bool tau_is_computed_;
386 mutable CompactSparseMatrix storage_;
387 mutable CompactSparseMatrix right_storage_;
391 bool use_middle_product_form_update_;
392 int max_num_updates_;
394 EtaFactorization eta_factorization_;
395 LuFactorization lu_factorization_;
398 double last_factorization_deterministic_time_ = 0.0;
399 mutable double deterministic_time_;
Fractional ComputeInfinityNorm() const
std::string StatString() const
double DeterministicTime() const
Fractional ComputeInverseInfinityNorm() const
Fractional ComputeOneNormConditionNumber() const
ABSL_MUST_USE_RESULT Status ForceRefactorization()
ABSL_MUST_USE_RESULT Status Update(ColIndex entering_col, RowIndex leaving_variable_row, const ScatteredColumn &direction)
const DenseColumn & RightSolveForTau(const ScatteredColumn &a) const
void SetParameters(const GlopParameters ¶meters)
const ColumnPermutation & GetColumnPermutation() const
void RightSolve(ScatteredColumn *d) const
void LeftSolveForUnitRow(ColIndex j, ScatteredRow *y) const
RowToColMapping ComputeInitialBasis(const std::vector< ColIndex > &candidates)
void TemporaryLeftSolveForUnitRow(ColIndex j, ScatteredRow *y) const
ABSL_MUST_USE_RESULT Status Initialize()
bool IsRefactorized() const
BasisFactorization(const CompactSparseMatrix *compact_matrix, const RowToColMapping *basis)
Fractional RightSolveSquaredNorm(const ColumnView &a) const
Fractional ComputeInfinityNormConditionNumberUpperBound() const
EntryIndex NumberOfEntriesInLU() const
RowIndex GetNumberOfRows() const
BasisFactorization(const BasisFactorization &)=delete
void RightSolveForProblemColumn(ColIndex col, ScatteredColumn *d) const
Fractional ComputeOneNorm() const
BasisFactorization & operator=(const BasisFactorization &)=delete
ABSL_MUST_USE_RESULT Status Refactorize()
Fractional ComputeInfinityNormConditionNumber() const
void LeftSolve(ScatteredRow *y) const
Fractional DualEdgeSquaredNorm(RowIndex row) const
void SetColumnPermutationToIdentity()
virtual ~BasisFactorization()
Fractional ComputeInverseOneNorm() const
virtual ~EtaFactorization()
void RightSolve(DenseColumn *d) const
EtaFactorization & operator=(const EtaFactorization &)=delete
void SparseLeftSolve(DenseRow *y, ColIndexVector *pos) const
void LeftSolve(DenseRow *y) const
void Update(ColIndex entering_col, RowIndex leaving_variable_row, const ScatteredColumn &direction)
EtaFactorization(const EtaFactorization &)=delete
bool use_middle_product_form_update() const
::int32_t basis_refactorization_period() const
StrictITIVector< RowIndex, ColIndex > RowToColMapping
std::vector< ColIndex > ColIndexVector
StrictITIVector< ColIndex, ColIndex > ColMapping
Permutation< ColIndex > ColumnPermutation
StrictITIVector< RowIndex, Fractional > DenseColumn
StrictITIVector< ColIndex, Fractional > DenseRow