|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
unsigned int | Rivet::count (const CONTAINER &c) |
| Return number of true elements in the container c .
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
unsigned int | Rivet::count (const CONTAINER &c, const FN &f) |
| Return number of elements in the container c for which f(x) is true.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::any (const CONTAINER &c) |
| Return true if x is true for any x in container c, otherwise false.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::any (const CONTAINER &c, const FN &f) |
| Return true if f(x) is true for any x in container c, otherwise false.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::all (const CONTAINER &c) |
| Return true if x is true for all x in container c, otherwise false.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::all (const CONTAINER &c, const FN &f) |
| Return true if f(x) is true for all x in container c, otherwise false.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::none (const CONTAINER &c) |
| Return true if x is false for all x in container c, otherwise false.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
bool | Rivet::none (const CONTAINER &c, const FN &f) |
| Return true if f(x) is false for all x in container c, otherwise false.
|
|
template<typename CONTAINER1 , typename CONTAINER2 , typename FN = typename std::decay_t<CONTAINER2>::value_type( const typename std::decay_t<CONTAINER1>::value_type::ParticleBase&), typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER1>> && is_citerable_v<std::decay_t<CONTAINER2>> >> |
const CONTAINER2 & | Rivet::transform (const CONTAINER1 &in, CONTAINER2 &out, FN &&f) |
|
template<typename CONTAINER1 , typename RTN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER1>> >> |
std::vector< RTN > | Rivet::transform (const CONTAINER1 &in, const std::function< RTN(typename CONTAINER1::value_type::ParticleBase)> &f) |
|
template<typename CONTAINER1 , typename T , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER1>> >> |
T | Rivet::accumulate (const CONTAINER1 &in, const T &init, const FN &f) |
| A single-container-arg version of std::accumulate, aka reduce .
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER::value_type | Rivet::sum (const CONTAINER &c) |
| Generic sum function, adding x for all x in container c.
|
|
template<typename CONTAINER , typename T , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
T | Rivet::sum (const CONTAINER &c, const T &start) |
|
template<typename CONTAINER , typename T , typename FN = T(const typename std::decay_t<CONTAINER>::value_type&), typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
T | Rivet::sum (CONTAINER &&c, FN &&fn, const T &start=T()) |
| Generic sum function, adding fn(x ) for all x in container c, starting with start.
|
|
template<typename CONTAINER , typename T , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
T & | Rivet::isum (const CONTAINER &c, T &out) |
|
template<typename CONTAINER , typename FN , typename T , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
T & | Rivet::isum (const CONTAINER &c, const FN &f, T &out) |
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::idiscard (CONTAINER &c, const FN &f) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::idiscard (CONTAINER &c, const typename CONTAINER::value_type &y) |
| Version with element-equality comparison in place of a function.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::idiscard_if_any (CONTAINER &c, const CONTAINER &ys) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::discard (const CONTAINER &c, const FN &f) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::discard (const CONTAINER &c, const typename CONTAINER::value_type &y) |
| Version with element-equality comparison in place of a function.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::discard_if_any (const CONTAINER &c, const CONTAINER &ys) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::discard (const CONTAINER &c, const FN &f, CONTAINER &out) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::discard (const CONTAINER &c, const typename CONTAINER::value_type &y, CONTAINER &out) |
| Version with element-equality comparison in place of a function.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::discard_if_any (const CONTAINER &c, const CONTAINER &ys, CONTAINER &out) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::iselect (CONTAINER &c, const FN &f) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::iselect_if_any (CONTAINER &c, const CONTAINER &ys) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::select (const CONTAINER &c, const FN &f) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::select_if_any (const CONTAINER &c, const CONTAINER &ys) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename FN , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::select (const CONTAINER &c, const FN &f, CONTAINER &out) |
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER & | Rivet::select_if_any (const CONTAINER &c, const CONTAINER &ys, CONTAINER &out) |
| Version with several element-equality comparisons in place of a function.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::slice (const CONTAINER &c, int i, int j) |
| Slice of the container elements cf. Python's [i:j] syntax.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::slice (const CONTAINER &c, int i) |
| Tail slice of the container elements cf. Python's [i:] syntax.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::head (const CONTAINER &c, int n) |
| Head slice of the n first container elements.
|
|
template<typename CONTAINER , typename = std::enable_if_t< is_citerable_v<std::decay_t<CONTAINER>> >> |
CONTAINER | Rivet::tail (const CONTAINER &c, int n) |
| Tail slice of the n last container elements.
|
|
double | Rivet::min (const vector< double > &in, double errval=DBL_NAN) |
| Find the minimum value in the vector.
|
|
double | Rivet::max (const vector< double > &in, double errval=DBL_NAN) |
| Find the maximum value in the vector.
|
|
pair< double, double > | Rivet::minmax (const vector< double > &in, double errval=DBL_NAN) |
| Find the minimum and maximum values in the vector.
|
|
int | Rivet::min (const vector< int > &in, int errval=-1) |
| Find the minimum value in the vector.
|
|
int | Rivet::max (const vector< int > &in, int errval=-1) |
| Find the maximum value in the vector.
|
|
pair< int, int > | Rivet::minmax (const vector< int > &in, int errval=-1) |
| Find the minimum and maximum values in the vector.
|
|