DASH  0.3.0
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT > Class Template Reference

Forward-declaration. More...

#include <LocalMatrixRef.h>

Public Types

typedef GlobStaticMem< LocalMemSpaceT > GlobMem_t
 
typedef ElementT value_type
 
typedef PatternT::size_type size_type
 
typedef PatternT::index_type difference_type
 
typedef PatternT::index_type index_type
 
typedef GlobIter< value_type, Pattern_t, GlobMem_titerator
 
typedef GlobIter< const value_type, Pattern_t, GlobMem_tconst_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef GlobRef< value_type > reference
 
typedef GlobRef< value_type >::const_type const_reference
 
typedef iterator::pointer pointer
 
typedef pointer::const_type const_pointer
 
typedef ElementT * local_pointer
 
typedef const ElementT * const_local_pointer
 
typedef DistributionSpec< NumDimensions > distribution_spec
 
typedef SizeSpec< NumDimensions, typename PatternT::size_type > size_spec
 
typedef TeamSpec< NumDimensions, typename PatternT::index_type > team_spec
 
typedef std::array< typename PatternT::size_type, NumDimensions > extents_type
 
typedef std::array< typename PatternT::index_type, NumDimensions > offsets_type
 
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > local_type
 Type specifying the view on local matrix elements. More...
 
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > const_local_type
 Type specifying the view on const local matrix elements. More...
 
typedef PatternT pattern_type
 The type of the pattern specifying linear iteration order and how elements are distribute to units. More...
 
template<dim_t NumViewDim>
using view_type = MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT >
 Type of views on matrix elements such as sub-matrices, row- and column vectors. More...
 
template<dim_t NumViewDim>
using const_view_type = MatrixRef< const ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT >
 Type of views on matrix elements such as sub-matrices, row- and column vectors. More...
 
typedef std::integral_constant< dim_t, NumDimensions > rank
 

Public Member Functions

 Matrix (Team &team=dash::Team::Null())
 Default constructor, for delayed allocation. More...
 
 Matrix (const size_spec &ss, const distribution_spec &ds=distribution_spec(), Team &t=dash::Team::All(), const team_spec &ts=team_spec())
 Constructor, creates a new instance of Matrix. More...
 
 Matrix (const PatternT &pat)
 Constructor, creates a new instance of Matrix from a pattern instance. More...
 
template<typename... Args>
 Matrix (SizeType arg, Args &&... args)
 Constructor, creates a new instance of Matrix of given extents. More...
 
 Matrix (const self_t &)=delete
 Copy-constructor, deleted. More...
 
 Matrix (self_t &&other)
 Move-constructor, supported. More...
 
 ~Matrix ()
 Destructor, frees underlying memory. More...
 
self_toperator= (const self_t &other)=delete
 Copy-assignment operator, deleted. More...
 
self_toperator= (self_t &&other)
 Move-assignment operator, supported. More...
 
view_type< NumDimensions > block (const std::array< index_type, NumDimensions > &block_gcoords)
 View at block at given global block coordinates. More...
 
view_type< NumDimensions > block (index_type block_gindex)
 View at block at given global block offset. More...
 
bool allocate (const size_spec &sizespec, const distribution_spec &distribution, const team_spec &teamspec, dash::Team &team=dash::Team::All())
 Explicit allocation of matrix elements, used for delayed allocation of default-constructed Matrix instance. More...
 
bool allocate (const PatternT &pattern)
 Allocation and distribution of matrix elements as specified by a given Pattern instance. More...
 
template<typename... Args>
bool allocate (SizeType arg, Args... args)
 Allocation and distribution of matrix elements as specified by given extents. More...
 
void deallocate ()
 Explicit deallocation of matrix elements, called implicitly in destructor and team deallocation. More...
 
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_type extents () const noexcept
 
constexpr index_type offset (dim_t dim) const noexcept
 
constexpr offsets_type offsets () const noexcept
 
constexpr bool empty () const noexcept
 
void barrier () const
 Synchronize units associated with the matrix. More...
 
void flush ()
 Complete all outstanding non-blocking operations to all units on the container's underlying global memory. More...
 
void flush (dash::team_unit_t target)
 Complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory. More...
 
void flush_local ()
 Locally complete all outstanding non-blocking operations to all units on the container's underlying global memory. More...
 
void flush_local (dash::team_unit_t target)
 Locally complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory. More...
 
