namespace measure

Summary

Members Descriptions
namespaceaggregate Namespace that contains aggregate-related functions and traits
template <typename Fn> auto measureEach(const Fn& f) Converts a single-input measure into a set measure that applies the original measure to each element of the input set
template <typename Fn, typename Aggr> auto measureEachAggregate(const Fn& f, const Aggr& aggr) Converts a single-input measure into a set measure that applies the original measure to each element of the input set and then aggregates the output.
template <typename S, typename M> auto selectorMeasureCompose(const S& selector, const M& measure) Creates a new measure as result of the composition of the selector and the measure (M o S). Types and arity must match
template <typename... Measures> auto createMeasureTuple(const Measures&... measures ) Creates a measure that applies several measures to the same input and returns their result in a tuple
template <typename F> struct measure_func_traits Measure function traits. Extracts input type, input arity and output type.

Members

public template<typename Fn>
auto measureEach(const Fn& f)

Convert a single-input measure into a set measure that applies the original measure to each element of the input set

Parameters

  • f Original single-input measure

Returns

Set input measure


public template<typename Fn, typename Aggr>
auto measureEachAggregate(const Fn& f, const Aggr& aggr)

Converts a single-input measure into a set measure that applies the original measure to each element of the input set and then aggregates the output.

Parameters

  • f Original single-input measure

  • aggr Aggregator function

Returns

Set-input - aggregated output measure


public template<typename S, typename M>
auto selectorMeasureCompose(const S& selector, const M& measure)

Creates a new measure as result of the composition of the selector and the measure (M o S). Types and arity must match

Parameters

  • selector Selector

  • measure Measure

Returns

Composed measure


public template<typename... Measures>
auto createMeasureTuple(const Measures&... measures )

Creates a measure that applies several measures to the same input and returns their result in a tuple

Parameters

  • measures Measures to combine in the tuple

Returns

Measure with same input and tuple output


Trait measure_func_traits<F>

Measure function traits. Extracts input type, input arity and output type.

template <typename F> struct measure_func_traits {  
  using base_traits = neurostr::traits::function_traits<F>;

  constexpr static bool in_set = (base_traits::arity > 1);
  using out_type = typename base_traits::result_type;

  using base_in_type = typename std::remove_reference_t<
                          typename base_traits::template arg<0>>;
  using in_type = typename detail::type_chooser<in_set, base_in_type>::type;
};

namespace aggregate

Summary

Members Descriptions
structaggr_func_traits Aggregator function traits. Extracts input and output types

Members

Trait structaggr_func_traits

Aggregator function traits. Extracts input and output types from the F function

template <typename F> struct aggr_func_traits {

  using base_traits = neurostr::traits::function_traits<F>;

  using out_type = typename base_traits::result_type;
  using base_in_type = typename std::remove_const_t<std::remove_reference_t<
                          typename base_traits::template arg<0>>>;
  using in_type = typename base_in_type::value_type;
};

Prebuilt Measure & Aggregate Functions

Go to the prebuilt function section