Opm::UgGridHelpers::SparseTableView Class Reference

Allows viewing a sparse table consisting out of C-array. More...

#include <GridHelpers.hpp>

Public Types

using row_type = iterator_range_pod< int >
 The type of the roww. More...
 

Public Member Functions

 SparseTableView (int *data, int *offset, std::size_t size_arg)
 Creates a sparse table view. More...
 
row_type operator[] (std::size_t row) const
 Get a row of the the table. More...
 
std::size_t size () const
 Get the size of the table. More...
 
std::size_t noEntries () const
 Get the number of non-zero entries. More...
 

Detailed Description

Allows viewing a sparse table consisting out of C-array.

This class can be used to convert two int array (like they are in UnstructuredGrid for representing the cell to faces mapping as a sparse table object.

Member Typedef Documentation

◆ row_type

Constructor & Destructor Documentation

◆ SparseTableView()

Opm::UgGridHelpers::SparseTableView::SparseTableView ( int *  data,
int *  offset,
std::size_t  size_arg 
)
inline

Creates a sparse table view.

Parameters
dataThe array with data of the table.
offsetThe offsets of the rows. Row i starts at offset[i] and ends a offset[i+1]
sizeThe number of entries/rows of the table

Member Function Documentation

◆ noEntries()

std::size_t Opm::UgGridHelpers::SparseTableView::noEntries ( ) const
inline

Get the number of non-zero entries.

◆ operator[]()

row_type Opm::UgGridHelpers::SparseTableView::operator[] ( std::size_t  row) const
inline

Get a row of the the table.

Parameters
rowThe row index.
Returns
The corresponding row.

References size().

◆ size()

std::size_t Opm::UgGridHelpers::SparseTableView::size ( ) const
inline

Get the size of the table.

Returns
the number rows.

Referenced by operator[]().


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