DASH  0.3.0
dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT > Class Template Reference

Forward-declaration. More...

#include <LocalMatrixRef.h>

Public Types

typedef PatternT pattern_type
 
typedef PatternT::index_type index_type
 
typedef ElementT value_type
 
typedef IndexSpace_t index_space_type
 
typedef PatternT::size_type size_type
 
typedef PatternT::index_type difference_type
 
typedef GlobViewIter< value_type, PatternT, GlobMem_titerator
 
typedef GlobViewIter< const value_type, PatternT, GlobMem_tconst_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef GlobRef< value_type > reference
 
typedef GlobRef< const value_type > const_reference
 
typedef iterator pointer
 
typedef const_iterator const_pointer
 
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > local_type
 
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > const_local_type
 
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > local_reference_type
 
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > const_local_reference_type
 
typedef std::integral_constant< dim_t, NumViewDim > rank
 

Public Member Functions

 operator MatrixRef< ElementT, NumDimensions, NumViewDim-1, PatternT, LocalMemT > ()
 
template<class T_ >
 MatrixRef (const MatrixRef< T_, NumDimensions, NumViewDim+1, PatternT, LocalMemT > &prev, index_type coord)
 
template<class T_ >
 MatrixRef (const MatrixRef< T_, NumDimensions, NumViewDim, PatternT, LocalMemT > &other)
 
constexpr Teamteam () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type local_size () const noexcept
 
constexpr size_type local_capacity () const noexcept
 
constexpr size_type extent (dim_t dim) const noexcept
 
constexpr Extents_t extents () const noexcept
 
constexpr index_type offset (dim_t dim) const noexcept
 
constexpr Offsets_t offsets () const noexcept
 
constexpr bool empty () const noexcept
 
void barrier () const
 
constexpr const PatternT & pattern () const noexcept
 The pattern used to distribute matrix elements to units in its associated team. More...
 
constexpr const_pointer data () const noexcept
 
pointer data () noexcept
 
iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
local_type sub_local () noexcept
 View representing elements in the active unit's local memory. More...
 
ElementT * lbegin () noexcept
 Pointer to first element in local range. More...
 
constexpr const ElementT * lbegin () const noexcept
 Pointer to first element in local range. More...
 
ElementT * lend () noexcept
 Pointer past final element in local range. More...
 
constexpr const ElementT * lend () const noexcept
 Pointer past final element in local range. More...
 
template<dim_t __NumViewDim = NumViewDim - 1>
std::enable_if<(__NumViewDim !=0), MatrixRef< ElementT, NumDimensions, __NumViewDim, PatternT, LocalMemT > >::type operator[] (size_type n)
 Subscript operator, returns a submatrix reference at given offset in global element range. More...
 
template<dim_t __NumViewDim = NumViewDim - 1>
std::enable_if<(__NumViewDim !=0), MatrixRef< const ElementT, NumDimensions, __NumViewDim, PatternT, LocalMemT > >::type constexpr operator[] (size_type n) const
 Subscript operator, returns a submatrix reference at given offset in global element range. More...
 
template<dim_t __NumViewDim = NumViewDim-1>
std::enable_if<(__NumViewDim==0), reference >::type operator[] (size_type n)
 Subscript operator, returns a dash::GlobRef at given offset in global element range for last dimension. More...
 
template<dim_t __NumViewDim = NumViewDim-1>
std::enable_if<(__NumViewDim==0), const_reference >::type operator[] (size_type n) const
 Subscript operator, returns a dash::GlobRef at given offset in global element range for last dimension. More...
 
template<dim_t NumSubDimensions>
MatrixRef< const ElementT, NumDimensions, NumDimensions - 1, PatternT, LocalMemT > sub (size_type n) const
 
template<dim_t NumSubDimensions>
MatrixRef< ElementT, NumDimensions, NumDimensions-1, PatternT, LocalMemT > sub (size_type n)
 
MatrixRef< ElementT, NumDimensions, NumDimensions-1, PatternT, LocalMemT > col (size_type n)
 
MatrixRef< ElementT, NumDimensions, NumDimensions-1, PatternT, LocalMemT > row (size_type n)
 
template<dim_t SubDimension>
MatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > sub (size_type n, size_type range) const
 
template<dim_t SubDimension>
MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > sub (size_type n, size_type range)
 
MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > rows (size_type n, size_type range)
 Create a view representing the matrix slice within a row range. More...
 
MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT > cols (size_type offset, size_type range)
 Create a view representing the matrix slice within a column range. More...
 
template<typename ... Args>
reference at (Args... args)
 Fortran-style subscript operator. More...
 
template<typename ... Args>
const_reference at (Args... args) const
 Fortran-style subscript operator. More...
 
const_reference at (const ::std::array< index_type, NumDimensions > &coords) const
 Fortran-style subscript operator. More...
 
reference at (const ::std::array< index_type, NumDimensions > &coords)
 Fortran-style subscript operator. More...
 
template<typename... Args>
reference operator() (Args... args)
 Fortran-style subscript operator, alias for at(). More...
 
constexpr bool is_local (index_type n) const
 
template<dim_t Dimension>
constexpr bool is_local (index_type n) const
 
constexpr const ViewSpec< NumDimensions, index_type > & viewspec () const
 
template<int level>
dash::HView< Matrix< ElementT, NumDimensions, Index_t, PatternT, LocalMemT >, level > hview ()
 

Static Public Member Functions

static constexpr dim_t ndim ()
 

Detailed Description

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
class dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >

Forward-declaration.

A view on a referenced Matrix object, such as a dimensional projection returned by Matrix::sub.

TODO: Projection order matrix.sub().local() is not fully implemented yet. Currently only matrix.local().sub() is supported.

See also
Matrix Concept

Definition at line 34 of file LocalMatrixRef.h.

Member Function Documentation

◆ at() [1/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<typename ... Args>
reference dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::at ( Args...  args)

Fortran-style subscript operator.

As an example, the operation matrix(i,j) is equivalent to matrix[i][j].

Returns
A global reference to the element at the given global coordinates.
Parameters
argsGlobal coordinates

◆ at() [2/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<typename ... Args>
const_reference dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::at ( Args...  args) const

Fortran-style subscript operator.

As an example, the operation matrix(i,j) is equivalent to matrix[i][j].

Returns
A global reference to the element at the given global coordinates.
Parameters
argsGlobal coordinates

◆ at() [3/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
const_reference dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::at ( const ::std::array< index_type, NumDimensions > &  coords) const

Fortran-style subscript operator.

As an example, the operation matrix(i,j) is equivalent to matrix[i][j].

Returns
A global reference to the element at the given global coordinates.
Parameters
coordsGlobal coordinates

◆ at() [4/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
reference dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::at ( const ::std::array< index_type, NumDimensions > &  coords)

Fortran-style subscript operator.

As an example, the operation matrix(i,j) is equivalent to matrix[i][j].

Returns
A global reference to the element at the given global coordinates.
Parameters
coordsGlobal coordinates

◆ cols()

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
MatrixRef<ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::cols ( size_type  offset,
size_type  range 
)

Create a view representing the matrix slice within a column range.

Same as sub<1>(offset, extent).

Returns
A matrix view
See also
sub
Parameters
offsetOffset of first column in range
rangeNumber of columns in the range

◆ lbegin() [1/2]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
ElementT* dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::lbegin ( )
inlinenoexcept

Pointer to first element in local range.

◆ lbegin() [2/2]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
constexpr const ElementT* dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::lbegin ( ) const
noexcept

Pointer to first element in local range.

◆ lend() [1/2]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
ElementT* dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::lend ( )
inlinenoexcept

Pointer past final element in local range.

◆ lend() [2/2]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
constexpr const ElementT* dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::lend ( ) const
noexcept

Pointer past final element in local range.

◆ operator()()

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<typename... Args>
reference dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::operator() ( Args...  args)

Fortran-style subscript operator, alias for at().

As an example, the operation matrix(i,j) is equivalent to matrix[i][j].

Returns
A global reference to the element at the given global coordinates.
See also
at
Parameters
argsGlobal coordinates

◆ operator[]() [1/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<dim_t __NumViewDim = NumViewDim - 1>
std::enable_if< (__NumViewDim != 0), MatrixRef<ElementT, NumDimensions, __NumViewDim, PatternT, LocalMemT> >:: type dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::operator[] ( size_type  n)

Subscript operator, returns a submatrix reference at given offset in global element range.

◆ operator[]() [2/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<dim_t __NumViewDim = NumViewDim - 1>
std::enable_if< (__NumViewDim != 0), MatrixRef<const ElementT, NumDimensions, __NumViewDim, PatternT, LocalMemT> >:: type constexpr dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::operator[] ( size_type  n) const

Subscript operator, returns a submatrix reference at given offset in global element range.

◆ operator[]() [3/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<dim_t __NumViewDim = NumViewDim-1>
std::enable_if<(__NumViewDim == 0), reference>::type dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::operator[] ( size_type  n)

Subscript operator, returns a dash::GlobRef at given offset in global element range for last dimension.

◆ operator[]() [4/4]

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
template<dim_t __NumViewDim = NumViewDim-1>
std::enable_if<(__NumViewDim == 0), const_reference>::type dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::operator[] ( size_type  n) const

Subscript operator, returns a dash::GlobRef at given offset in global element range for last dimension.

◆ pattern()

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
constexpr const PatternT& dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::pattern ( ) const
noexcept

The pattern used to distribute matrix elements to units in its associated team.

◆ rows()

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
MatrixRef<ElementT, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::rows ( size_type  n,
size_type  range 
)

Create a view representing the matrix slice within a row range.

Same as sub<0>(offset, extent).

Returns
A matrix view
See also
sub
Parameters
nOffset of first row in range
rangeNumber of rows in the range

◆ sub_local()

template<typename ElementT, dim_t NumDimensions, dim_t NumViewDim, class PatternT, class LocalMemT>
local_type dash::MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemT >::sub_local ( )
inlinenoexcept

View representing elements in the active unit's local memory.


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