![]() |
Ginkgo Generated from branch based on main. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
|
A span is a lightweight structure used to create sub-ranges from other ranges. More...
#include <ginkgo/core/base/range.hpp>
Public Member Functions | |
constexpr | span (size_type point) noexcept |
Creates a span representing a point point. | |
constexpr | span (size_type begin, size_type end) noexcept |
Creates a span. | |
constexpr bool | is_valid () const |
Checks if a span is valid. | |
constexpr size_type | length () const |
Returns the length of a span. |
Public Attributes | |
const size_type | begin |
Beginning of the span. | |
const size_type | end |
End of the span. |
A span is a lightweight structure used to create sub-ranges from other ranges.
A span s represents a contiguous set of indexes in one dimension of the range, starting on index s.begin (inclusive) and ending at index s.end (exclusive). A span is only valid if its starting index is smaller than its ending index.
Spans can be compared using the == and != operators. Two spans are identical if both their begin and end values are identical.
Spans also have two distinct partial orders defined on them:
Note that the orders are in fact partial - there are spans x and y for which none of the following inequalities holds: x < y, x > y, x == y, x <= y, x >= y. An example are spans span{0, 2} and span{1, 3}.
In addition, <= is a distinct order from <, and not just an extension of the strict order to its weak equivalent. Thus, x <= y is not equivalent to x < y || x == y.
|
inlineconstexprnoexcept |
|
inlineconstexpr |
Checks if a span is valid.
Referenced by gko::accessor::row_major< ValueType, Dimensionality >::operator()().
|
inlineconstexpr |