Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::glop::CompactSparseMatrix::ConstView Class Reference

Detailed Description

When iteration performance matter, getting a ConstView allows the compiler to do better aliasing analysis and not re-read vectors address all the time.

Definition at line 304 of file sparse.h.

#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

Constructor & Destructor Documentation

◆ ConstView()

operations_research::glop::CompactSparseMatrix::ConstView::ConstView ( const CompactSparseMatrix * matrix)
inlineexplicit

Definition at line 306 of file sparse.h.

Member Function Documentation

◆ Column()

::util::IntegerRange< EntryIndex > operations_research::glop::CompactSparseMatrix::ConstView::Column ( ColIndex col) const
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); }

Definition at line 317 of file sparse.h.

◆ ColumnNumEntries()

EntryIndex operations_research::glop::CompactSparseMatrix::ConstView::ColumnNumEntries ( ColIndex col) const
inline

Definition at line 326 of file sparse.h.

◆ ColumnScalarProduct()

Fractional operations_research::glop::CompactSparseMatrix::ConstView::ColumnScalarProduct ( ColIndex col,
DenseRow::ConstView vector ) const
inline

Returns the scalar product of the given row vector with the column of index col of this matrix.

We expand ourselves since we don't really care about the floating point order of operation and this seems faster.

Definition at line 531 of file sparse.h.

◆ EntryCoefficient()

Fractional operations_research::glop::CompactSparseMatrix::ConstView::EntryCoefficient ( EntryIndex i) const
inline

Definition at line 321 of file sparse.h.

◆ EntryRow()

RowIndex operations_research::glop::CompactSparseMatrix::ConstView::EntryRow ( EntryIndex i) const
inline

Definition at line 324 of file sparse.h.


The documentation for this class was generated from the following file: