Distance parameters

template<std::size_t Ndim>
class DistanceParameter

A class that encapsulates distance parameters for the clustering algorithm. It can represent either a uniform distance across all dimensions or dimension-specific distances.

Public Functions

inline constexpr DistanceParameter(float radius)

Construct a DistanceParameter with the same threshold for all dimensions.

Note

This constructor initializes all dimensions with the same distance value.

Parameters:
float radius

The distance threshold to be applied uniformly across all dimensions.

inline constexpr DistanceParameter(std::array<float, Ndim> distances)

Construct a DistanceParameter with dimension-specific distances.

Note

This constructor allows for specifying different distance values for each dimension.

Parameters:
std::array<float, Ndim> distances

An array containing the distance thresholds for each dimension.

template<std::floating_point... TDistances>
inline constexpr DistanceParameter(TDistances... distances)

Construct a DistanceParameter with dimension-specific distances.

Note

This constructor allows for specifying different distance values for each dimension.

Template Parameters:
std::floating_point... TDistances

A parameter pack representing the distance thresholds for each dimension.

Parameters:
TDistances... distances

The distance thresholds for each dimension.

inline const auto &operator[](std::size_t dim) const

Access the distance parameter for a specific dimension.

Parameters:
std::size_t dim

The dimension index for which to retrieve the distance parameter.

Returns:

A reference to the distance parameter for the specified dimension.

inline auto &operator[](std::size_t dim)

Access the distance parameter for a specific dimension.

Parameters:
std::size_t dim

The dimension index for which to retrieve the distance parameter.

Returns:

A reference to the distance parameter for the specified dimension.