40 #define AFF_DUMP_CC_VERSION \ 51 os <<
"dump of a Strided object:" << endl;
52 os <<
" index ranges: ";
55 os <<
"[" << shape.
first(i) <<
":" << shape.
last(i) <<
"]";
65 os <<
" total number of mapped elements: " 66 << shape.
size() << endl;
67 os <<
" total address range in memory: [" 85 for (index[i]=shape.
first(i); index[i]<=shape.
last(i); index[i]++)
88 os << i <<
": [" << index[i] <<
"]";
95 os.width(5); os <<
" ";
96 for (
int k=shape.
first(1); k<=shape.
last(1); k++)
101 for (index[0]=shape.
first(0); index[0]<=shape.
last(0); index[0]++)
103 os.width(5); os << index[0];
104 for (index[1]=shape.
first(1); index[1]<=shape.
last(1); index[1]++)
108 { os << shape.
offset(index[0]); }
110 { os << shape.
offset(index[0], index[1]); }
112 { os << shape.
offset(index[0], index[1], index[2]); }
114 { os << shape.
offset(index[0], index[1], index[2], index[3]); }
116 { os << shape.
offset(index); }
124 for (index[0]=shape.
first(0); index[0]<=shape.
last(0); index[0]++)
126 os.width(5); os << index[0];
129 { os << shape.
offset(index[0]); }
131 { os << shape.
offset(index[0], index[1]); }
133 { os << shape.
offset(index[0], index[1], index[2]); }
135 { os << shape.
offset(index[0], index[1], index[2], index[3]); }
137 { os << shape.
offset(index); }
148 "ERROR (dump_map): illegal dimensionality");
150 os <<
" index mapping for " << i+1 <<
" dimensional access:" << endl;
Root namespace of library.
Shape for a rectangular array layout.
void dump(const Strided &shape, std::ostream &os)
dump shape
factored out Strided dump function (prototypes)
Tsubscript last_offset() const
last mapped position
void dump_map(const Strided &shape, const Tdim &i, std::ostream &os)
dump index mapping of shape
const Tsubscript & first(const Tsubscript &i) const
first index of dimension
const Tsize & stride(const Tsubscript &i) const
stride of dimension
exceptions and error handling macros (prototypes)
static const Tdim Mmax_dimen
instantiate static member (otherwise the linker won't find it)
#define AFF_assert(C, M)
Check an assertion and report by throwing an exception.
Tsize memory_size() const
total size of mapped memory range
Tsize size() const
total number of mapped elements
Tsubscript first_offset() const
first mapped position
unsigned short int Tdim
Type to hold an array dimensionality.
void dump_map_helper(const Strided &shape, const Tdim &i, const Tdim &j, Strided::TIndexVec &index, std::ostream &os)
recursive usage tests all offset functions
const Tsubscript & last(const Tsubscript &i) const
last index of dimension
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
size_t Tsize
Type to hold the size of an array dimension.