strata::Diagonal¶
Part of Views and expressions.
E read along its diagonal: the axes Axes become one, at the place of the first, and element i of it is the operand's at i on each of them.
diagonal<0, 1>(matrix) is the main diagonal.
What diagonal<Axes...> gives for a node that has no diagonal of its own: it reads through the operand, and its cursor is the operand's, stepped along all of Axes at once. A node with a better way, a view whose diagonal is another view, gives that instead.
Template parameters
| Name | Description |
|---|---|
E | The operand as it is held, capture_t of what was given: borrowed for an lvalue owner, owned for a temporary one, which makes the diagonal moved and never copied, else by value. |
Axes | At least two axes of the operand, in increasing order, of one extent. |
Members¶
Diagonal¶
The diagonal of operand over Axes.
Precondition
The operand's extents along Axes are equal.
operand¶
The operand that is read along its diagonal.
shape¶
The operand's shape with Axes made one.
cursor¶
Where a traversal starts: the operand's cursor, with the diagonal axis stepping along all of Axes.
operator[]¶
The element at a position of the diagonal: the operand's, with the diagonal's index on each of Axes.
Precondition
Each index is within the extent of its axis; the operand checks it.