DASH  0.3.0
dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT > Class Template Reference

Forward-declaration. More...

#include <LocalMatrixRef.h>

Public Types

typedef T value_type
 
typedef PatternT pattern_type
 
typedef PatternT::index_type index_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 GlobViewIter< value_type, PatternT, GlobMem_tpointer
 
typedef GlobViewIter< const value_type, PatternT, GlobMem_tconst_pointer
 
typedef T * local_pointer
 
typedef const T * const_local_pointer
 
typedef self_t local_type
 
template<dim_t NumViewDim>
using ViewT = LocalMatrixRef< T, NumDimensions, NumViewDim, PatternT, LocalMemT >
 
typedef std::integral_constant< dim_t, CUR > rank
 

Public Member Functions

 LocalMatrixRef ()
 Default constructor. More...
 
template<class T_ >
 LocalMatrixRef (const LocalMatrixRef< T_, NumDimensions, CUR+1, PatternT, LocalMemT > &previous, size_type coord)
 
template<class T_ >
 LocalMatrixRef (Matrix< T_, NumDimensions, index_type, PatternT, LocalMemT > *mat)
 Constructor, creates a local view reference to a Matrix view. More...
 
LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT > block (const std::array< index_type, NumDimensions > &block_lcoords)
 View at local block at given local block coordinates. More...
 
LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT > block (index_type block_lindex)
 View at local block at given local block offset. More...
 
 operator LocalMatrixRef< T, NumDimensions, CUR-1, PatternT, LocalMemT > && () &&
 
 operator MatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT > ()
 
T & local_at (size_type pos)
 Returns a reference to the element at local index pos. More...
 
const T & local_at (size_type pos) const
 
constexpr Teamteam () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type local_size () const noexcept
 
constexpr size_type local_capacity () const noexcept
 
size_type extent (dim_t dim) const noexcept
 
constexpr Extents_t extents () const noexcept
 
index_type offset (dim_t dim) const noexcept
 
constexpr Offsets_t offsets () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr const PatternT & pattern () const
 The pattern used to distribute matrix elements to units in its associated team. More...
 
iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
local_pointer lbegin () noexcept
 
constexpr const_local_pointer lbegin () const noexcept
 
local_pointer lend () noexcept
 
constexpr const_local_pointer lend () const noexcept
 
template<typename ... Args>
T & at (Args... args)
 Fortran-style subscript operator. More...
 
template<typename... Args>
T & operator() (Args... args)
 Fortran-style subscript operator, alias for at(). More...
 
template<dim_t __NumViewDim = CUR-1>
std::enable_if<(__NumViewDim > 0), LocalMatrixRef< T, NumDimensions, __NumViewDim, PatternT, LocalMemT > >::type operator[] (size_type n)
 Subscript assignment operator, access element at given offset in global element range. More...
 
template<dim_t __NumViewDim = CUR-1>
std::enable_if<(__NumViewDim==0), T & >::type operator[] (size_type n)
 
template<dim_t __NumViewDim = CUR-1>
std::enable_if<(__NumViewDim > 0), LocalMatrixRef< const T, NumDimensions, __NumViewDim, PatternT, LocalMemT > >::type constexpr operator[] (size_type n) const
 Subscript operator, access element at given offset in global element range. More...
 
template<dim_t __NumViewDim = CUR-1>
std::enable_if<(__NumViewDim==0), const T & >::type operator[] (size_type n) const
 
LocalMatrixRef< T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > col (size_type n)
 
constexpr LocalMatrixRef< const T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > col (size_type n) const
 
LocalMatrixRef< T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > row (size_type n)
 
constexpr LocalMatrixRef< const T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > row (size_type n) const
 
template<dim_t NumSubDimensions>
LocalMatrixRef< T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > sub (size_type n)
 
template<dim_t NumSubDimensions>
LocalMatrixRef< const T, NumDimensions, NumDimensions-1, PatternT, LocalMemT > sub (size_type n) const
 
template<dim_t SubDimension>
LocalMatrixRef< T, NumDimensions, NumDimensions, PatternT, LocalMemT > sub (size_type n, size_type range)
 
