Static numerical utility functions.
More...
#include <numerics.h>
|
| static int | gcd (int iA, int iB) |
| static bool | issparse (Eigen::VectorXd &v) |
| static int | nchoose2 (int n) |
| static Eigen::MatrixXd | rescale (const Eigen::MatrixXd &data, const Eigen::RowVectorXf ×, const QPair< float, float > &baseline, QString mode) |
| static Eigen::MatrixXd | rescale (const Eigen::MatrixXd &data, const Eigen::RowVectorXf ×, const std::pair< float, float > &baseline, const std::string &mode) |
| template<typename T> |
| static double | log2 (const T d) |
| template<typename T> |
| static void | histcounts (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matRawData, bool bMakeSymmetrical, int iClassAmount, Eigen::VectorXd &vecResultClassLimits, Eigen::VectorXi &vecResultFrequency, double dGlobalMin=0.0, double dGlobalMax=0.0) |
| template<typename T> |
| static void | histcounts (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &matRawData, bool bMakeSymmetrical, int iClassAmount, Eigen::VectorXd &vecResultClassLimits, Eigen::VectorXi &vecResultFrequency, double dGlobalMin=0.0, double dGlobalMax=0.0) |
| template<typename T> |
| static void | histcounts (const Eigen::Matrix< T, 1, Eigen::Dynamic > &matRawData, bool bMakeSymmetrical, int iClassAmount, Eigen::VectorXd &vecResultClassLimits, Eigen::VectorXi &vecResultFrequency, double dGlobalMin=0.0, double dGlobalMax=0.0) |
Static numerical utility functions.
General numerical utility functions: GCD, log2, histograms, baseline rescaling, etc.
Definition at line 73 of file numerics.h.
◆ ~Numerics()
| UTILSLIB::Numerics::~Numerics |
( |
| ) |
|
|
default |
◆ gcd()
| int Numerics::gcd |
( |
int | iA, |
|
|
int | iB ) |
|
static |
Finds the Greatest Common Divisor (GCD) of two integer values.
- Parameters
-
| [in] | iA | First input integer. |
| [in] | iB | Second input integer. |
- Returns
- The Greatest Common Divisor (GCD) of iA and iB.
Definition at line 62 of file numerics.cpp.
◆ histcounts() [1/3]
template<typename T>
| void UTILSLIB::Numerics::histcounts |
( |
const Eigen::Matrix< T, 1, Eigen::Dynamic > & | matRawData, |
|
|
bool | bMakeSymmetrical, |
|
|
int | iClassAmount, |
|
|
Eigen::VectorXd & | vecResultClassLimits, |
|
|
Eigen::VectorXi & | vecResultFrequency, |
|
|
double | dGlobalMin = 0.0, |
|
|
double | dGlobalMax = 0.0 ) |
|
static |
◆ histcounts() [2/3]
template<typename T>
| void UTILSLIB::Numerics::histcounts |
( |
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | matRawData, |
|
|
bool | bMakeSymmetrical, |
|
|
int | iClassAmount, |
|
|
Eigen::VectorXd & | vecResultClassLimits, |
|
|
Eigen::VectorXi & | vecResultFrequency, |
|
|
double | dGlobalMin = 0.0, |
|
|
double | dGlobalMax = 0.0 ) |
|
static |
◆ histcounts() [3/3]
template<typename T>
| void UTILSLIB::Numerics::histcounts |
( |
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | matRawData, |
|
|
bool | bMakeSymmetrical, |
|
|
int | iClassAmount, |
|
|
Eigen::VectorXd & | vecResultClassLimits, |
|
|
Eigen::VectorXi & | vecResultFrequency, |
|
|
double | dGlobalMin = 0.0, |
|
|
double | dGlobalMax = 0.0 ) |
|
static |
Creates a class and frequency distribution from data matrix.
- Parameters
-
| [in] | matRawData | Raw data matrix that needs to be analyzed. |
| [in] | bMakeSymmetrical | User input to turn the x-axis symmetric. |
| [in] | iClassAmount | User input to determine the amount of classes in the histogram. |
| [out] | vecResultClassLimits | The upper limit of each individual class. |
| [out] | vecResultFrequency | The amount of data that fits in the appropriate class ranges. |
| [in] | dGlobalMin | User input to determine the minimum value allowed in the histogram. |
| [in] | dGlobalMax | User input to determine the maximum value allowed in the histogram. |
Definition at line 245 of file numerics.h.
◆ issparse()
| bool Numerics::issparse |
( |
Eigen::VectorXd & | v | ) |
|
|
static |
Determines if a given data (stored as vector v) are representing a sparse matrix.
- Parameters
-
- Returns
- true if sparse, false otherwise.
Definition at line 73 of file numerics.cpp.
◆ log2()
template<typename T>
| double UTILSLIB::Numerics::log2 |
( |
const T | d | ) |
|
|
inlinestatic |
Compute log base 2 of a given number.
- Parameters
-
- Returns
- log2 of d.
Definition at line 205 of file numerics.h.
◆ nchoose2()
| int Numerics::nchoose2 |
( |
int | n | ) |
|
|
static |
Calculates the combination of n over 2 (nchoosek(n,2)).
- Parameters
-
| [in] | n | The number of elements which should be combined with each other (n over 2). |
- Returns
- The number of combinations.
Definition at line 92 of file numerics.cpp.
◆ rescale() [1/2]
| Eigen::MatrixXd UTILSLIB::Numerics::rescale |
( |
const Eigen::MatrixXd & | data, |
|
|
const Eigen::RowVectorXf & | times, |
|
|
const QPair< float, float > & | baseline, |
|
|
QString | mode ) |
|
static |
Rescale (baseline correct) data.
- Parameters
-
| [in] | data | Data Matrix (m x n_time). |
| [in] | times | Time instants in seconds. |
| [in] | baseline | If baseline is (a, b) the interval is between "a (s)" and "b (s)". If a and b are equal, use interval between the beginning of the data and time 0. |
| [in] | mode | Baseline correction mode: "logratio" | "ratio" | "zscore" | "mean" | "percent". |
- Returns
- Rescaled data matrix.
◆ rescale() [2/2]
| Eigen::MatrixXd UTILSLIB::Numerics::rescale |
( |
const Eigen::MatrixXd & | data, |
|
|
const Eigen::RowVectorXf & | times, |
|
|
const std::pair< float, float > & | baseline, |
|
|
const std::string & | mode ) |
|
static |
Rescale (baseline correct) data.
- Parameters
-
| [in] | data | Data Matrix (m x n_time). |
| [in] | times | Time instants in seconds. |
| [in] | baseline | If baseline is (a, b) the interval is between "a (s)" and "b (s)". If a and b are equal, use interval between the beginning of the data and time 0. |
| [in] | mode | Baseline correction mode: "logratio" | "ratio" | "zscore" | "mean" | "percent". |
- Returns
- Rescaled data matrix.
The documentation for this class was generated from the following files: