template struct nanoflann::L2_AdaptorΒΆ

Squared Euclidean distance functor (generic version, optimized for high-dimensionality data sets).

Corresponding distance traits: nanoflann::metric_L2

Parameters:

T

Type of the elements (e.g. double, float, uint8_t)

_DistanceType

Type of distance variables (must be signed) (e.g. float, double, int64_t)

#include <nanoflann.hpp>

template <class T, class DataSource, typename _DistanceType = T>
struct L2_Adaptor
{
    // typedefs

    typedef T ElementType;
    typedef _DistanceType DistanceType;

    //
fields

    const DataSource& data_source;

    // construction

    L2_Adaptor(const DataSource& _data_source);

    //
methods

    DistanceType operator () (
        const T* a,
        const size_t b_idx,
        size_t size,
        DistanceType worst_dist = -1
        ) const;

    template <typename U, typename V>
    DistanceType accum_dist(
        const U a,
        const V b,
        int
        ) const;
};