|
xtensor
|
Enumerations | |
| enum class | xt::stride_type { xt::stride_type::internal = 0 , xt::stride_type::normal = 1 , xt::stride_type::bytes = 2 } |
| Choose stride type. More... | |
Functions | |
| template<class offset_type, class S, class Arg, class... Args> | |
| offset_type | xt::data_offset (const S &strides, Arg arg, Args... args) noexcept |
| Return the flat index for an array index. | |
| template<layout_type L = layout_type::dynamic, class shape_type, class strides_type> | |
| std::size_t | xt::compute_strides (const shape_type &shape, layout_type l, strides_type &strides) |
| Compute the strides given the shape and the layout of an array. | |
| template<class S, class... Args> | |
| void | xt::normalize_periodic (const S &shape, Args &... args) |
| Normalise an index of a periodic array. | |
| template<class E> | |
| auto | xt::strides (const E &e, stride_type type=stride_type::normal) noexcept |
| Get strides of an object. | |
| template<class E> | |
| auto | xt::strides (const E &e, std::size_t axis, stride_type type=stride_type::normal) noexcept |
| Get stride of an object along an axis. | |
|
strong |
Choose stride type.
| Enumerator | |
|---|---|
| internal | As used internally (with stride(axis) == 0 if shape(axis) == 1). |
| normal | Normal stride corresponding to storage. |
| bytes | Normal stride in bytes. |
Definition at line 238 of file xstrides.hpp.
|
inline |
Compute the strides given the shape and the layout of an array.
| shape | Shape of the array. |
| l | Layout type, see xt::layout_type(). |
| strides | (output) Strides of the array. |
Definition at line 574 of file xstrides.hpp.
|
inlinenoexcept |
Return the flat index for an array index.
Given m arguments, and dimension nof the array (n == strides.size()).
| strides | Strides of the array. |
| arg | First array index. |
| args | Remaining array indices. |
Definition at line 461 of file xstrides.hpp.
|
inline |
Normalise an index of a periodic array.
For example if the shape is (3, 4) and the index is (3, -4) the result is (0, 0).
| shape | Shape of the array. |
| args | (input/output) Array index. |
Definition at line 917 of file xstrides.hpp.
|
inlinenoexcept |
Get stride of an object along an axis.
| e | an array |
| axis | axis along which to query the stride |
| type | output stride convention |
Definition at line 300 of file xstrides.hpp.
|
inlinenoexcept |
Get strides of an object.
| e | an array |
| type | output stride convention |
Definition at line 254 of file xstrides.hpp.