16 #include "atlas/library/config.h" 27 operator int()
const {
return alignment_; }
35 using Base = std::vector<idx_t>;
39 ArrayShape( Base&& base ) : Base( std::forward<Base>( base ) ) {}
40 ArrayShape( std::initializer_list<idx_t> list ) : Base( list ) {}
41 template <
typename idx_t>
43 template <
typename idx_t, std::
size_t N>
44 ArrayShape(
const std::array<idx_t, N>& list ) : Base( list.begin(), list.end() ) {}
45 template <
typename idx_t>
46 ArrayShape(
const std::vector<idx_t>& list ) : Base( list.begin(), list.end() ) {}
51 template <
typename Int>
55 template <
typename Int1,
typename Int2>
56 inline ArrayShape make_shape( Int1 size1, Int2 size2 ) {
57 return ArrayShape{
static_cast<idx_t>( size1 ), static_cast<idx_t>( size2 )};
59 template <
typename Int1,
typename Int2,
typename Int3>
60 inline ArrayShape make_shape( Int1 size1, Int2 size2, Int3 size3 ) {
61 return ArrayShape{
static_cast<idx_t>( size1 ), static_cast<idx_t>( size2 ),
static_cast<idx_t>( size3 )};
63 template <
typename Int1,
typename Int2,
typename Int3,
typename Int4>
64 inline ArrayShape make_shape( Int1 size1, Int2 size2, Int3 size3, Int4 size4 ) {
65 return ArrayShape{
static_cast<idx_t>( size1 ), static_cast<idx_t>( size2 ),
static_cast<idx_t>( size3 ),
66 static_cast<idx_t>( size4 )};
68 template <
typename Int1,
typename Int2,
typename Int3,
typename Int4,
typename Int5>
69 inline ArrayShape make_shape( Int1 size1, Int2 size2, Int3 size3, Int4 size4, Int5 size5 ) {
70 return ArrayShape{
static_cast<idx_t>( size1 ), static_cast<idx_t>( size2 ),
static_cast<idx_t>( size3 ),
71 static_cast<idx_t>( size4 ),
static_cast<idx_t>( size5 )};
77 inline ArrayShape make_shape( std::initializer_list<idx_t> sizes ) {
81 template <
typename...
idx_t>
83 return detail::make_shape( std::forward<idx_t>( indices )... );
Definition: ArrayShape.h:33
Definition: ArrayShape.h:23
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
long idx_t
Integer type for indices in connectivity tables.
Definition: config.h:42