constexpr const Pattern_t & pattern () const
 The pattern used to distribute matrix elements to units in its associated team. More...
 
iterator begin () noexcept
 Iterator referencing first matrix element in global index space. More...
 
constexpr const_iterator begin () const noexcept
 Iterator referencing first matrix element in global index space. More...
 
iterator end () noexcept
 Iterator referencing past the last matrix element in global index space. More...
 
constexpr const_iterator end () const noexcept
 Iterator referencing past the last matrix element in global index space. 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 = NumDimensions-1>
std::enable_if<(__NumViewDim !=0), const_view_type< __NumViewDim > >::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 = NumDimensions-1>
std::enable_if<(__NumViewDim==0), const_reference >::type constexpr operator[] (size_type n) const
 Subscript operator, returns a GlobRef if matrix has only one dimension. More...
 
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if<(__NumViewDim !=0), view_type< __NumViewDim > >::type operator[] (size_type n)
 Subscript operator, returns a submatrix reference at given offset in global element range. More...
 
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if<(__NumViewDim==0), reference >::type operator[] (size_type n)
 Subscript operator, returns a GlobRef if matrix has only one dimension. More...
 
template<dim_t SubDimension>
const_view_type< NumDimensions > sub (size_type n, size_type range) const
 
template<dim_t SubDimension>
view_type< NumDimensions > sub (size_type n, size_type range)
 
template<dim_t SubDimension>
const_view_type< NumDimensions-1 > sub (size_type n) const
 Projection to given offset in a sub-dimension. More...
 
template<dim_t SubDimension>
view_type< NumDimensions-1 > sub (size_type n)
 Projection to given offset in a sub-dimension. More...
 
local_type sub_local () noexcept
 Local proxy object representing a view consisting of matrix elements that are located in the active unit's local memory. More...
 
const_view_type< NumDimensions-1 > col (size_type n) const
 Projection to given offset in first sub-dimension (column), same as sub<0>(n). More...
 
view_type< NumDimensions-1 > col (size_type n)
 Projection to given offset in first sub-dimension (column), same as sub<0>(n). More...
 
const_view_type< NumDimensions-1 > row (size_type n) const
 Projection to given offset in second sub-dimension (rows), same as sub<1>(n). More...
 
view_type< NumDimensions-1 > row (size_type n)
 Projection to given offset in second sub-dimension (rows), same as sub<1>(n). More...
 
view_type< NumDimensions > cols (size_type offset, size_type range)
 Create a view representing the matrix slice within a column range. More...
 
view_type< NumDimensions > rows (size_type n, size_type range)
 Create a view representing the matrix slice within a row range. More...
 
template<typename ... Args>
const_reference at (Args... args) const
 Fortran-style subscript operator. More...
 
template<typename ... Args>
reference at (Args... args)
 Fortran-style subscript operator. More...
 
template<typename... Args>
const_reference operator() (Args... args) const
 Fortran-style subscript operator, alias for at(). More...
 
template<typename... Args>
reference operator() (Args... args)
 Fortran-style subscript operator, alias for at(). More...
 
constexpr bool is_local (size_type g_pos) const
 Whether the element at a global, canonical offset in the matrix is local to the active unit. More...
 
template<dim_t Dimension>
constexpr bool is_local (size_type g_pos) const
 Whether the element at a global, canonical offset in a specific dimension of the matrix is local to the active unit. More...
 
template<int level>
dash::HView< self_t, level > hview ()
 
 operator MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > ()
 Conversion operator to type MatrixRef. More...
 

Static Public Member Functions

static constexpr dim_t ndim ()
 

Public Attributes

local_type local
 Local view proxy object. More...
 

Detailed Description

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
class dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >

Forward-declaration.

An n-dimensional array supporting subranges and sub-dimensional projection.

Implemented concept:
Matrix Concept
Todo:
Projection order matrix.sub().local() is not fully implemented yet. Currently only matrix.local().sub() is supported.
Note
Roughly follows the design presented in "The C++ Programming Language" (Bjarne Stroustrup) Chapter 29: A Matrix Design
Examples:
ex.10.radixsort/main.cpp, ex.11.halo-stencil/main.cpp, and ex.11.simple-stencil/main.cpp.

Definition at line 26 of file LocalMatrixRef.h.

Member Typedef Documentation

◆ const_local_type

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::const_local_type

Type specifying the view on const local matrix elements.

