#include <algorithm>
#include <cmath>
#include <numeric>
#include <ranges>
#include <vector>
Go to the source code of this file.
|
| template<typename T > |
| std::vector< float > | normalize (vector< T > &vec) |
| | Normalizes a vector. Returns a copy of the vector normalized. More...
|
| |
| template<typename T > |
| double | mean (const vector< T > &variables) |
| | Computes the mean value of the given vector. Returns NaN if empty. More...
|
| |
| template<typename T > |
| double | mean (const vector< vector< T >> &matrix) |
| | Computes the mean value of the given matrix. Returns NaN if empty. More...
|
| |
| template<typename T > |
| double | variance (const double &mean, const vector< T > &variables) |
| | Computes the variance of the vector based on the variables and the mean. Returns NaN if empty. More...
|
| |
| template<typename T > |
| double | variance (const double &mean, const vector< vector< T >> &matrix) |
| | Computes the variance of the matrix based on the variables and the mean. Returns NaN if empty. More...
|
| |
| template<typename T > |
| double | standardDev (double mean, const vector< T > &variables) |
| | Computes the Standard Deviation of the vector based on the mean value. Returns NaN if empty. More...
|
| |
| template<typename T > |
| double | standardDev (double mean, const vector< vector< T >> &matrix) |
| | Computes the Standard Deviation of the matrix based on the mean value. Returns NaN if empty. More...
|
| |
| template<typename T > |
| T | median (const std::vector< T > &v) |
| | Computes the median of the vector. Returns NaN if empty. More...
|
| |
- Author
- Alejandro Marrero (amarr.nosp@m.erd@.nosp@m.ull.e.nosp@m.du.e.nosp@m.s)
- Version
- 0.1
- Date
- 2021-06-22
- Copyright
- Copyright (c) 2022
◆ mean() [1/2]
template<typename T >
| double mean |
( |
const vector< T > & |
variables | ) |
|
Computes the mean value of the given vector. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
◆ mean() [2/2]
template<typename T >
| double mean |
( |
const vector< vector< T >> & |
matrix | ) |
|
Computes the mean value of the given matrix. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
◆ median()
template<typename T >
| T median |
( |
const std::vector< T > & |
v | ) |
|
Computes the median of the vector. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
- T
◆ normalize()
template<typename T >
| std::vector<float> normalize |
( |
vector< T > & |
vec | ) |
|
Normalizes a vector. Returns a copy of the vector normalized.
- Template Parameters
-
- Parameters
-
- Returns
- std::vector<T>
◆ standardDev() [1/2]
template<typename T >
| double standardDev |
( |
double |
mean, |
|
|
const vector< T > & |
variables |
|
) |
| |
Computes the Standard Deviation of the vector based on the mean value. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
◆ standardDev() [2/2]
template<typename T >
| double standardDev |
( |
double |
mean, |
|
|
const vector< vector< T >> & |
matrix |
|
) |
| |
Computes the Standard Deviation of the matrix based on the mean value. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
◆ variance() [1/2]
template<typename T >
| double variance |
( |
const double & |
mean, |
|
|
const vector< T > & |
variables |
|
) |
| |
Computes the variance of the vector based on the variables and the mean. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns
◆ variance() [2/2]
template<typename T >
| double variance |
( |
const double & |
mean, |
|
|
const vector< vector< T >> & |
matrix |
|
) |
| |
Computes the variance of the matrix based on the variables and the mean. Returns NaN if empty.
- Template Parameters
-
- Parameters
-
- Returns