14 #ifndef OR_TOOLS_LP_DATA_SPARSE_COLUMN_H_
15 #define OR_TOOLS_LP_DATA_SPARSE_COLUMN_H_
83 coefficients_(
column.coefficient_) {}
86 return coefficients_[i.value()];
91 RowIndex
EntryRow(EntryIndex i)
const {
return rows_[i.value()]; }
95 return Iterator(this->rows_, this->coefficients_, EntryIndex(0));
99 return Iterator(this->rows_, this->coefficients_, num_entries_);
104 for (
const auto e : *
this) {
105 if (e.row() ==
index) {
110 value = e.coefficient();
116 bool IsEmpty()
const {
return num_entries_ == EntryIndex(0); }
119 const EntryIndex num_entries_;
120 const RowIndex*
const rows_;
143 void Resize(RowIndex num_rows);
149 MarkRowAsChanged(
row);
156 MarkRowAsChanged(
row);
177 void MarkRowAsChanged(RowIndex
row) {
178 if (!changed_[
row]) {
179 changed_[
row] =
true;
180 row_change_.push_back(
row);
191 std::vector<RowIndex> row_change_;
ColumnView(EntryIndex num_entries, const RowIndex *rows, const Fractional *const coefficients)
Fractional LookUpCoefficient(RowIndex index) const
VectorIterator< Entry > Iterator
RowIndex GetFirstRow() const
Fractional EntryCoefficient(EntryIndex i) const
Fractional GetFirstCoefficient() const
ColumnView(const SparseColumn &column)
RowIndex EntryRow(EntryIndex i) const
EntryIndex num_entries() const
RandomAccessSparseColumn(RowIndex num_rows)
void AddToCoefficient(RowIndex row, Fractional value)
void Resize(RowIndex num_rows)
void PopulateSparseColumn(SparseColumn *sparse_column) const
Fractional GetCoefficient(RowIndex row) const
virtual ~RandomAccessSparseColumn()
void PopulateFromSparseColumn(const SparseColumn &sparse_column)
RowIndex GetNumberOfRows() const
void SetCoefficient(RowIndex row, Fractional value)
SparseColumnEntry(const RowIndex *indices, const Fractional *coefficients, EntryIndex i)
void ApplyRowPermutation(const RowPermutation &p)
void ApplyPartialRowPermutation(const RowPermutation &p)
RowIndex GetFirstRow() const
RowIndex GetLastRow() const
Fractional EntryCoefficient(EntryIndex i) const
RowIndex EntryRow(EntryIndex i) const
void ApplyIndexPermutation(const IndexPermutation &index_perm)
Index GetIndex(EntryIndex i) const
Index GetLastIndex() const
Index GetFirstIndex() const
void ApplyPartialIndexPermutation(const IndexPermutation &index_perm)
Fractional GetCoefficient(EntryIndex i) const
absl::Span< const double > coefficients
const RowIndex kNonPivotal(-1)
StrictITIVector< RowIndex, Fractional > DenseColumn
StrictITIVector< RowIndex, bool > DenseBooleanColumn
Collection of objects used to extend the Constraint Solver library.