DASH  0.3.0
dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType > Class Template Reference

Specifies how local element indices are arranged in a specific number of dimensions. More...

#include <Cartesian.h>

Public Types

typedef IndexType index_type
 
typedef SizeType size_type
 
typedef std::array< SizeType, NumDimensions > extents_type
 
typedef std::integral_constant< dim_t, NumDimensions > ndim
 The number of dimension in the cartesian space. More...
 

Public Member Functions

constexpr LocalMemoryLayout (const SizeSpec< NumDimensions > &sizespec, const DistributionSpec< NumDimensions > &distspec)
 Constructor, creates an instance of LocalMemoryLayout from a SizeSpec and a DistributionSpec of NumDimensions dimensions. More...
 
constexpr LocalMemoryLayout (const DistributionSpec< NumDimensions > &distspec)
 Constructor, creates an instance of LocalMemoryLayout with initial extents 0 and a DistributionSpec of NumDimensions dimensions. More...
 
bool operator== (const self_t &other) const
 Equality comparison operator. More...
 
constexpr bool operator!= (const self_t &other) const
 Inequality comparison operator. More...
 
template<typename... Args>
void resize (SizeType arg, Args... args)
 Change the extent of the cartesian space in every dimension. More...
 
template<typename SizeType_ >
void resize (std::array< SizeType_, NumDimensions > extents)
 Change the extent of the cartesian space in every dimension. More...
 
template<typename... Args, MemArrange AtArrangement = Arrangement>
constexpr IndexType at (IndexType arg, Args... args) const
 Convert the given coordinates to their respective linear index. More...
 
template<MemArrange AtArrangement = Arrangement, typename OffsetType >
IndexType at (const std::array< OffsetType, NumDimensions > &point) const
 Convert the given cartesian point to its respective linear index. More...
 
template<MemArrange AtArrangement = Arrangement, typename OffsetType >
IndexType at (const std::array< OffsetType, NumDimensions > &point, const ViewSpec_t &viewspec) const
 Convert the given cartesian point to a linear index, respective to the offsets specified in the given ViewSpec. More...
 
template<MemArrange CoordArrangement = Arrangement>
std::array< IndexType, NumDimensions > coords (IndexType index) const
 Convert given linear offset (index) to cartesian coordinates. More...
 
constexpr dim_t rank () const noexcept
 The number of dimension in the cartesian space with extent greater than 1. More...
 
template<typename SizeType_ >
void resize (const std::array< SizeType_, NumDimensions > &extents)
 Change the extent of the cartesian space in every dimension. More...
 
void resize (dim_t dim, SizeType extent)
 Change the extent of the cartesian space in the given dimension. More...
 
constexpr SizeType size () const noexcept
 The number of discrete elements within the space spanned by the coordinate. More...
 
constexpr const extents_type & extents () const noexcept
 Extents of the cartesian space, by dimension. More...
 
SizeType extent (dim_t dim) const
 The extent of the cartesian space in the given dimension. More...
 
template<MemArrange CoordArrangement = Arrangement>
std::array< IndexType, NumDimensions > coords (IndexType index, const ViewSpec_t &viewspec) const
 Convert given linear offset (index) to cartesian coordinates with respect to a given viewspec. More...
 
template<dim_t U = NumDimensions>
constexpr std::enable_if<(U > 0), SizeType >::type x (SizeType offs) const
 Accessor for dimension 1 (x), enabled for dimensionality > 0. More...
 
template<dim_t U = NumDimensions>
constexpr std::enable_if<(U > 1), SizeType >::type y (SizeType offs) const
 Accessor for dimension 2 (y), enabled for dimensionality > 1. More...
 
template<dim_t U = NumDimensions>
constexpr std::enable_if<(U > 2), SizeType >::type z (SizeType offs) const
 Accessor for dimension 3 (z), enabled for dimensionality > 2. More...
 

Detailed Description

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
class dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >

Specifies how local element indices are arranged in a specific number of dimensions.

Behaves like CartesianIndexSpace if distribution is not tiled in any dimension.

Template Parameters
NumDimensionsNumber of dimensions

Definition at line 627 of file Cartesian.h.

Member Typedef Documentation

◆ ndim

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
typedef std::integral_constant<dim_t, NumDimensions> dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::ndim
inherited

The number of dimension in the cartesian space.

Definition at line 279 of file Cartesian.h.

Constructor & Destructor Documentation

◆ LocalMemoryLayout() [1/2]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::LocalMemoryLayout ( const SizeSpec< NumDimensions > &  sizespec,
const DistributionSpec< NumDimensions > &  distspec 
)
inline

