Loading...
Searching...
No Matches
Opm::RestartIO::Helpers::WindowedMatrix< T > Class Template Reference

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. More...

`#include <WindowedArray.hpp>`

## Classes

struct | NumCols
| Distinct compile-time type for number of matrix columns in underlying storage. More...
struct | NumRows
| Distinct compile-time type for number of matrix rows in underlying storage. More...

## 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)
| Constructor.
Idx | numCols () const
| Retrieve number of columns allocated for this matrix.
Idx | numRows () const
| Retrieve number of rows allocated for this matrix.
Idx | windowSize () const
| Retrieve number of data items per windows.
WriteWindow | operator() (const Idx row, const Idx col)
| Request read/write access to individual window.
ReadWindow | operator() (const Idx row, const Idx col) const
| Request read-only access to individual window.
auto | data () const -> decltype(std::declval< const WindowedArray< T > >().data())
| Get read-only access to full, linearised data items for all windows.
auto | getDataDestructively () -> decltype(std::declval< WindowedArray< T > >() .getDataDestructively())
| Extract full, linearised data items for all windows.

## 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

  T | Element type for underlying data items.

## Constructor & Destructor Documentation

## WindowedMatrix()

template<typename T >

Opm::RestartIO::Helpers::WindowedMatrix< T >::WindowedMatrix | ( | const NumRows & | nRows,
|  | const NumCols & | nCols,
|  | const WindowSize & | sz
| ) |  |

inline explicit

Constructor.

Parameters

  [in] | nRows | Number of rows.
  [in] | nCols | Number of columns.
  [in] | sz | Number of data items per (row,column) window.

## Member Function Documentation

## 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`.

## 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] | row | Numeric ID of particular row in matrix. Must be in range [0 .. numRows()-1] Opm::RestartIO::Helpers::WindowedMatrix::numRows Idx numRows() const Retrieve number of rows allocated for this matrix. Definition WindowedArray.hpp:204 .
  [in] | col | Numeric ID of particular column in matrix. Must be in range [0 .. numCols()-1] Opm::RestartIO::Helpers::WindowedMatrix::numCols Idx numCols() const Retrieve number of columns allocated for this matrix. Definition WindowedArray.hpp:198 .

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] | row | Numeric ID of particular row in matrix. Must be in range [0 .. numRows()-1] .
  [in] | col | Numeric ID of particular column in matrix. Must be in range [0 .. numCols()-1] .

Returns
  Read-only window at position
  (row,col)
  .

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

- opm/output/eclipse/WindowedArray.hpp