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

#include <sparse_column.h>

Public Types

typedef SparseColumnEntry Entry
 
typedef VectorIterator< EntryIterator
 

Public Member Functions

 ColumnView (EntryIndex num_entries, const RowIndex *rows, const Fractional *const coefficients)
 
 ColumnView (const SparseColumn &column)
 
EntryIndex num_entries () const
 
Fractional EntryCoefficient (EntryIndex i) const
 
Fractional GetFirstCoefficient () const
 
RowIndex EntryRow (EntryIndex i) const
 
RowIndex GetFirstRow () const
 
Iterator begin () const
 
Iterator end () const
 
Fractional LookUpCoefficient (RowIndex index) const
 
bool IsEmpty () const
 

Detailed Description

Class to iterate on the entries of a given column with the same interface as for SparseColumn.

Definition at line 69 of file sparse_column.h.

Member Typedef Documentation

◆ Entry

Clients should pass Entry by value rather than by reference. This is because SparseColumnEntry is small (2 pointers and an index) and previous profiling of this type of use showed no performance penalty (see cl/51057736). Example: for(const Entry e : column_view)

Definition at line 76 of file sparse_column.h.

◆ Iterator

Constructor & Destructor Documentation

◆ ColumnView() [1/2]

operations_research::glop::ColumnView::ColumnView ( EntryIndex num_entries,
const RowIndex * rows,
const Fractional *const coefficients )
inline

Definition at line 79 of file sparse_column.h.

◆ ColumnView() [2/2]

operations_research::glop::ColumnView::ColumnView ( const SparseColumn & column)
inlineexplicit

Definition at line 82 of file sparse_column.h.

Member Function Documentation

◆ begin()

Iterator operations_research::glop::ColumnView::begin ( ) const
inline

Definition at line 96 of file sparse_column.h.

◆ end()

Iterator operations_research::glop::ColumnView::end ( ) const
inline

Definition at line 100 of file sparse_column.h.

◆ EntryCoefficient()

Fractional operations_research::glop::ColumnView::EntryCoefficient ( EntryIndex i) const
inline

Definition at line 87 of file sparse_column.h.

◆ EntryRow()

RowIndex operations_research::glop::ColumnView::EntryRow ( EntryIndex i) const
inline

Definition at line 93 of file sparse_column.h.

◆ GetFirstCoefficient()

Fractional operations_research::glop::ColumnView::GetFirstCoefficient ( ) const
inline

Definition at line 90 of file sparse_column.h.

◆ GetFirstRow()

RowIndex operations_research::glop::ColumnView::GetFirstRow ( ) const
inline

Definition at line 94 of file sparse_column.h.

◆ IsEmpty()

bool operations_research::glop::ColumnView::IsEmpty ( ) const
inline

Definition at line 118 of file sparse_column.h.

◆ LookUpCoefficient()

Fractional operations_research::glop::ColumnView::LookUpCoefficient ( RowIndex index) const
inline

Keep in mind the vector may contains several entries with the same index. In such a case the last one is returned.

Todo
(user): investigate whether an optimized version of LookUpCoefficient for "clean" columns yields speed-ups.

Definition at line 104 of file sparse_column.h.

◆ num_entries()

EntryIndex operations_research::glop::ColumnView::num_entries ( ) const
inline

Definition at line 86 of file sparse_column.h.


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