19 #define _VECOPS_USE_EXTERN_TEMPLATES false 21 #define _VECOPS_USE_EXTERN_TEMPLATES true 36 #include <vdt/vdtMath.h> 145 template <
typename T>
148 using Impl_t =
typename std::vector<T, ::ROOT::Detail::VecOps::RAdoptAllocator<T>>;
180 template <
class InputIt>
181 RVec(InputIt
first, InputIt last) : fData(first, last) {}
183 RVec(std::initializer_list<T>
init) : fData(init) {}
205 template <typename U, typename = std::enable_if<std::is_convertible<T, U>::value>>
219 template <typename V, typename = std::enable_if<std::is_convertible<V, bool>::value>>
225 throw std::runtime_error(
"Cannot index RVec with condition vector of different size");
239 T *
data() noexcept {
return fData.data(); }
240 const T *
data() const noexcept {
return fData.data(); }
255 bool empty() const noexcept {
return fData.empty(); }
262 void clear() noexcept { fData.clear(); }
265 void push_back(
T &&value) { fData.push_back(std::forward<T>(value)); }
266 template <
class... Args>
269 fData.emplace_back(std::forward<Args>(args)...);
274 template<typename U = T, typename std::enable_if<std::is_arithmetic<U>::value,
int>* =
nullptr>
277 return fData.emplace(pos, value);
288 #define TVEC_UNARY_OPERATOR(OP) \ 289 template <typename T> \ 290 RVec<T> operator OP(const RVec<T> &v) \ 293 for (auto &x : ret) \ 302 #undef TVEC_UNARY_OPERATOR 308 #define ERROR_MESSAGE(OP) \ 309 "Cannot call operator " #OP " on vectors of different sizes." 311 #define TVEC_BINARY_OPERATOR(OP) \ 312 template <typename T0, typename T1> \ 313 auto operator OP(const RVec<T0> &v, const T1 &y) \ 314 -> RVec<decltype(v[0] OP y)> \ 316 RVec<decltype(v[0] OP y)> ret(v.size()); \ 317 auto op = [&y](const T0 &x) { return x OP y; }; \ 318 std::transform(v.begin(), v.end(), ret.begin(), op); \ 322 template <typename T0, typename T1> \ 323 auto operator OP(const T0 &x, const RVec<T1> &v) \ 324 -> RVec<decltype(x OP v[0])> \ 326 RVec<decltype(x OP v[0])> ret(v.size()); \ 327 auto op = [&x](const T1 &y) { return x OP y; }; \ 328 std::transform(v.begin(), v.end(), ret.begin(), op); \ 332 template <typename T0, typename T1> \ 333 auto operator OP(const RVec<T0> &v0, const RVec<T1> &v1) \ 334 -> RVec<decltype(v0[0] OP v1[0])> \ 336 if (v0.size() != v1.size()) \ 337 throw std::runtime_error(ERROR_MESSAGE(OP)); \ 339 RVec<decltype(v0[0] OP v1[0])> ret(v0.size()); \ 340 auto op = [](const T0 &x, const T1 &y) { return x OP y; }; \ 341 std::transform(v0.begin(), v0.end(), v1.begin(), ret.begin(), op); \ 353 #undef TVEC_BINARY_OPERATOR 359 #define TVEC_ASSIGNMENT_OPERATOR(OP) \ 360 template <typename T0, typename T1> \ 361 RVec<T0>& operator OP(RVec<T0> &v, const T1 &y) \ 363 auto op = [&y](T0 &x) { return x OP y; }; \ 364 std::transform(v.begin(), v.end(), v.begin(), op); \ 368 template <typename T0, typename T1> \ 369 RVec<T0>& operator OP(RVec<T0> &v0, const RVec<T1> &v1) \ 371 if (v0.size() != v1.size()) \ 372 throw std::runtime_error(ERROR_MESSAGE(OP)); \ 374 auto op = [](T0 &x, const T1 &y) { return x OP y; }; \ 375 std::transform(v0.begin(), v0.end(), v1.begin(), v0.begin(), op); \ 389 #undef TVEC_ASSIGNMENT_OPERATOR 395 #define TVEC_LOGICAL_OPERATOR(OP) \ 396 template <typename T0, typename T1> \ 397 auto operator OP(const RVec<T0> &v, const T1 &y) \ 400 RVec<int> ret(v.size()); \ 401 auto op = [y](const T0 &x) -> int { return x OP y; }; \ 402 std::transform(v.begin(), v.end(), ret.begin(), op); \ 406 template <typename T0, typename T1> \ 407 auto operator OP(const T0 &x, const RVec<T1> &v) \ 410 RVec<int> ret(v.size()); \ 411 auto op = [x](const T1 &y) -> int { return x OP y; }; \ 412 std::transform(v.begin(), v.end(), ret.begin(), op); \ 416 template <typename T0, typename T1> \ 417 auto operator OP(const RVec<T0> &v0, const RVec<T1> &v1) \ 420 if (v0.size() != v1.size()) \ 421 throw std::runtime_error(ERROR_MESSAGE(OP)); \ 423 RVec<int> ret(v0.size()); \ 424 auto op = [](const T0 &x, const T1 &y) -> int { return x OP y; }; \ 425 std::transform(v0.begin(), v0.end(), v1.begin(), ret.begin(), op); \ 437 #undef TVEC_LOGICAL_OPERATOR 451 template <
typename T>
454 template <
typename U,
typename V>
457 #define TVEC_UNARY_FUNCTION(NAME, FUNC) \ 458 template <typename T> \ 459 RVec<PromoteType<T>> NAME(const RVec<T> &v) \ 461 RVec<PromoteType<T>> ret(v.size()); \ 462 auto f = [](const T &x) { return FUNC(x); }; \ 463 std::transform(v.begin(), v.end(), ret.begin(), f); \ 467 #define TVEC_BINARY_FUNCTION(NAME, FUNC) \ 468 template <typename T0, typename T1> \ 469 RVec<PromoteTypes<T0, T1>> NAME(const T0 &x, const RVec<T1> &v) \ 471 RVec<PromoteTypes<T0, T1>> ret(v.size()); \ 472 auto f = [&x](const T1 &y) { return FUNC(x, y); }; \ 473 std::transform(v.begin(), v.end(), ret.begin(), f); \ 477 template <typename T0, typename T1> \ 478 RVec<PromoteTypes<T0, T1>> NAME(const RVec<T0> &v, const T1 &y) \ 480 RVec<PromoteTypes<T0, T1>> ret(v.size()); \ 481 auto f = [&y](const T1 &x) { return FUNC(x, y); }; \ 482 std::transform(v.begin(), v.end(), ret.begin(), f); \ 486 template <typename T0, typename T1> \ 487 RVec<PromoteTypes<T0, T1>> NAME(const RVec<T0> &v0, const RVec<T1> &v1) \ 489 if (v0.size() != v1.size()) \ 490 throw std::runtime_error(ERROR_MESSAGE(NAME)); \ 492 RVec<PromoteTypes<T0, T1>> ret(v0.size()); \ 493 auto f = [](const T0 &x, const T1 &y) { return FUNC(x, y); }; \ 494 std::transform(v0.begin(), v0.end(), v1.begin(), ret.begin(), f); \ 498 #define TVEC_STD_UNARY_FUNCTION(F) TVEC_UNARY_FUNCTION(F, std::F) 499 #define TVEC_STD_BINARY_FUNCTION(F) TVEC_BINARY_FUNCTION(F, std::F) 546 #undef TVEC_STD_UNARY_FUNCTION 553 #define TVEC_VDT_UNARY_FUNCTION(F) TVEC_UNARY_FUNCTION(F, vdt::F) 555 TVEC_VDT_UNARY_FUNCTION(fast_expf)
556 TVEC_VDT_UNARY_FUNCTION(fast_logf)
557 TVEC_VDT_UNARY_FUNCTION(fast_sinf)
558 TVEC_VDT_UNARY_FUNCTION(fast_cosf)
559 TVEC_VDT_UNARY_FUNCTION(fast_tanf)
560 TVEC_VDT_UNARY_FUNCTION(fast_asinf)
561 TVEC_VDT_UNARY_FUNCTION(fast_acosf)
562 TVEC_VDT_UNARY_FUNCTION(fast_atanf)
564 TVEC_VDT_UNARY_FUNCTION(fast_exp)
565 TVEC_VDT_UNARY_FUNCTION(fast_log)
566 TVEC_VDT_UNARY_FUNCTION(fast_sin)
567 TVEC_VDT_UNARY_FUNCTION(fast_cos)
568 TVEC_VDT_UNARY_FUNCTION(fast_tan)
569 TVEC_VDT_UNARY_FUNCTION(fast_asin)
570 TVEC_VDT_UNARY_FUNCTION(fast_acos)
571 TVEC_VDT_UNARY_FUNCTION(fast_atan)
572 #undef TVEC_VDT_UNARY_FUNCTION 576 #undef TVEC_UNARY_FUNCTION 581 template <
typename T,
typename V>
584 if (v0.size() != v1.size())
585 throw std::runtime_error(
"Cannot compute inner product of vectors of different sizes");
586 return std::inner_product(v0.begin(), v0.end(), v1.begin(), decltype(v0[0] * v1[0])(0));
590 template <
typename T>
593 return std::accumulate(v.
begin(), v.
end(),
T(0));
597 template <
typename T>
600 if (v.
empty())
return 0.;
601 return double(
Sum(v)) / v.
size();
605 template <
typename T>
609 if (size < std::size_t(2))
return 0.;
610 T sum_squares(0), squared_sum(0);
611 auto pred = [&sum_squares, &squared_sum](
const T&
x) {sum_squares+=
x*
x; squared_sum+=
x;};
612 std::for_each(v.
begin(), v.
end(), pred);
613 squared_sum *= squared_sum;
614 const auto dsize = (double) size;
615 return 1. / (dsize - 1.) * (sum_squares - squared_sum / dsize );
619 template <
typename T>
626 template <
typename T,
typename F>
630 std::transform(
v.begin(),
v.end(), ret.begin(),
f);
635 template <
typename T,
typename F>
638 const auto thisSize = v.
size();
641 for (
auto &&val : v) {
648 template <
typename T>
657 std::ostream &operator<<(std::ostream &os, const RVec<T> &
v)
660 constexpr
bool mustConvert = std::is_same<char, T>::value || std::is_same<signed char, T>::value ||
661 std::is_same<unsigned char, T>::value || std::is_same<wchar_t, T>::value ||
662 std::is_same<char16_t, T>::value || std::is_same<char32_t, T>::value;
665 auto size =
v.size();
667 for (std::size_t i = 0; i <
size - 1; ++i) {
668 os << (Print_t)
v[i] <<
", ";
670 os << (Print_t)
v[size - 1];
676 #if (_VECOPS_USE_EXTERN_TEMPLATES) 678 #define TVEC_EXTERN_UNARY_OPERATOR(T, OP) \ 679 extern template RVec<T> operator OP<T>(const RVec<T> &); 681 #define TVEC_EXTERN_BINARY_OPERATOR(T, OP) \ 682 extern template auto operator OP<T, T>(const T &x, const RVec<T> &v) \ 683 -> RVec<decltype(x OP v[0])>; \ 684 extern template auto operator OP<T, T>(const RVec<T> &v, const T &y) \ 685 -> RVec<decltype(v[0] OP y)>; \ 686 extern template auto operator OP<T, T>(const RVec<T> &v0, const RVec<T> &v1)\ 687 -> RVec<decltype(v0[0] OP v1[0])>; 689 #define TVEC_EXTERN_ASSIGN_OPERATOR(T, OP) \ 690 extern template RVec<T> &operator OP<T, T>(RVec<T> &, const T &); \ 691 extern template RVec<T> &operator OP<T, T>(RVec<T> &, const RVec<T> &); 693 #define TVEC_EXTERN_LOGICAL_OPERATOR(T, OP) \ 694 extern template RVec<int> operator OP<T, T>(const RVec<T> &, const T &); \ 695 extern template RVec<int> operator OP<T, T>(const T &, const RVec<T> &); \ 696 extern template RVec<int> operator OP<T, T>(const RVec<T> &, const RVec<T> &); 698 #define TVEC_EXTERN_FLOAT_TEMPLATE(T) \ 699 extern template class RVec<T>; \ 700 TVEC_EXTERN_UNARY_OPERATOR(T, +) \ 701 TVEC_EXTERN_UNARY_OPERATOR(T, -) \ 702 TVEC_EXTERN_UNARY_OPERATOR(T, !) \ 703 TVEC_EXTERN_BINARY_OPERATOR(T, +) \ 704 TVEC_EXTERN_BINARY_OPERATOR(T, -) \ 705 TVEC_EXTERN_BINARY_OPERATOR(T, *) \ 706 TVEC_EXTERN_BINARY_OPERATOR(T, /) \ 707 TVEC_EXTERN_ASSIGN_OPERATOR(T, +=) \ 708 TVEC_EXTERN_ASSIGN_OPERATOR(T, -=) \ 709 TVEC_EXTERN_ASSIGN_OPERATOR(T, *=) \ 710 TVEC_EXTERN_ASSIGN_OPERATOR(T, /=) \ 711 TVEC_EXTERN_LOGICAL_OPERATOR(T, <) \ 712 TVEC_EXTERN_LOGICAL_OPERATOR(T, >) \ 713 TVEC_EXTERN_LOGICAL_OPERATOR(T, ==) \ 714 TVEC_EXTERN_LOGICAL_OPERATOR(T, !=) \ 715 TVEC_EXTERN_LOGICAL_OPERATOR(T, <=) \ 716 TVEC_EXTERN_LOGICAL_OPERATOR(T, >=) \ 717 TVEC_EXTERN_LOGICAL_OPERATOR(T, &&) \ 718 TVEC_EXTERN_LOGICAL_OPERATOR(T, ||) 720 #define TVEC_EXTERN_INTEGER_TEMPLATE(T) \ 721 extern template class RVec<T>; \ 722 TVEC_EXTERN_UNARY_OPERATOR(T, +) \ 723 TVEC_EXTERN_UNARY_OPERATOR(T, -) \ 724 TVEC_EXTERN_UNARY_OPERATOR(T, ~) \ 725 TVEC_EXTERN_UNARY_OPERATOR(T, !) \ 726 TVEC_EXTERN_BINARY_OPERATOR(T, +) \ 727 TVEC_EXTERN_BINARY_OPERATOR(T, -) \ 728 TVEC_EXTERN_BINARY_OPERATOR(T, *) \ 729 TVEC_EXTERN_BINARY_OPERATOR(T, /) \ 730 TVEC_EXTERN_BINARY_OPERATOR(T, %) \ 731 TVEC_EXTERN_BINARY_OPERATOR(T, &) \ 732 TVEC_EXTERN_BINARY_OPERATOR(T, |) \ 733 TVEC_EXTERN_BINARY_OPERATOR(T, ^) \ 734 TVEC_EXTERN_ASSIGN_OPERATOR(T, +=) \ 735 TVEC_EXTERN_ASSIGN_OPERATOR(T, -=) \ 736 TVEC_EXTERN_ASSIGN_OPERATOR(T, *=) \ 737 TVEC_EXTERN_ASSIGN_OPERATOR(T, /=) \ 738 TVEC_EXTERN_ASSIGN_OPERATOR(T, %=) \ 739 TVEC_EXTERN_ASSIGN_OPERATOR(T, &=) \ 740 TVEC_EXTERN_ASSIGN_OPERATOR(T, |=) \ 741 TVEC_EXTERN_ASSIGN_OPERATOR(T, ^=) \ 742 TVEC_EXTERN_ASSIGN_OPERATOR(T, >>=) \ 743 TVEC_EXTERN_ASSIGN_OPERATOR(T, <<=) \ 744 TVEC_EXTERN_LOGICAL_OPERATOR(T, <) \ 745 TVEC_EXTERN_LOGICAL_OPERATOR(T, >) \ 746 TVEC_EXTERN_LOGICAL_OPERATOR(T, ==) \ 747 TVEC_EXTERN_LOGICAL_OPERATOR(T, !=) \ 748 TVEC_EXTERN_LOGICAL_OPERATOR(T, <=) \ 749 TVEC_EXTERN_LOGICAL_OPERATOR(T, >=) \ 750 TVEC_EXTERN_LOGICAL_OPERATOR(T, &&) \ 751 TVEC_EXTERN_LOGICAL_OPERATOR(T, ||) 753 TVEC_EXTERN_INTEGER_TEMPLATE(
char)
754 TVEC_EXTERN_INTEGER_TEMPLATE(
short)
755 TVEC_EXTERN_INTEGER_TEMPLATE(
int)
756 TVEC_EXTERN_INTEGER_TEMPLATE(
long)
759 TVEC_EXTERN_INTEGER_TEMPLATE(
unsigned char)
760 TVEC_EXTERN_INTEGER_TEMPLATE(
unsigned short)
761 TVEC_EXTERN_INTEGER_TEMPLATE(
unsigned int)
762 TVEC_EXTERN_INTEGER_TEMPLATE(
unsigned long)
765 TVEC_EXTERN_FLOAT_TEMPLATE(
float)
766 TVEC_EXTERN_FLOAT_TEMPLATE(
double)
768 #undef TVEC_EXTERN_UNARY_OPERATOR 769 #undef TVEC_EXTERN_BINARY_OPERATOR 770 #undef TVEC_EXTERN_ASSIGN_OPERATOR 771 #undef TVEC_EXTERN_LOGICAL_OPERATOR 772 #undef TVEC_EXTERN_INTEGER_TEMPLATE 773 #undef TVEC_EXTERN_FLOAT_TEMPLATE 775 #define TVEC_EXTERN_UNARY_FUNCTION(T, NAME, FUNC) \ 776 extern template RVec<PromoteType<T>> NAME(const RVec<T> &); 778 #define TVEC_EXTERN_STD_UNARY_FUNCTION(T, F) TVEC_EXTERN_UNARY_FUNCTION(T, F, std::F) 780 #define TVEC_EXTERN_BINARY_FUNCTION(T0, T1, NAME, FUNC) \ 781 extern template RVec<PromoteTypes<T0, T1>> NAME(const RVec<T0> &, const T1 &); \ 782 extern template RVec<PromoteTypes<T0, T1>> NAME(const T0 &, const RVec<T1> &); \ 783 extern template RVec<PromoteTypes<T0, T1>> NAME(const RVec<T0> &, const RVec<T1> &); 785 #define TVEC_EXTERN_STD_BINARY_FUNCTION(T, F) TVEC_EXTERN_BINARY_FUNCTION(T, T, F, std::F) 787 #define TVEC_EXTERN_STD_FUNCTIONS(T) \ 788 TVEC_EXTERN_STD_UNARY_FUNCTION(T, abs) \ 789 TVEC_EXTERN_STD_BINARY_FUNCTION(T, fdim) \ 790 TVEC_EXTERN_STD_BINARY_FUNCTION(T, fmod) \ 791 TVEC_EXTERN_STD_BINARY_FUNCTION(T, remainder) \ 792 TVEC_EXTERN_STD_UNARY_FUNCTION(T, exp) \ 793 TVEC_EXTERN_STD_UNARY_FUNCTION(T, exp2) \ 794 TVEC_EXTERN_STD_UNARY_FUNCTION(T, expm1) \ 795 TVEC_EXTERN_STD_UNARY_FUNCTION(T, log) \ 796 TVEC_EXTERN_STD_UNARY_FUNCTION(T, log10) \ 797 TVEC_EXTERN_STD_UNARY_FUNCTION(T, log2) \ 798 TVEC_EXTERN_STD_UNARY_FUNCTION(T, log1p) \ 799 TVEC_EXTERN_STD_BINARY_FUNCTION(T, pow) \ 800 TVEC_EXTERN_STD_UNARY_FUNCTION(T, sqrt) \ 801 TVEC_EXTERN_STD_UNARY_FUNCTION(T, cbrt) \ 802 TVEC_EXTERN_STD_BINARY_FUNCTION(T, hypot) \ 803 TVEC_EXTERN_STD_UNARY_FUNCTION(T, sin) \ 804 TVEC_EXTERN_STD_UNARY_FUNCTION(T, cos) \ 805 TVEC_EXTERN_STD_UNARY_FUNCTION(T, tan) \ 806 TVEC_EXTERN_STD_UNARY_FUNCTION(T, asin) \ 807 TVEC_EXTERN_STD_UNARY_FUNCTION(T, acos) \ 808 TVEC_EXTERN_STD_UNARY_FUNCTION(T, atan) \ 809 TVEC_EXTERN_STD_BINARY_FUNCTION(T, atan2) \ 810 TVEC_EXTERN_STD_UNARY_FUNCTION(T, sinh) \ 811 TVEC_EXTERN_STD_UNARY_FUNCTION(T, cosh) \ 812 TVEC_EXTERN_STD_UNARY_FUNCTION(T, tanh) \ 813 TVEC_EXTERN_STD_UNARY_FUNCTION(T, asinh) \ 814 TVEC_EXTERN_STD_UNARY_FUNCTION(T, acosh) \ 815 TVEC_EXTERN_STD_UNARY_FUNCTION(T, atanh) \ 816 TVEC_EXTERN_STD_UNARY_FUNCTION(T, floor) \ 817 TVEC_EXTERN_STD_UNARY_FUNCTION(T, ceil) \ 818 TVEC_EXTERN_STD_UNARY_FUNCTION(T, trunc) \ 819 TVEC_EXTERN_STD_UNARY_FUNCTION(T, round) \ 820 TVEC_EXTERN_STD_UNARY_FUNCTION(T, erf) \ 821 TVEC_EXTERN_STD_UNARY_FUNCTION(T, erfc) \ 822 TVEC_EXTERN_STD_UNARY_FUNCTION(T, lgamma) \ 823 TVEC_EXTERN_STD_UNARY_FUNCTION(T, tgamma) \ 825 TVEC_EXTERN_STD_FUNCTIONS(
float)
826 TVEC_EXTERN_STD_FUNCTIONS(
double)
827 #undef TVEC_EXTERN_STD_UNARY_FUNCTION 828 #undef TVEC_EXTERN_STD_BINARY_FUNCTION 829 #undef TVEC_EXTERN_STD_UNARY_FUNCTIONS 833 #define TVEC_EXTERN_VDT_UNARY_FUNCTION(T, F) TVEC_EXTERN_UNARY_FUNCTION(T, F, vdt::F) 835 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_expf)
836 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_logf)
837 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_sinf)
838 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_cosf)
839 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_tanf)
840 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_asinf)
841 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_acosf)
842 TVEC_EXTERN_VDT_UNARY_FUNCTION(
float, fast_atanf)
844 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_exp)
845 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_log)
846 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_sin)
847 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_cos)
848 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_tan)
849 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_asin)
850 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_acos)
851 TVEC_EXTERN_VDT_UNARY_FUNCTION(
double, fast_atan)
855 #endif // _VECOPS_USE_EXTERN_TEMPLATES
#define TVEC_STD_BINARY_FUNCTION(F)
double erf(double x)
Error function encountered in integrating the normal distribution.
void resize(size_type count)
typename Impl_t::difference_type difference_type
Namespace for new ROOT classes and functions.
auto Map(const RVec< T > &v, F &&f) -> RVec< decltype(f(v[0]))>
Create new collection applying a callable to the elements of the input collection.
const_reference back() const
typename Impl_t::const_reverse_iterator const_reverse_iterator
void push_back(T &&value)
RVec< T > & operator=(std::initializer_list< T > ilist)
const T * data() const noexcept
#define TVEC_ASSIGNMENT_OPERATOR(OP)
const_iterator cend() const noexcept
const_reverse_iterator crend() const noexcept
typename Impl_t::const_reference const_reference
double inner_product(const LAVector &, const LAVector &)
iterator begin() noexcept
#define TVEC_LOGICAL_OPERATOR(OP)
void swap(RVec< T > &lhs, RVec< T > &rhs)
double Var(const RVec< T > &v)
Get variance.
double tgamma(double x)
The gamma function is defined to be the extension of the factorial to real numbers.
const_iterator cbegin() const noexcept
double erfc(double x)
Complementary error function.
bool empty() const noexcept
RVec< T > & operator=(RVec< T > &&v)
typename std::vector< ColumnValue_t, ::ROOT::Detail::VecOps::RAdoptAllocator< ColumnValue_t > > Impl_t
size_type size() const noexcept
RVec operator[](const RVec< V > &conds) const
size_type max_size() const noexcept
typename Impl_t::size_type size_type
double pow(double, double)
typename Impl_t::reverse_iterator reverse_iterator
void reserve(size_type new_cap)
iterator erase(iterator first, iterator last)
RVec< T > & operator=(const RVec< T > &v)
RVec< T > Filter(const RVec< T > &v, F &&f)
Create a new collection with the elements passing the filter expressed by the predicate.
A "std::vector"-like collection of values implementing handy operation to analyse them...
typename Impl_t::const_pointer const_pointer
#define TVEC_BINARY_OPERATOR(OP)
double Mean(const RVec< T > &v)
Get Mean.
size_type capacity() const noexcept
iterator emplace(const_iterator pos, U value)
This method is intended only for arithmetic types unlike the std::vector corresponding one which is g...
const_reference front() const
const_reverse_iterator rbegin() const noexcept
const_reverse_iterator crbegin() const noexcept
void resize(size_type count, const value_type &value)
RVec(std::initializer_list< T > init)
#define TVEC_UNARY_OPERATOR(OP)
double expm1(double x)
exp(x) -1 with error cancellation when x is small
const_iterator end() const noexcept
#define TVEC_STD_UNARY_FUNCTION(F)
reference operator[](size_type pos)
RVec(size_type count, const T &value)
reference emplace_back(Args &&... args)
double log1p(double x)
declarations for functions which are not implemented by some compilers
typename Impl_t::pointer pointer
decltype(PromoteType< U >()+PromoteType< V >()) PromoteTypes
double StdDev(const RVec< T > &v)
Get standard deviation.
double atan2(double, double)
auto Dot(const RVec< T > &v0, const RVec< V > &v1) -> decltype(v0[0] *v1[0])
Inner product.
typename Impl_t::reference reference
reverse_iterator rbegin() noexcept
const_iterator begin() const noexcept
T Sum(const RVec< T > &v)
Sum elements.
const_reference operator[](size_type pos) const
reverse_iterator rend() noexcept
typename PromoteTypeImpl< T >::Type PromoteType
RVec(InputIt first, InputIt last)
iterator erase(iterator pos)
RVec(const std::vector< T > &v)
const_reference at(size_type pos) const
void swap(RVec< T > &other)
typename Impl_t::value_type value_type
double lgamma(double x)
Calculates the logarithm of the gamma function.
const_reverse_iterator rend() const noexcept
typename Impl_t::iterator iterator
RVec(pointer p, size_type n)
reference at(size_type pos)
typename Impl_t::const_iterator const_iterator