14#ifndef OR_TOOLS_LP_DATA_SPARSE_COLUMN_H_
15#define OR_TOOLS_LP_DATA_SPARSE_COLUMN_H_
81 coefficients_(column.coefficient_) {}
84 return coefficients_[i.value()];
89 RowIndex
EntryRow(EntryIndex i)
const {
return rows_[i.value()]; }
93 return Iterator(this->rows_, this->coefficients_, EntryIndex(0));
97 return Iterator(this->rows_, this->coefficients_, num_entries_);
102 for (
const auto e : *
this) {
103 if (e.row() ==
index) {
108 value = e.coefficient();
114 bool IsEmpty()
const {
return num_entries_ == EntryIndex(0); }
117 const EntryIndex num_entries_;
118 const RowIndex*
const rows_;
141 void Resize(RowIndex num_rows);
147 MarkRowAsChanged(
row);
154 MarkRowAsChanged(
row);
175 void MarkRowAsChanged(RowIndex
row) {
176 if (!changed_[
row]) {
177 changed_[
row] =
true;
178 row_change_.push_back(
row);
189 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
const RowIndex kNonPivotal(-1)
StrictITIVector< RowIndex, Fractional > DenseColumn
StrictITIVector< RowIndex, bool > DenseBooleanColumn
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
std::vector< double > coefficients