14#ifndef OR_TOOLS_GLOP_PRIMAL_EDGE_NORMS_H_
15#define OR_TOOLS_GLOP_PRIMAL_EDGE_NORMS_H_
22#include "ortools/glop/parameters.pb.h"
121 RowIndex leaving_row,
132 pricing_rule_ = rule;
154 direction_left_inverse_density(
"direction_left_inverse_density",
156 direction_left_inverse_accuracy(
"direction_left_inverse_accuracy",
158 edges_norm_accuracy(
"edges_norm_accuracy", this),
159 lower_bounded_norms(
"lower_bounded_norms", this) {}
167 void ComputeMatrixColumnNorms();
170 void ComputeEdgeSquaredNorms();
174 void ComputeDirectionLeftInverse(ColIndex entering_col,
175 const ScatteredColumn& direction);
178 void UpdateEdgeSquaredNorms(ColIndex entering_col, ColIndex leaving_col,
179 RowIndex leaving_row,
181 const UpdateRow& update_row);
184 void ResetDevexWeights();
187 void UpdateDevexWeights(ColIndex entering_col, ColIndex leaving_col,
188 RowIndex leaving_row,
const DenseColumn& direction,
189 const UpdateRow& update_row);
192 const CompactSparseMatrix& compact_matrix_;
193 const VariablesInfo& variables_info_;
194 const BasisFactorization& basis_factorization_;
197 GlopParameters parameters_;
198 GlopParameters::PricingRule pricing_rule_ = GlopParameters::DANTZIG;
202 bool must_refactorize_basis_;
203 bool recompute_edge_squared_norms_;
204 bool reset_devex_weights_;
219 int num_devex_updates_since_reset_;
225 ScatteredRow direction_left_inverse_;
228 int64_t num_operations_;
232 std::vector<bool*> watchers_;
Statistic on the distribution of a sequence of doubles.
Statistic on the distribution of a sequence of integers.
Statistic on the distribution of a sequence of ratios, displayed as %.
Base class to print a nice summary of a group of statistics.
std::string StatString() const
PrimalEdgeNorms & operator=(const PrimalEdgeNorms &)=delete
const DenseRow & GetMatrixColumnNorms()
DenseRow::ConstView GetSquaredNorms()
std::string StatString() const
Returns a string with statistics about this class.
void UpdateBeforeBasisPivot(ColIndex entering_col, ColIndex leaving_col, RowIndex leaving_row, const ScatteredColumn &direction, UpdateRow *update_row)
const DenseRow & GetDevexWeights()
void AddRecomputationWatcher(bool *watcher)
double DeterministicTime() const
Deterministic time used by the scalar product computation of this class.
void SetPricingRule(GlopParameters::PricingRule rule)
This changes what GetSquaredNorms() returns.
bool TestEnteringEdgeNormPrecision(ColIndex entering_col, const ScatteredColumn &direction)
PrimalEdgeNorms(const CompactSparseMatrix &compact_matrix, const VariablesInfo &variables_info, const BasisFactorization &basis_factorization)
const DenseRow & GetEdgeSquaredNorms()
bool NeedsBasisRefactorization() const
void SetParameters(const GlopParameters ¶meters)
Sets the algorithm parameters.
PrimalEdgeNorms(const PrimalEdgeNorms &)=delete
This type is neither copyable nor movable.
StrictITIVector< RowIndex, Fractional > DenseColumn
Column-vector types. Column-vector types are indexed by a row index.
StrictITIVector< ColIndex, Fractional > DenseRow
Row-vector types. Row-vector types are indexed by a column index.
static double DeterministicTimeForFpOperations(int64_t n)
In SWIG mode, we don't want anything besides these top-level includes.