|
Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
|
Provides read-write access to NDArray elements. More...
#include <clustering/ndarray.h>
Public Member Functions | |
| Accessor (NDArray< T, N, Layout::Contig > &ndarray, std::size_t index, std::size_t dim) | |
| Constructs an Accessor for an NDArray. | |
| Accessor | operator[] (std::size_t index) noexcept |
| Provides access to the next dimension of the NDArray. | |
| Accessor & | operator= (T value) noexcept |
| Assigns a value to the element at the accessor's position. | |
| Public Member Functions inherited from clustering::NDArray< T, N, L >::ConstAccessor | |
| ConstAccessor (const NDArray< T, N, Layout::Contig > &ndarray, std::size_t index, std::size_t dim) | |
| Constructs a ConstAccessor for a constant NDArray. | |
| ConstAccessor (const ConstAccessor &other)=default | |
| Defaulted copy constructor; accessors are lightweight and trivially copyable. | |
| ConstAccessor | operator[] (std::size_t index) const noexcept |
| Provides access to the next dimension of the NDArray. | |
| operator T () const noexcept | |
| Converts the accessor to the element type T, allowing read access to the element. | |
| size_t | index () const noexcept |
| Returns the flat index in the NDArray corresponding to the accessor. | |
| Public Member Functions inherited from clustering::NDArray< T, N, L >::BaseAccessor | |
| const T * | data () const |
| Returns a pointer to the element data. | |
Additional Inherited Members | |
| Protected Member Functions inherited from clustering::NDArray< T, N, L >::BaseAccessor | |
| BaseAccessor (NDArray< T, N, Layout::Contig > *ndarray, std::size_t index, std::size_t dim) | |
| Constructs a BaseAccessor for a given NDArray, index, and dimension. | |
| Protected Attributes inherited from clustering::NDArray< T, N, L >::BaseAccessor | |
| NDArray< T, N, Layout::Contig > * | m_ndarray |
| Pointer to the NDArray. | |
| std::size_t | m_index |
| Index in the flat representation of the array. | |
| std::size_t | m_dim |
| Current dimension of the accessor. | |
Provides read-write access to NDArray elements.
|
inline |
|
inlinenoexcept |
Assigns a value to the element at the accessor's position.
Asserts the underlying array is mutable: writing through an accessor produced from a read-only borrow is undefined in release and trapped in debug.
| value | The value to be assigned. |
|
inlinenoexcept |