template<dim_t SubDimension>
LocalMatrixRef< const T, NumDimensions, NumDimensions, PatternT, LocalMemT > sub (size_type n, size_type range) const
 
LocalMatrixRef< T, NumDimensions, NumDimensions, PatternT, LocalMemT > rows (size_type offset, size_type range)
 Create a view representing the matrix slice within a row range. More...
 
constexpr LocalMatrixRef< const T, NumDimensions, NumDimensions, PatternT, LocalMemT > rows (size_type offset, size_type range) const
 
LocalMatrixRef< T, NumDimensions, NumDimensions, PatternT, LocalMemT > cols (size_type offset, size_type extent)
 Create a view representing the matrix slice within a column range. More...
 
constexpr LocalMatrixRef< const T, NumDimensions, NumDimensions, PatternT, LocalMemT > cols (size_type offset, size_type extent) const
 

Static Public Member Functions

static constexpr dim_t ndim ()
 

Detailed Description

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
class dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >

Forward-declaration.

Local part of a Matrix, provides local operations.

See also
Matrix Concept

Definition at line 42 of file LocalMatrixRef.h.

Constructor & Destructor Documentation

◆ LocalMatrixRef() [1/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::LocalMatrixRef ( )
inline

Default constructor.

Definition at line 158 of file LocalMatrixRef.h.

159  {
160  DASH_LOG_TRACE_VAR("LocalMatrixRef<T,D,C>()", NumDimensions);
161  DASH_LOG_TRACE_VAR("LocalMatrixRef<T,D,C>()", CUR);
162  }

◆ LocalMatrixRef() [2/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
template<class T_ >
dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::LocalMatrixRef ( Matrix< T_, NumDimensions, index_type, PatternT, LocalMemT > *  mat)

Constructor, creates a local view reference to a Matrix view.

Member Function Documentation

◆ at()

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
template<typename ... Args>
T& dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::at ( Args...  args)
inline

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

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ block() [1/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
LocalMatrixRef<T, NumDimensions, CUR, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::block ( const std::array< index_type, NumDimensions > &  block_lcoords)

View at local block at given local block coordinates.

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ block() [2/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
LocalMatrixRef<T, NumDimensions, CUR, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::block ( index_type  block_lindex)

View at local block at given local block offset.

◆ cols() [1/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
LocalMatrixRef<T, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::cols ( size_type  offset,
size_type  extent 
)

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

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

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

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ cols() [2/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
constexpr LocalMatrixRef<const T, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::cols ( size_type  offset,
size_type  extent 
) const
Parameters
offsetOffset of first column in range
extentNumber of columns in the range

◆ local_at()

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
T& dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::local_at ( size_type  pos)
inline

Returns a reference to the element at local index pos.

The index is relative to the start of the local range.

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ operator()()

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
template<typename... Args>
T& dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::operator() ( Args...  args)
inline

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
argsCoordinates of element in global cartesian index space.

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ operator[]() [1/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
template<dim_t __NumViewDim = CUR-1>
std::enable_if<(__NumViewDim > 0), LocalMatrixRef<T, NumDimensions, __NumViewDim, PatternT, LocalMemT> >::type dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::operator[] ( size_type  n)

Subscript assignment operator, access element at given offset in global element range.

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ operator[]() [2/2]

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

Subscript operator, access element at given offset in global element range.

◆ pattern()

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
constexpr const PatternT& dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::pattern ( ) const

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

NOTE: This method is not implemented as local matrix views do not have a pattern. The pattern of the referenced matrix refers to the global data domain.

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ rows() [1/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
LocalMatrixRef<T, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::rows ( size_type  offset,
size_type  range 
)

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

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

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

Referenced by dash::LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >::LocalMatrixRef().

◆ rows() [2/2]

template<typename T, dim_t NumDimensions, dim_t CUR, class PatternT, class LocalMemT>
constexpr LocalMatrixRef<const T, NumDimensions, NumDimensions, PatternT, LocalMemT> dash::LocalMatrixRef< T, NumDimensions, CUR, PatternT, LocalMemT >::rows ( size_type  offset,
size_type  range 
) const
Parameters
offsetOffset of first row in range
rangeNumber of rows in the range

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