Ginkgo
Generated from pipelines/1330831941 branch based on master. Ginkgo version 1.8.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 . More... | |
constexpr | span (size_type begin, size_type end) noexcept |
Creates a span. More... | |
constexpr bool | is_valid () const |
Checks if a span is valid. More... | |
constexpr size_type | length () const |
Returns the length of a span. More... | |
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:
x < y
(y > x
) if and only if x.end < y.begin
x <= y
(y >= x
) if and only if x.end <= y.begin
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 |
Creates a span representing a point point
.
The begin
of this span is set to point
, and the end
to point + 1
.
point | the point which the span represents |
|
inlineconstexpr |
Checks if a span is valid.
this->begin <= this->end
Referenced by gko::accessor::row_major< ValueType, Dimensionality >::operator()().
|
inlineconstexpr |