DASH Multidimensional Range Concept

References

Expressions

dash::Array<int> r(gsize);

// --- Local Index Concept --------------------------------------------------
// ---
// --- Types:
// ---
// ---   dash::local_index<UnitT, IndexT> {
// ---      UnitT   unit;   // dash::unit_id<UnitScope>
// ---      IndexT  offset;
// ---   }
// ---
dash::offset(local_index) -> decltype(local_index)::index_type;
dash::unit(local_index)   -> decltype(local_index)::unit_type;


// --- Iterator Concept -----------------------------------------------------
// ---
// ---   dash::index(iterator) -> iterator::index_type
// ---   dash::pos(iterator)  : alias for dash::index
// ---   dash::gpos(iterator) : alias for dash::index(dash::global(iterator))
// ---   dash::lpos(iterator) : alias for dash::index(dash::local(iterator))

// --- Pattern Concept ------------------------------------------------------
// ---
dash::block(bi, Pattern) -> View<Pattern::ndim>;

// --- Range Concept --------------------------------------------------------
// ---
dash::begin(range) -> range::iterator_type;
dash::end(range)   -> range::iterator_type;

// --- Expressions:
auto lbegin = dash::begin(dash::local(r));

dash::local(range)  -> range::local_type;
dash::global(range) -> range::global_type;

// --- Expressions:
auto lrange = dash::local(dash::begin(r), dash::end(r));
auto lbegin = dash::begin(lrange);


dash::slice(dim, idxfirst, idxlast) -> view<dim, dim>;
dash::slice<dim>(index)             -> view<dim, dim-1>;
dash::slice<dim>(idxfirst, idxlast) -> view<dim, dim>;


// --- Expressions:
auto r = dash::range(r, rfirst, rlast); // -> Range

// --- Dimensional Concept --------------------------------------------------
// ---
// Dimensional types have extents in N dimensions but no offset. They can be
// projected to a lower number of dimensions.
// The domain of Dimensional types is not necessarily a metric. For example,
// it could be categorial, like "Cities".
// Consequently, no ranges can be specified.
// A Dimensional type with a metric domain (int, double, complex,  ...) is a
// Cartesian type.

// Number of dimensions:
dash::dimensional_traits<Dimensional>::rank -> dash::dim_t;
 
// Lowest dimension:
dash::dimensional_traits<Dimensional>::min  -> dash::dim_t;

// Highest dimension:
dash::dimensional_traits<Dimensional>::max  -> dash::dim_t;

// Number of view dimensions:
dash::dimensional_traits<Dimensional>::num_vdim -> dash::dim_t;

// Number of origin dimensions:
dash::dimensional_traits<Dimensional>::num_odim -> dash::dim_t;

// --- Cartesian Concept ----------------------------------------------------


// --- View Concept ---------------------------------------------------------
// ---   ~>  Range
// ---   ~>  Dimensional
// ---
// --- v-dimensional View on an o-dimensional range (v <= o)

// VDim: view dimensions v
// ODim: origin dimensions o
dash::View<VDim, ODim> v;
auto vrank = dash::dimensional_traits<decltype(v)>::rank; // -> VDim
auto vdim  = dash::dimensional_traits<decltype(v)>::vdim; // -> VDim
auto odim  = dash::dimensional_traits<decltype(v)>::odim; // -> ODim

bool has_v = dash::view_traits<decltype(r)>::is_origin;

dash::offset<dim>(v) == dash::offset(dim, v)
dash::extent<dim>(v) == dash::extent(dim, v)
dash::size<dim>(v)   == dash::size(dim, v)

// --- One-dimensional View
dash::View v(size);
auto vrank = dash::dimensional_traits<decltype(v)>::rank; // -> 1
auto vdim  = dash::dimensional_traits<decltype(v)>::vdim; // -> 1
auto odim  = dash::dimensional_traits<decltype(v)>::odim; // -> 1

// --- View ~> Range

// ---   dash::begin(v) -> Iterator
// ---   dash::end(v)   -> Iterator
auto vbegin   = dash::begin(v);
auto vend     = dash::end(v);

auto vlbegin  = dash::local(vbegin);
auto vlifirst = dash::index(vlbegin);

auto vl       = dash::local(v);
auto vg       = dash::global(v);

Notes on Reference Members