14#ifndef OR_TOOLS_GLOP_RANK_ONE_UPDATE_H_
15#define OR_TOOLS_GLOP_RANK_ONE_UPDATE_H_
47 ColIndex u_index, ColIndex v_index,
71 if (multiplier != 0.0) {
90 if (multiplier != 0.0) {
125 const CompactSparseMatrix* storage_;
144 elementary_matrices_.clear();
150 elementary_matrices_.push_back(update_matrix);
157 for (
int i = elementary_matrices_.size() - 1; i >= 0; --i) {
158 elementary_matrices_[i].LeftSolve(y);
176 for (
int i = elementary_matrices_.size() - 1; i >= 0; --i) {
178 elementary_matrices_[i].LeftSolve(&y->
values);
180 elementary_matrices_[i].LeftSolveWithNonZeros(y);
192 const size_t end = elementary_matrices_.size();
193 for (
int i = 0; i <
end; ++i) {
194 elementary_matrices_[i].RightSolve(d);
212 const size_t end = elementary_matrices_.size();
213 for (
int i = 0; i <
end; ++i) {
215 elementary_matrices_[i].RightSolve(&d->
values);
217 elementary_matrices_[i].RightSolveWithNonZeros(d);
238 mutable double dtime_ = 0.0;
240 double hypersparse_ratio_;
241 EntryIndex num_entries_;
242 std::vector<RankOneUpdateElementaryMatrix> elementary_matrices_;
#define DCHECK(condition)
EntryIndex num_entries() const
void ColumnCopyToDenseColumn(ColIndex col, DenseColumn *dense_column) const
void ColumnAddMultipleToSparseScatteredColumn(ColIndex col, Fractional multiplier, ScatteredColumn *column) const
Fractional ColumnScalarProduct(ColIndex col, const DenseRow &vector) const
void ColumnAddMultipleToDenseColumn(ColIndex col, Fractional multiplier, DenseColumn *dense_column) const
ColumnView column(ColIndex col) const
void RightMultiply(DenseColumn *x) const
RankOneUpdateElementaryMatrix(const CompactSparseMatrix *storage, ColIndex u_index, ColIndex v_index, Fractional u_dot_v)
void LeftSolve(DenseRow *y) const
void LeftSolveWithNonZeros(ScatteredRow *y) const
void RightSolve(DenseColumn *x) const
void LeftMultiply(DenseRow *y) const
void RightSolveWithNonZeros(ScatteredColumn *x) const
EntryIndex num_entries() const
void RightSolveWithNonZeros(ScatteredColumn *d) const
void RightSolve(DenseColumn *d) const
void LeftSolve(DenseRow *y) const
void LeftSolveWithNonZeros(ScatteredRow *y) const
void ResetDeterministicTime()
double DeterministicTimeSinceLastReset() const
void Update(const RankOneUpdateElementaryMatrix &update_matrix)
EntryIndex num_entries() const
RankOneUpdateFactorization()
void set_hypersparse_ratio(double value)
bool IsAllFalse(const BoolVector &v)
const DenseRow & Transpose(const DenseColumn &col)
static double DeterministicTimeForFpOperations(int64_t n)
Collection of objects used to extend the Constraint Solver library.
#define RETURN_IF_NULL(x)
std::optional< int64_t > end
void RepopulateSparseMask()
bool ShouldUseDenseIteration(double ratio_for_using_dense_representation) const
void ClearNonZerosIfTooDense(double ratio_for_using_dense_representation)
std::vector< Index > non_zeros
StrictITIVector< Index, bool > is_non_zero
StrictITIVector< Index, Fractional > values