Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <sparse_column.h>
Public Member Functions | |
RandomAccessSparseColumn (RowIndex num_rows) | |
RandomAccessSparseColumn (const RandomAccessSparseColumn &)=delete | |
This type is neither copyable nor movable. | |
RandomAccessSparseColumn & | operator= (const RandomAccessSparseColumn &)=delete |
virtual | ~RandomAccessSparseColumn () |
void | Clear () |
void | Resize (RowIndex num_rows) |
void | SetCoefficient (RowIndex row, Fractional value) |
void | AddToCoefficient (RowIndex row, Fractional value) |
void | PopulateFromSparseColumn (const SparseColumn &sparse_column) |
void | PopulateSparseColumn (SparseColumn *sparse_column) const |
RowIndex | GetNumberOfRows () const |
Fractional | GetCoefficient (RowIndex row) const |
RandomAccessSparseColumn A RandomAccessSparseColumn is a mix between a DenseColumn and a SparseColumn. It makes it possible to populate a dense column from a sparse column in O(num_entries) instead of O(num_rows), and to access an entry in O(1). As the constructor runs in O(num_rows), a RandomAccessSparseColumn should be used several times to amortize the creation cost.
Definition at line 136 of file sparse_column.h.
|
explicit |
Creates a RandomAccessSparseColumn. Runs in O(num_rows).
Definition at line 30 of file sparse_column.cc.
|
delete |
This type is neither copyable nor movable.
|
virtualdefault |
|
inline |
Adds value to the current value at row. Runs in O(1).
Definition at line 163 of file sparse_column.h.
void operations_research::glop::RandomAccessSparseColumn::Clear | ( | ) |
Clears the column. Runs in O(num_entries).
Definition at line 35 of file sparse_column.cc.
|
inline |
Returns the value in position row. Runs in O(1).
Definition at line 182 of file sparse_column.h.
|
inline |
Returns the number of rows. Runs in O(1).
Definition at line 178 of file sparse_column.h.
|
delete |
void operations_research::glop::RandomAccessSparseColumn::PopulateFromSparseColumn | ( | const SparseColumn & | sparse_column | ) |
Populates from a sparse column. Runs in O(num_entries).
Definition at line 53 of file sparse_column.cc.
void operations_research::glop::RandomAccessSparseColumn::PopulateSparseColumn | ( | SparseColumn * | sparse_column | ) | const |
Populates a sparse column from the lazy dense column. Runs in O(num_entries).
Definition at line 61 of file sparse_column.cc.
void operations_research::glop::RandomAccessSparseColumn::Resize | ( | RowIndex | num_rows | ) |
Definition at line 45 of file sparse_column.cc.
|
inline |
Sets value at row. Runs in O(1).
Definition at line 156 of file sparse_column.h.