Definition at line 228 of file Matrix.h.

◆ const_view_type

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t NumViewDim>
using dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::const_view_type = MatrixRef<const ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT>

Type of views on matrix elements such as sub-matrices, row- and column vectors.

Definition at line 244 of file Matrix.h.

◆ local_type

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::local_type

Type specifying the view on local matrix elements.

Definition at line 223 of file Matrix.h.

◆ pattern_type

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
typedef PatternT dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::pattern_type

The type of the pattern specifying linear iteration order and how elements are distribute to units.

Definition at line 232 of file Matrix.h.

◆ view_type

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t NumViewDim>
using dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::view_type = MatrixRef<ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT>

Type of views on matrix elements such as sub-matrices, row- and column vectors.

Definition at line 238 of file Matrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( Team team = dash::Team::Null())
explicit

Default constructor, for delayed allocation.

Sets the associated team to DART_TEAM_NULL for global matrix instances that are declared before dash::Init().

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().

◆ Matrix() [2/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( const size_spec ss,
const distribution_spec ds = distribution_spec(),
Team t = dash::Team::All(),
const team_spec ts = team_spec() 
)
explicit

Constructor, creates a new instance of Matrix.

◆ Matrix() [3/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( const PatternT &  pat)
explicit

Constructor, creates a new instance of Matrix from a pattern instance.

◆ Matrix() [4/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename... Args>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( SizeType  arg,
Args &&...  args 
)
inline

Constructor, creates a new instance of Matrix of given extents.

Definition at line 326 of file Matrix.h.

327  : Matrix(PatternT(arg, std::forward<Args>(args)...))
328  { }
Matrix(Team &team=dash::Team::Null())
Default constructor, for delayed allocation.

◆ Matrix() [5/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( const self_t )
delete

Copy-constructor, deleted.

◆ Matrix() [6/6]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix ( self_t &&  other)

Move-constructor, supported.

◆ ~Matrix()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::~Matrix ( )

Destructor, frees underlying memory.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().

Member Function Documentation

◆ allocate() [1/3]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::allocate ( const size_spec sizespec,
const distribution_spec distribution,
const team_spec teamspec,
dash::Team team = dash::Team::All() 
)

Explicit allocation of matrix elements, used for delayed allocation of default-constructed Matrix instance.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate(), and dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().

◆ allocate() [2/3]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::allocate ( const PatternT &  pattern)

Allocation and distribution of matrix elements as specified by a given Pattern instance.

◆ allocate() [3/3]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename... Args>
bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::allocate ( SizeType  arg,
Args...  args 
)
inline

Allocation and distribution of matrix elements as specified by given extents.

See variadic constructor.

Definition at line 395 of file Matrix.h.

396  {
397  return allocate(PatternT(arg, args... ));
398  }
bool allocate(const size_spec &sizespec, const distribution_spec &distribution, const team_spec &teamspec, dash::Team &team=dash::Team::All())
Explicit allocation of matrix elements, used for delayed allocation of default-constructed Matrix ins...

◆ at() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename ... Args>
const_reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::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

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ at() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename ... Args>
reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::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

◆ barrier()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::barrier ( ) const
inline

Synchronize units associated with the matrix.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ begin() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
iterator dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::begin ( )
noexcept

Iterator referencing first matrix element in global index space.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ begin() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr const_iterator dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::begin ( ) const
noexcept

Iterator referencing first matrix element in global index space.

See also
Container Concept

◆ block() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::block ( const std::array< index_type, NumDimensions > &  block_gcoords)

View at block at given global block coordinates.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().

◆ block() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::block ( index_type  block_gindex)

View at block at given global block offset.

◆ col() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::col ( size_type  n) const

Projection to given offset in first sub-dimension (column), same as sub<0>(n).

Returns
A MatrixRef object representing the nth column
See also
sub
row
Parameters
nColumn offset.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ col() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::col ( size_type  n)

Projection to given offset in first sub-dimension (column), same as sub<0>(n).

Returns
A MatrixRef object representing the nth column
See also
sub
row
Parameters
nColumn offset.

◆ cols()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::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.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ deallocate()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::deallocate ( )

Explicit deallocation of matrix elements, called implicitly in destructor and team deallocation.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ end() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
iterator dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::end ( )
noexcept

Iterator referencing past the last matrix element in global index space.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ end() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr const_iterator dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::end ( ) const
noexcept

Iterator referencing past the last matrix element in global index space.

See also
Container Concept

◆ flush() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::flush ( )
inline

Complete all outstanding non-blocking operations to all units on the container's underlying global memory.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ flush() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::flush ( dash::team_unit_t  target)
inline

Complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory.

See also
Container Concept

◆ flush_local() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::flush_local ( )
inline

Locally complete all outstanding non-blocking operations to all units on the container's underlying global memory.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ flush_local() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::flush_local ( dash::team_unit_t  target)
inline

Locally complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory.

◆ is_local() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::is_local ( size_type  g_pos) const

Whether the element at a global, canonical offset in the matrix is local to the active unit.

See also
Container Concept
Parameters
g_posCanonical offset in global index space.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ is_local() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t Dimension>
constexpr bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::is_local ( size_type  g_pos) const

Whether the element at a global, canonical offset in a specific dimension of the matrix is local to the active unit.

Parameters
g_posLinear offset in the selected dimension.

◆ lbegin() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
ElementT* dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::lbegin ( )
noexcept

◆ lbegin() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr const ElementT* dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::lbegin ( ) const
noexcept

Pointer to first element in local range.

See also
Container Concept

◆ lend() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
ElementT* dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::lend ( )
noexcept

Pointer past final element in local range.

See also
Container Concept

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ lend() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr const ElementT* dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::lend ( ) const
noexcept

Pointer past final element in local range.

See also
Container Concept

◆ operator MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT >()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > ( )

Conversion operator to type MatrixRef.

◆ operator()() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename... Args>
const_reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator() ( Args...  args) const

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

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ operator()() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<typename... Args>
reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::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/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
self_t& dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator= ( const self_t other)
delete

◆ operator=() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
self_t& dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator= ( self_t &&  other)

Move-assignment operator, supported.

◆ operator[]() [1/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if< (__NumViewDim != 0), const_view_type<__NumViewDim> >::type constexpr dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] ( size_type  n) const

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

Parameters
nOffset in highest matrix dimension.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ operator[]() [2/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if< (__NumViewDim == 0), const_reference >::type constexpr dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] ( size_type  n) const

Subscript operator, returns a GlobRef if matrix has only one dimension.

Parameters
nOffset in highest matrix dimension.

◆ operator[]() [3/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if<(__NumViewDim != 0), view_type<__NumViewDim> >::type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] ( size_type  n)

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

Parameters
nOffset in highest matrix dimension.

◆ operator[]() [4/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t __NumViewDim = NumDimensions-1>
std::enable_if<(__NumViewDim == 0), reference>::type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] ( size_type  n)

Subscript operator, returns a GlobRef if matrix has only one dimension.

Parameters
nOffset in highest matrix dimension.

◆ pattern()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
constexpr const Pattern_t& dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::pattern ( ) const

◆ row() [1/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::row ( size_type  n) const

Projection to given offset in second sub-dimension (rows), same as sub<1>(n).

Returns
A MatrixRef object representing the nth row
See also
sub
col
Parameters
nRow offset.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ row() [2/2]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::row ( size_type  n)

Projection to given offset in second sub-dimension (rows), same as sub<1>(n).

Returns
A MatrixRef object representing the nth row
See also
sub
col
Parameters
nRow offset.

◆ rows()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::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.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ sub() [1/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t SubDimension>
const_view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub ( size_type  n,
size_type  range 
) const
Parameters
nOffset of the sub-range.
rangeWidth of the sub-range.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

◆ sub() [2/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t SubDimension>
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub ( size_type  n,
size_type  range 
)
Parameters
nOffset of the sub-range.
rangeWidth of the sub-range.

◆ sub() [3/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t SubDimension>
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub ( size_type  n) const

Projection to given offset in a sub-dimension.

See also
row
col
Parameters
nOffset in selected dimension.

◆ sub() [4/4]

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
template<dim_t SubDimension>
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub ( size_type  n)

Projection to given offset in a sub-dimension.

See also
row
col
Parameters
nOffset in selected dimension.

◆ sub_local()

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
local_type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub_local ( )
noexcept

Local proxy object representing a view consisting of matrix elements that are located in the active unit's local memory.

Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().

Member Data Documentation

◆ local

template<typename ElementT, dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = TilePattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
local_type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::local

Local view proxy object.

Definition at line 251 of file Matrix.h.


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