scicpp::trapz

Defined in header <scicpp/core.hpp>

Integrate using the trapezoidal rule.


template<class InputIt>
constexpr T trapz(InputIt first, InputIt last, T dx)

Integrate over the elements between a pair of iterators.

dx:Integration step (spacing between sample points).

template<typename T, std::size_t N>
constexpr T trapz(const std::array<T, N> &f, T dx)

Integrate over the elements in a std::array.


template<typename T>
constexpr T trapz(const std::vector<T> &f, T dx)

Integrate over the elements in a std::vector.


See also
Scipy documentation