59 #define AFF_STRIDED_CC_VERSION \ 60 "AFF_STRIDED_DEF_H V1.8" 81 "ERROR (Strided::setup_from_size): size must be at least one");
114 "ERROR (Strided): first index must be smaller than last");
154 "ERROR (Strided::shrink): index must not be smaller than first");
156 "ERROR (Strided::shrink): index must not be larger than last");
168 "ERROR (Strided::shrink): illegal last index vector");
171 "ERROR (Strided::shrink): illegal first index vector");
173 "ERROR (Strided::shrink): last must not be smaller than first");
189 "ERROR (Strided::shrink): illegal dimension");
191 "ERROR (Strided::shrink): index range error");
209 "ERROR (Strided::shrink): illegal dimension");
211 "ERROR (Strided::shrink): illegal index value");
227 "ERROR (Strided::collapse): illegal dimension");
229 "ERROR (Strided::collapse): index range error");
230 this->
shrink(i,index,index);
253 "ERROR (Strided::shift): illegal dimension");
282 "ERROR (Strided::setfirst): illegal dimension");
284 return(this->
shift(i, ishift));
297 return(this->
shift(ishift));
306 && (shape.
size(2)==1)
307 && (shape.
size(3)==1)
Root namespace of library.
Shape for a rectangular array layout.
T inline_product(const SimpleRigidArray< T, N > &array)
Product of all elements.
bool is_dense_1D_array(const aff::Strided &shape)
check whether array shape describes a 1D array with dense layout in the memory.
const TIndexVec & first() const
return vector of first index values
void setup_from_size(const TSizeVec &size, const Tsubscript &first=1, const Tsubscript &shift=0)
setup to given size and first index
bool inline_anysmaller(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is smaller than corresponding B.
Strided & setfirst(const Tdim &i, const Tsubscript &index)
setfirst
Strided & shift(const Tdim &i, const Tsubscript &index)
shift
bool inline_anylarger(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is larger than corresponding B.
Strided & collapse(const Tdim &i, const Tsubscript &index)
slice
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.
shape of s strided array (prototypes)
Strided()
construct and initialize to zero
void calculate_base(const Tsubscript &offset)
construct do given first and last index
Tsize size() const
total number of mapped elements
const TIndexVec & last() const
return vector of last index values
Tsubscript first_offset() const
first mapped position
unsigned short int Tdim
Type to hold an array dimensionality.
ptrdiff_t Tsubscript
Type to hold an array's subscript value.
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
Strided & shrink(const TIndexVec &last)
subarray
size_t Tsize
Type to hold the size of an array dimension.