Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::NDArray< T, N, L >::BaseAccessor Class Reference

Inner class providing base functionality for element access in NDArray. More...

#include <clustering/ndarray.h>

Inheritance diagram for clustering::NDArray< T, N, L >::BaseAccessor:
[legend]
Collaboration diagram for clustering::NDArray< T, N, L >::BaseAccessor:
[legend]

Public Member Functions

const T * data () const
 Returns a pointer to the element data.

Protected Member Functions

 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

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.

Detailed Description

template<class T, std::size_t N, Layout L = Layout::Contig>
class clustering::NDArray< T, N, L >::BaseAccessor

Inner class providing base functionality for element access in NDArray.

Accessors are produced only by the contiguous instantiation of NDArray; the pointer type is fixed to Layout::Contig so constructing one from a strided array is ill-formed.

Definition at line 157 of file ndarray.h.

Constructor & Destructor Documentation

◆ BaseAccessor()

template<class T, std::size_t N, Layout L = Layout::Contig>
clustering::NDArray< T, N, L >::BaseAccessor::BaseAccessor ( NDArray< T, N, Layout::Contig > * ndarray,
std::size_t index,
std::size_t dim )
inlineprotected

Constructs a BaseAccessor for a given NDArray, index, and dimension.

Parameters
ndarrayPointer to the NDArray.
indexIndex in the flat representation of the array.
dimCurrent dimension of the accessor.

Definition at line 177 of file ndarray.h.

Member Function Documentation

◆ data()

template<class T, std::size_t N, Layout L = Layout::Contig>
const T * clustering::NDArray< T, N, L >::BaseAccessor::data ( ) const
inline

Returns a pointer to the element data.

Returns
Constant pointer to the data.

Definition at line 163 of file ndarray.h.

Member Data Documentation

◆ m_dim

template<class T, std::size_t N, Layout L = Layout::Contig>
std::size_t clustering::NDArray< T, N, L >::BaseAccessor::m_dim
protected

Current dimension of the accessor.

Definition at line 168 of file ndarray.h.

◆ m_index

template<class T, std::size_t N, Layout L = Layout::Contig>
std::size_t clustering::NDArray< T, N, L >::BaseAccessor::m_index
protected

Index in the flat representation of the array.

Definition at line 167 of file ndarray.h.

◆ m_ndarray

template<class T, std::size_t N, Layout L = Layout::Contig>
NDArray<T, N, Layout::Contig>* clustering::NDArray< T, N, L >::BaseAccessor::m_ndarray
protected

Pointer to the NDArray.

Definition at line 166 of file ndarray.h.


The documentation for this class was generated from the following file: