RankedSelector.hpp

Selector that picks the N best matches within a threshold.

namespace statics
template<typename ThreshRatio = std::ratio<-1, 1>, size_t N = 1>
struct RankedSelector
#include <RankedSelector.hpp>

Returns top N matches within the threshold ThreshRatio.

Public Types

using res_t = SmallVector<size_t, 1>

Public Static Functions

static inline res_t select_partition(const vector<float> &scores)
static inline res_t select_traverse(const vector<float> &scores)
static inline res_t select_pick(const vector<float> &scores)
static inline res_t select(const vector<float> &scores)

Public Static Attributes

static constexpr float thresh = (ThreshRatio::num < 0 ? std::numeric_limits<float>::infinity() : static_cast<float>(ThreshRatio::num) / static_cast<float>(ThreshRatio::den))