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"
122 RowIndex leaving_row,
128 parameters_ = parameters;
133 pricing_rule_ = rule;
143 std::string
StatString()
const {
return stats_.StatString(); }
157 direction_left_inverse_density(
"direction_left_inverse_density",
159 direction_left_inverse_accuracy(
"direction_left_inverse_accuracy",
161 edges_norm_accuracy(
"edges_norm_accuracy", this),
162 lower_bounded_norms(
"lower_bounded_norms", this) {}
170 void ComputeMatrixColumnNorms();
173 void ComputeEdgeSquaredNorms();
177 void ComputeDirectionLeftInverse(ColIndex entering_col,
178 const ScatteredColumn& direction);
181 void UpdateEdgeSquaredNorms(ColIndex entering_col, ColIndex leaving_col,
182 RowIndex leaving_row,
184 const UpdateRow& update_row);
187 void ResetDevexWeights();
190 void UpdateDevexWeights(ColIndex entering_col, ColIndex leaving_col,
191 RowIndex leaving_row,
const DenseColumn& direction,
192 const UpdateRow& update_row);
195 const CompactSparseMatrix& compact_matrix_;
196 const VariablesInfo& variables_info_;
197 const BasisFactorization& basis_factorization_;
198 TimeLimit* time_limit_ =
nullptr;
201 GlopParameters parameters_;
202 GlopParameters::PricingRule pricing_rule_ = GlopParameters::DANTZIG;
206 bool must_refactorize_basis_;
207 bool recompute_edge_squared_norms_;
208 bool reset_devex_weights_;
223 int num_devex_updates_since_reset_;
229 ScatteredRow direction_left_inverse_;
232 int64_t num_operations_;
236 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.
PrimalEdgeNorms & operator=(const PrimalEdgeNorms &)=delete
void SetTimeLimit(TimeLimit *time_limit)
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.
StrictITISpan< ColIndex, const Fractional > ConstView
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.