 |
OR-Tools
8.1
|
Go to the documentation of this file.
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_;
197 #endif // OR_TOOLS_LP_DATA_SPARSE_COLUMN_H_
Fractional LookUpCoefficient(RowIndex index) const
RowIndex GetNumberOfRows() const
std::vector< double > coefficients
StrictITIVector< RowIndex, bool > DenseBooleanColumn
Fractional GetCoefficient(RowIndex row) const
Index GetFirstIndex() const
void Resize(RowIndex num_rows)
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
void SetCoefficient(RowIndex row, Fractional value)
void ApplyPartialRowPermutation(const RowPermutation &p)
RowIndex EntryRow(EntryIndex i) const
void PopulateSparseColumn(SparseColumn *sparse_column) const
void ApplyIndexPermutation(const IndexPermutation &index_perm)
VectorIterator< Entry > Iterator
Fractional GetFirstCoefficient() const
ColumnView(const SparseColumn &column)
RowIndex GetFirstRow() const
Fractional EntryCoefficient(EntryIndex i) const
const RowIndex kNonPivotal(-1)
void PopulateFromSparseColumn(const SparseColumn &sparse_column)
Index GetIndex(EntryIndex i) const
virtual ~RandomAccessSparseColumn()
RowIndex EntryRow(EntryIndex i) const
EntryIndex num_entries() const
ColumnView(EntryIndex num_entries, const RowIndex *rows, const Fractional *const coefficients)
RandomAccessSparseColumn(RowIndex num_rows)
RowIndex GetFirstRow() const
RowIndex GetLastRow() const
Index GetLastIndex() const
StrictITIVector< RowIndex, Fractional > DenseColumn
Fractional GetCoefficient(EntryIndex i) const
void ApplyRowPermutation(const RowPermutation &p)
void AddToCoefficient(RowIndex row, Fractional value)
SparseColumnEntry(const RowIndex *indices, const Fractional *coefficients, EntryIndex i)
void ApplyPartialIndexPermutation(const IndexPermutation &index_perm)
Fractional EntryCoefficient(EntryIndex i) const