![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <sparse.h>
Public Member Functions | |
ConstView (const CompactSparseMatrix *matrix) | |
::util::IntegerRange< EntryIndex > | Column (ColIndex col) const |
Fractional | EntryCoefficient (EntryIndex i) const |
RowIndex | EntryRow (EntryIndex i) const |
EntryIndex | ColumnNumEntries (ColIndex col) const |
Fractional | ColumnScalarProduct (ColIndex col, DenseRow::ConstView vector) const |
When iteration performance matter, getting a ConstView allows the compiler to do better aliasing analysis and not re-read vectors address all the time.
|
inlineexplicit |
|
inline |
Functions to iterate on the entries of a given column: const auto view = compact_matrix.view(); for (const EntryIndex i : view.Column(col)) { const RowIndex row = view.EntryRow(i); const Fractional coefficient = view.EntryCoefficient(i); }
|
inline |
|
inline |
|
inline |
|
inline |