Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
ndarray_range.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <limits>
5
6namespace clustering {
7
14struct Range {
16 std::size_t begin = 0;
18 std::size_t end = std::numeric_limits<std::size_t>::max();
20 std::ptrdiff_t step = 1;
21};
22
26constexpr Range all() { return {}; }
27
28} // namespace clustering
constexpr Range all()
Sentinel value meaning "take every element of this axis".
Half-open index range with optional positive step for slicing an NDArray axis.
std::size_t begin
Inclusive start index along the target axis.
std::size_t end
Exclusive end index; sentinel is clamped to the axis size at slice time.
std::ptrdiff_t step
Positive stride in element units; negative values are rejected.