Constructor, creates an instance of LocalMemoryLayout from a SizeSpec and a DistributionSpec of NumDimensions dimensions.

Definition at line 644 of file Cartesian.h.

647  : parent_t(sizespec),
648  _distspec(distspec) {
649  }

◆ LocalMemoryLayout() [2/2]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::LocalMemoryLayout ( const DistributionSpec< NumDimensions > &  distspec)
inline

Constructor, creates an instance of LocalMemoryLayout with initial extents 0 and a DistributionSpec of NumDimensions dimensions.

Definition at line 655 of file Cartesian.h.

657  : parent_t(SizeSpec<NumDimensions>()),
658  _distspec(distspec) {
659  }

Member Function Documentation

◆ at() [1/3]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<typename... Args, MemArrange AtArrangement = Arrangement>
constexpr IndexType dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::at ( IndexType  arg,
Args...  args 
) const
inline

Convert the given coordinates to their respective linear index.

Parameters
argsAn argument list consisting of the coordinates, ordered by dimension (x, y, z, ...)

Definition at line 714 of file Cartesian.h.

715  {
716  static_assert(
717  sizeof...(Args) == NumDimensions-1,
718  "Invalid number of arguments");
719  return at<AtArrangement>(
720  std::array<IndexType, NumDimensions> {
721  arg, (IndexType)(args) ... }
722  );
723  }

◆ at() [2/3]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<MemArrange AtArrangement = Arrangement, typename OffsetType >
IndexType dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::at ( const std::array< OffsetType, NumDimensions > &  point) const
inline

Convert the given cartesian point to its respective linear index.

Parameters
pointAn array containing the coordinates, ordered by dimension (x, y, z, ...)

Definition at line 734 of file Cartesian.h.

735  {
736  if (!_distspec.is_tiled()) {
737  // Default case, no tiles
738  return parent_t::at(point);
739  }
740  // Tiles in at least one dimension
741  // TODO
743  "CartesianIndexSpace::at(IndexType) not implemented for tiles!");
744  }
constexpr IndexType at(IndexType arg, Args... args) const
Convert the given coordinates to their respective linear index.
Definition: Cartesian.h:429

◆ at() [3/3]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<MemArrange AtArrangement = Arrangement, typename OffsetType >
IndexType dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::at ( const std::array< OffsetType, NumDimensions > &  point,
const ViewSpec_t viewspec 
) const
inline

Convert the given cartesian point to a linear index, respective to the offsets specified in the given ViewSpec.

Parameters
pointAn array containing the coordinates, ordered by dimension (x, y, z, ...)
viewspecAn instance of ViewSpec to apply to the given point before resolving the linear index.

Definition at line 758 of file Cartesian.h.

760  {
761  std::array<OffsetType, NumDimensions> coords;
762  for (auto d = 0; d < NumDimensions; ++d) {
763  coords[d] = point[d] + viewspec[d].offset;
764  }
765  return at(coords);
766  }
constexpr IndexType at(IndexType arg, Args... args) const
Convert the given coordinates to their respective linear index.
Definition: Cartesian.h:714
std::array< IndexType, NumDimensions > coords(IndexType index) const
Convert given linear offset (index) to cartesian coordinates.
Definition: Cartesian.h:773

◆ coords() [1/2]

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<MemArrange CoordArrangement = Arrangement>
std::array<IndexType, NumDimensions> dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::coords ( IndexType  index,
const ViewSpec_t viewspec 
) const
inlineinherited

Convert given linear offset (index) to cartesian coordinates with respect to a given viewspec.

Inverse of at(...).

Definition at line 526 of file Cartesian.h.

