14 #ifndef OR_TOOLS_GLOP_RANK_ONE_UPDATE_H_
15 #define OR_TOOLS_GLOP_RANK_ONE_UPDATE_H_
49 ColIndex u_index, ColIndex v_index,
73 if (multiplier != 0.0) {
92 if (multiplier != 0.0) {
127 const CompactSparseMatrix* storage_;
146 elementary_matrices_.clear();
152 elementary_matrices_.push_back(update_matrix);
159 for (
int i = elementary_matrices_.size() - 1; i >= 0; --i) {
160 elementary_matrices_[i].LeftSolve(y);
178 for (
int i = elementary_matrices_.size() - 1; i >= 0; --i) {
180 elementary_matrices_[i].LeftSolve(&y->
values);
182 elementary_matrices_[i].LeftSolveWithNonZeros(y);
194 const size_t end = elementary_matrices_.size();
195 for (
int i = 0; i <
end; ++i) {
196 elementary_matrices_[i].RightSolve(d);
214 const size_t end = elementary_matrices_.size();
215 for (
int i = 0; i <
end; ++i) {
217 elementary_matrices_[i].RightSolve(&d->
values);
219 elementary_matrices_[i].RightSolveWithNonZeros(d);
240 mutable double dtime_ = 0.0;
242 double hypersparse_ratio_;
243 EntryIndex num_entries_;
244 std::vector<RankOneUpdateElementaryMatrix> elementary_matrices_;
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