1 #ifndef DASH__DOMAIN_H__INCLUDED 2 #define DASH__DOMAIN_H__INCLUDED 8 #include <dash/Types.h> 9 #include <dash/internal/Logging.h> 33 Domain(
const std::initializer_list<std::array<IndexType, 2>> & ranges) {
35 NumDim, ranges.size(),
36 "wrong number of dimensions in domain ranges");
38 for (
auto & range : ranges) {
39 _extents[d] = range[1] - range[0];
40 _offsets[d] = range[0];
46 const std::array<IndexType, NumDim> & offs) {
50 std::plus<IndexType>());
55 const std::array<IndexType, NumDim> & extents) {
60 const std::array<IndexType, NumDim> & ext) {
64 std::plus<IndexType>());
68 IndexType offset(
dim_t d)
const {
72 std::array<IndexType, NumDim> offsets()
const {
76 IndexType extent(
dim_t d)
const {
80 std::array<IndexType, NumDim> extents()
const {
86 std::array<IndexType, NumDim> _offsets;
87 std::array<IndexType, NumDim> _extents;
91 template<dim_t D,
typename I>
92 std::ostream & operator<<(
95 os <<
"dash::Domain { ";
96 os <<
"extents(" << dom.extents() <<
"), ";
97 os <<
"offsets(" << dom.offsets() <<
")";
104 #endif // DASH__DOMAIN_H__INCLUDED Domain(const std::initializer_list< std::array< IndexType, 2 >> &ranges)
Example:
This class is a simple memory pool which holds allocates elements of size ValueType.
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
internal::default_signed_index default_index_t
Signed integer type used as default for index values.
OutputIt transform(InputIt in_first, InputIt in_last, OutputIt out_first, UnaryOperation unary_op)
Apply a given function to elements in a range and store the result in another range, beginning at out_first.