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

#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
 

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 305 of file sparse.h.

Constructor & Destructor Documentation

◆ ConstView()

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

Definition at line 307 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 318 of file sparse.h.

◆ ColumnNumEntries()

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

Definition at line 327 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 528 of file sparse.h.

◆ EntryCoefficient()

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

Definition at line 322 of file sparse.h.

◆ EntryRow()

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

Definition at line 325 of file sparse.h.


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