Template Class LaneQuantizer

Class Documentation

template<class T, class Arch = xsimd::default_arch>
class LaneQuantizer

One 1D fit’s leaf-table quantize with its constants hoisted into registers. ids(x) and in_domain(x) classify a batch of points lane for lane identical to Function::leaf_id, so a caller fusing several regimes folds the lanes with xsimd::select while they are still in registers — branchless whatever a compiler makes of the scalar ternary. Precondition supports(f): one subtree with a live leaf table (assert- guarded in the constructor). xsimd only: every ISA xsimd targets runs it.

Public Types

using batch_type = xsimd::batch<T, Arch>
using mask_type = typename batch_type::batch_bool_type
using id_type = xsimd::as_integer_t<T>
using id_batch_type = xsimd::batch<id_type, Arch>

Public Functions

template<class F>
inline explicit LaneQuantizer(const F &f)
inline explicit LaneQuantizer(const detail::QuantizeView<T, 1> &v)
inline mask_type in_domain(batch_type x) const noexcept

lower <= x <= upper per lane; NaN and ±Inf fail (positive logic).

inline id_batch_type ids(batch_type x) const noexcept

Leaf id per lane. An out-of-domain lane reads a clamped, valid table entry — mask it with in_domain.

Public Static Functions

template<class F>
static inline bool supports(const F &f)