Theoretica
A C++ numerical and automatic mathematical library
|
Operations on datasets. More...
#include <sstream>
#include <ostream>
#include "./core_traits.h"
#include "./constants.h"
#include "./error.h"
Go to the source code of this file.
Namespaces | |
theoretica | |
Main namespace of the library which contains all functions and objects. | |
Functions | |
template<typename Vector , enable_vector< Vector > = true> | |
auto | theoretica::product (const Vector &X) |
Compute the product of a set of values. | |
template<typename Vector > | |
auto | theoretica::product_sum (const Vector &X, const Vector &Y) |
Sum the products of two sets of values. | |
template<typename Vector > | |
auto | theoretica::product_sum_squares (const Vector &X, const Vector &Y) |
Sum the products of the squares of two sets of data. | |
template<typename Vector > | |
auto | theoretica::product_sum (const Vector &X, const Vector &Y, const Vector &Z) |
Sum the products of three sets of values. | |
template<typename Vector > | |
auto | theoretica::quotient_sum (const Vector &X, const Vector &Y) |
Sum the quotients of two sets of values. | |
template<typename Vector > | |
auto | theoretica::sum_squares (const Vector &X) |
Sum the squares of a set of values. | |
template<typename Vector > | |
real | theoretica::sum_compensated (const Vector &X) |
Compute the sum of a set of values using the compensated Neumaier-Kahan-Babushka summation algorithm to reduce round-off error. More... | |
template<typename Vector > | |
real | theoretica::sum_pairwise (const Vector &X, size_t begin=0, size_t end=0, size_t base_size=128) |
Compute the sum of a set of values using pairwise summation to reduce round-off error. More... | |
template<typename Vector , std::enable_if_t< has_real_elements< Vector >::value > = true> | |
auto | theoretica::sum (const Vector &X) |
Compute the sum of a vector of real values using pairwise summation to reduce round-off error. More... | |
template<typename Vector > | |
auto | theoretica::sum (const Vector &X) |
Compute the sum of a set of values. More... | |
template<typename Vector , typename Function > | |
Vector & | theoretica::apply (Function f, Vector &X) |
Apply a function to a set of values element-wise. More... | |
template<typename Vector1 , typename Vector2 = Vector1, typename Function > | |
Vector2 & | theoretica::map (Function f, const Vector1 &src, Vector2 &dest) |
Get a new vector obtained by applying the function element-wise. More... | |
template<typename Vector2 , typename Vector1 , typename Function > | |
Vector2 | theoretica::map (Function f, const Vector1 &X) |
Get a new vector obtained by applying the function element-wise. More... | |
template<typename Vector , typename Function > | |
Vector | theoretica::map (Function f, const Vector &X) |
Get a new vector obtained by applying the function element-wise. More... | |
template<typename Vector1 , typename Vector2 , typename Vector3 = Vector1> | |
Vector3 | theoretica::concatenate (const Vector1 &v1, const Vector2 &v2) |
Concatenate two datasets to form a single one. | |
template<typename Vector > | |
auto | theoretica::max (const Vector &X) |
Finds the maximum value inside a dataset. | |
template<typename Vector > | |
auto | theoretica::min (const Vector &X) |
Finds the minimum value inside a dataset. | |
template<typename Dataset > | |
real | theoretica::arithmetic_mean (const Dataset &data) |
Compute the arithmetic mean of a set of values. | |
template<typename Dataset > | |
real | theoretica::harmonic_mean (const Dataset &data) |
Compute the harmonic mean of a set of values. | |
template<typename Dataset > | |
real | theoretica::geometric_mean (const Dataset &data) |
Compute the geometric mean of a set of values as \(\sqrt[n]{\Pi_i x_i}\). | |
template<typename Dataset1 , typename Dataset2 > | |
real | theoretica::weighted_mean (const Dataset1 &data, const Dataset2 &weights) |
Compute the weighted mean of a set of values <data> and <weights> must have the same size. | |
template<typename Dataset > | |
real | theoretica::quadratic_mean (const Dataset &data) |
Compute the quadratic mean (Root Mean Square) of a set of values \(m_q = \sqrt{x1^2 + x2^2 + ...}\). | |
Operations on datasets.