Opm::RestartIO::Helpers::WindowedMatrix< T > Class Template Reference

#include <WindowedArray.hpp>

Inheritance diagram for Opm::RestartIO::Helpers::WindowedMatrix< T >:
Inheritance graph

Classes

struct  NumCols
 
struct  NumRows
 

Public Types

using WriteWindow = typename WindowedArray< T >::WriteWindow
 
using ReadWindow = typename WindowedArray< T >::ReadWindow
 
using WindowSize = typename WindowedArray< T >::WindowSize
 
using Idx = typename WindowedArray< T >::Idx
 

Public Member Functions

 WindowedMatrix (const NumRows &nRows, const NumCols &nCols, const WindowSize &sz)
 
Idx numCols () const
 Retrieve number of columns allocated for this matrix. More...
 
Idx numRows () const
 Retrieve number of rows allocated for this matrix. More...
 
Idx windowSize () const
 Retrieve number of data items per windows. More...
 
WriteWindow operator() (const Idx row, const Idx col)
 
ReadWindow operator() (const Idx row, const Idx col) const
 
auto data () const -> decltype(std::declval< const WindowedArray< T > >().data())
 
auto getDataDestructively () -> decltype(std::declval< WindowedArray< T > >() .getDataDestructively())
 

Detailed Description

template<typename T>
class Opm::RestartIO::Helpers::WindowedMatrix< T >

Provide read-only and read/write access to constantly sized portions/windows of a linearised buffer with an implied row/column matrix (2D array) structure.

Intended as backing store for vectors that have a constant number of items per sub-entity of a fixed number of containing entities (e.g., K double precision data items for each of N maximum well connections for each of M maximum active wells at a particular report step).

Template Parameters
TElement type for underlying data items.

Member Typedef Documentation

◆ Idx

template<typename T >
using Opm::RestartIO::Helpers::WindowedMatrix< T >::Idx = typename WindowedArray<T>::Idx

◆ ReadWindow

template<typename T >
using Opm::RestartIO::Helpers::WindowedMatrix< T >::ReadWindow = typename WindowedArray<T>::ReadWindow

◆ WindowSize

template<typename T >
using Opm::RestartIO::Helpers::WindowedMatrix< T >::WindowSize = typename WindowedArray<T>::WindowSize

◆ WriteWindow

template<typename T >
using Opm::RestartIO::Helpers::WindowedMatrix< T >::WriteWindow = typename WindowedArray<T>::WriteWindow

Constructor & Destructor Documentation

◆ WindowedMatrix()

template<typename T >
Opm::RestartIO::Helpers::WindowedMatrix< T >::WindowedMatrix ( const NumRows nRows,
const NumCols nCols,
const WindowSize sz 
)
inlineexplicit

Constructor.

Parameters
[in]nRowsNumber of rows.
[in]nColsNumber of columns.
[in]szNumber of data items per (row,column) window.

References Opm::RestartIO::Helpers::WindowedMatrix< T >::NumCols::value.

Member Function Documentation

◆ data()

template<typename T >
auto Opm::RestartIO::Helpers::WindowedMatrix< T >::data ( ) const -> decltype(std::declval<const WindowedArray<T>>().data())
inline

◆ getDataDestructively()

template<typename T >
auto Opm::RestartIO::Helpers::WindowedMatrix< T >::getDataDestructively ( ) -> decltype(std::declval<WindowedArray<T>>() .getDataDestructively())
inline

Extract full, linearised data items for all windows.

Destroys the internal state of the WindowedMatrix.

◆ numCols()

template<typename T >
Idx Opm::RestartIO::Helpers::WindowedMatrix< T >::numCols ( ) const
inline

Retrieve number of columns allocated for this matrix.

Referenced by Opm::RestartIO::Helpers::WindowedMatrix< T >::numRows().

◆ numRows()

template<typename T >
Idx Opm::RestartIO::Helpers::WindowedMatrix< T >::numRows ( ) const
inline

Retrieve number of rows allocated for this matrix.

References Opm::RestartIO::Helpers::WindowedMatrix< T >::numCols().

◆ operator()() [1/2]

template<typename T >
WriteWindow Opm::RestartIO::Helpers::WindowedMatrix< T >::operator() ( const Idx  row,
const Idx  col 
)
inline

Request read/write access to individual window.

Parameters
[in]rowNumeric ID of particular row in matrix. Must be in range
[0 .. numRows()-1]
Idx numRows() const
Retrieve number of rows allocated for this matrix.
Definition: WindowedArray.hpp:199
.
[in]colNumeric ID of particular column in matrix. Must be in range
[0 .. numCols()-1]
Idx numCols() const
Retrieve number of columns allocated for this matrix.
Definition: WindowedArray.hpp:193
.
Returns
Read/write window at position
(row,col)
.

◆ operator()() [2/2]

template<typename T >
ReadWindow Opm::RestartIO::Helpers::WindowedMatrix< T >::operator() ( const Idx  row,
const Idx  col 
) const
inline

Request read-only access to individual window.

Parameters
[in]rowNumeric ID of particular row in matrix. Must be in range
[0 .. numRows()-1]
.
[in]colNumeric ID of particular column in matrix. Must be in range
[0 .. numCols()-1]
.
Returns
Read-only window at position
(row,col)
.

◆ windowSize()

template<typename T >
Idx Opm::RestartIO::Helpers::WindowedMatrix< T >::windowSize ( ) const
inline

Retrieve number of data items per windows.


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