strata::tensor_cursorΒΆ
Part of Evaluation and assignment.
concept
template<typename C, std::size_t Rank>
concept strata::tensor_cursor =
std::copy_constructible<C> && std::is_nothrow_copy_constructible_v<C> &&
requires(const C& cursor) { cursor.read(); } && detail::moves_along_all<C>(std::make_index_sequence<Rank>{})
A position in a tensor of Rank axes that a traversal can read and move.
read() gives the value here. step<Axis>() moves one along any of the axes, and advance<Axis>(count) any number, a negative one too, in the time of one: the start of a tile, of a thread's share of an axis, of a line to vectorize.
Copied without throwing: a traversal copies its cursors at every level of nesting, so a cursor is a few words and no more. What a node keeps that is not that, a function with state, a cursor points to; the node must outlive its cursors. (Not "trivially copyable": a std::tuple of cursors is not, though it is as cheap.)