529  {
530  std::array<IndexType, NumDimensions> pos{};
531  extents_type offset;
532  if (CoordArrangement == ROW_MAJOR)
533  {
534  offset[NumDimensions-1] = 1;
535  for(auto i = NumDimensions-2; i >= 0; --i)
536  offset[i] = offset[i+1] * viewspec.extent(i+1);
537 
538  for(auto i = 0; i < NumDimensions; ++i)
539  {
540  pos[i] = index / offset[i] + viewspec.offset(i);
541  index = index % offset[i];
542  }
543  }
544  else if (CoordArrangement == COL_MAJOR)
545  {
546  offset[0] = 1;
547  for(auto i = 1; i < NumDimensions; ++i)
548  offset[i] = offset[i-1] * viewspec.extent(i-1);
549 
550  for(auto i = NumDimensions-1; i >= 0; --i)
551  {
552  pos[i] = index / offset[i] + viewspec.offset(i);
553  index = index % offset[i];
554  }
555  }
556  return pos;
557  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60

◆ coords() [2/2]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<MemArrange CoordArrangement = Arrangement>
std::array<IndexType, NumDimensions> dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::coords ( IndexType  index) const
inline

Convert given linear offset (index) to cartesian coordinates.

Inverse of at(...).

Definition at line 773 of file Cartesian.h.

References dash::CartesianSpace< NumDimensions, SizeType >::extents(), dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::extents(), and dash::typestr().

773  {
774  if (!_distspec.is_tiled()) {
775  // Default case, no tiles
776  return parent_t::coords(index);
777  }
778  // Tiles in at least one dimension
779  // TODO
781  "CartesianIndexSpace::coords(IndexType) not implemented for tiles!");
782  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60
std::array< IndexType, NumDimensions > coords(IndexType index) const
Convert given linear offset (index) to cartesian coordinates.
Definition: Cartesian.h:497

◆ extent()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
SizeType dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::extent ( dim_t  dim) const
inlineinherited

The extent of the cartesian space in the given dimension.

Parameters
dimThe dimension in the coordinate
Returns
The extent in the given dimension

Definition at line 412 of file Cartesian.h.

Referenced by dash::TilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::block(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::block_at(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::block_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::block_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::block_at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::blocksize(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::blocksize(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::blocksize(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::blocksize(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::extent(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::extent(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::extent(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::extent(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_block(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block_at(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_block_at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block_local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_coords(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_coords(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_extent(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_extent(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_extent(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_extent(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_index(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::underfilled_blocksize(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::unit_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::unit_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::unit_at(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::unit_at().

412  {
413  DASH_ASSERT_RANGE(
414  0, dim, NumDimensions-1,
415  "Given dimension " << dim <<
416  " for CartesianIndexSpace::extent(dim) is out of bounds");
417  return _extents[dim];
418  }

◆ extents()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr const extents_type& dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::extents ( ) const
inlinenoexceptinherited

Extents of the cartesian space, by dimension.

Definition at line 402 of file Cartesian.h.

Referenced by dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::block(), dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::coords(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::extents(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::extents(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::extents(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::extents(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block_local(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_block_local(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_block_local(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_block_local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_extents(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_extents(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::sizespec(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::sizespec(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::sizespec(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::sizespec(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::underfilled_blocksize(), and dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::unit_at().

402  {
403  return _extents;
404  }

◆ operator!=()

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr bool dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::operator!= ( const self_t other) const
inline

Inequality comparison operator.

Definition at line 674 of file Cartesian.h.

674  {
675  return !(*this == other);
676  }

◆ operator==()

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
bool dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::operator== ( const self_t other) const
inline

Equality comparison operator.

Definition at line 664 of file Cartesian.h.

664  {
665  if (!(parent_t::operator==(other))) {
666  return false;
667  }
668  return _distspec == other._distspec;
669  }

◆ rank()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr dim_t dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::rank ( ) const
inlinenoexceptinherited

The number of dimension in the cartesian space with extent greater than 1.

See also
num_dimensions()
Returns
The number of dimensions in the coordinate

Definition at line 315 of file Cartesian.h.

315  {
316  return _rank;
317  }

◆ resize() [1/4]

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<typename SizeType_ >
void dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::resize ( const std::array< SizeType_, NumDimensions > &  extents)
inlineinherited

Change the extent of the cartesian space in every dimension.

Definition at line 363 of file Cartesian.h.

363  {
364  // Update size:
365  _size = 1;
366  for(auto i = 0; i < NumDimensions; i++ ) {
367  _extents[i] = static_cast<SizeType>(extents[i]);
368  _size *= _extents[i];
369  }
370  // Update offsets:
371  _offset_row_major[NumDimensions-1] = 1;
372  for(auto i = NumDimensions-2; i >= 0; --i) {
373  _offset_row_major[i] = _offset_row_major[i+1] * _extents[i+1];
374  }
375  _offset_col_major[0] = 1;
376  for(auto i = 1; i < NumDimensions; ++i) {
377  _offset_col_major[i] = _offset_col_major[i-1] * _extents[i-1];
378  }
379  }
constexpr const extents_type & extents() const noexcept
Extents of the cartesian space, by dimension.
Definition: Cartesian.h:402

◆ resize() [2/4]

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
void dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::resize ( dim_t  dim,
SizeType  extent 
)
inlineinherited

Change the extent of the cartesian space in the given dimension.

Definition at line 384 of file Cartesian.h.

384  {
385  _extents[dim] = extent;
386  resize(_extents);
387  }
void resize(SizeType arg, Args... args)
Change the extent of the cartesian space in every dimension.
Definition: Cartesian.h:350
SizeType extent(dim_t dim) const
The extent of the cartesian space in the given dimension.
Definition: Cartesian.h:412

◆ resize() [3/4]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<typename... Args>
void dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::resize ( SizeType  arg,
Args...  args 
)
inline

Change the extent of the cartesian space in every dimension.

Definition at line 682 of file Cartesian.h.

References dash::CartesianSpace< NumDimensions, SizeType >::extents(), and dash::CartesianSpace< NumDimensions, SizeType >::resize().

682  {
683  static_assert(
684  sizeof...(Args) == NumDimensions-1,
685  "Invalid number of arguments");
686  std::array<SizeType, NumDimensions> extents =
687  {{ arg, (SizeType)(args)... }};
688  resize(extents);
689  }
constexpr const extents_type & extents() const noexcept
Extents of the cartesian space, by dimension.
Definition: Cartesian.h:402
void resize(SizeType arg, Args... args)
Change the extent of the cartesian space in every dimension.
Definition: Cartesian.h:682

◆ resize() [4/4]

template<size_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<typename SizeType_ >
void dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::resize ( std::array< SizeType_, NumDimensions >  extents)
inline

Change the extent of the cartesian space in every dimension.

Definition at line 695 of file Cartesian.h.

695  {
696  if (!_distspec.is_tiled()) {
698  }
699  // Tiles in at least one dimension
700  // TODO
702  "CartesianIndexSpace::resize(IndexType) not implemented for tiles!");
703  }
void resize(SizeType arg, Args... args)
Change the extent of the cartesian space in every dimension.
Definition: Cartesian.h:350
constexpr const extents_type & extents() const noexcept
Extents of the cartesian space, by dimension.
Definition: Cartesian.h:402

◆ size()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
constexpr SizeType dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::size ( ) const
inlinenoexceptinherited

The number of discrete elements within the space spanned by the coordinate.

Returns
The number of discrete elements in the coordinate's space

Definition at line 395 of file Cartesian.h.

Referenced by dash::TilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::capacity(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::capacity(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::capacity(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::capacity(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::coords(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::global(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::global_at(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::local_at(), dash::BlockPattern< 1, Arrangement, IndexType >::local_block_at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::max_blocksize(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::max_blocksize(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::max_blocksize(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::max_blocksize(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::ndim(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::num_units(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::num_units(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::num_units(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::size(), dash::ShiftTilePattern< NumDimensions, Arrangement, IndexType >::size(), dash::SeqTilePattern< NumDimensions, Arrangement, IndexType >::size(), dash::TilePattern< NumDimensions, Arrangement, IndexType >::size(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize(), and dash::TilePattern< NumDimensions, Arrangement, IndexType >::underfilled_blocksize().

395  {
396  return _size;
397  }

◆ x()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<dim_t U = NumDimensions>
constexpr std::enable_if< (U > 0), SizeType >::type dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::x ( SizeType  offs) const
inlineinherited

Accessor for dimension 1 (x), enabled for dimensionality > 0.

Definition at line 591 of file Cartesian.h.

591  {
592  return coords(offs)[0];
593  }
std::array< IndexType, NumDimensions > coords(IndexType index) const
Convert given linear offset (index) to cartesian coordinates.
Definition: Cartesian.h:497

◆ y()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<dim_t U = NumDimensions>
constexpr std::enable_if< (U > 1), SizeType >::type dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::y ( SizeType  offs) const
inlineinherited

Accessor for dimension 2 (y), enabled for dimensionality > 1.

Definition at line 600 of file Cartesian.h.

600  {
601  return coords(offs)[1];
602  }
std::array< IndexType, NumDimensions > coords(IndexType index) const
Convert given linear offset (index) to cartesian coordinates.
Definition: Cartesian.h:497

◆ z()

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
template<dim_t U = NumDimensions>
constexpr std::enable_if< (U > 2), SizeType >::type dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::z ( SizeType  offs) const
inlineinherited

Accessor for dimension 3 (z), enabled for dimensionality > 2.

Definition at line 609 of file Cartesian.h.

609  {
610  return coords(offs)[2];
611  }
std::array< IndexType, NumDimensions > coords(IndexType index) const
Convert given linear offset (index) to cartesian coordinates.
Definition: Cartesian.h:497

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