#include "Math.h"
Namespaces | |
namespace | autopas |
This is the main namespace of AutoPas. | |
namespace | autopas::utils |
In this namespace some helper classes and functions can be found used inside of AutoPas. | |
Functions | |
double | autopas::utils::Math::normalPDF (double x) |
Probability density function PDF of the standard normal distribution. | |
double | autopas::utils::Math::normalCDF (double x) |
Cumulative distribution function CDF of the standard normal distribution. | |
double | autopas::utils::Math::sigmoid (double x) |
Sigmoid logistic function. | |
bool | autopas::utils::Math::isNearRel (double a, double b, double maxRelativeDifference=1e-9) |
Determines if two doubles are near each other. | |
bool | autopas::utils::Math::isNearAbs (double a, double b, double maxAbsoluteDifference) |
Determines if two doubles are near each other. | |
double | autopas::utils::Math::roundFixed (double d, int fixedPrecision) |
Round a floating point number to a given number of decimal digits. | |
double | autopas::utils::Math::roundFloating (double d, int floatingPrecision) |
Round a floating point number to a given floating precision. | |
Eigen::VectorXd | autopas::utils::Math::makeVectorXd (const std::vector< double > &elements) |
Create a vector of doubles from given elements. | |
Eigen::VectorXi | autopas::utils::Math::makeVectorXi (const std::vector< int > &elements) |
Create a vector of ints from given elements. | |
bool autopas::utils::Math::isNearAbs | ( | double | a, |
double | b, | ||
double | maxAbsoluteDifference | ||
) |
Determines if two doubles are near each other.
This function should be preferred to comparing with ==.
a | |
b | |
maxAbsoluteDifference | inclusive |
bool autopas::utils::Math::isNearRel | ( | double | a, |
double | b, | ||
double | maxRelativeDifference = 1e-9 |
||
) |
Determines if two doubles are near each other.
This function should be preferred to comparing with ==.
a | |
b | |
maxRelativeDifference | inclusive, relative to max(|a|, |b|). |
Eigen::VectorXd autopas::utils::Math::makeVectorXd | ( | const std::vector< double > & | elements | ) |
Create a vector of doubles from given elements.
elements |
Eigen::VectorXi autopas::utils::Math::makeVectorXi | ( | const std::vector< int > & | elements | ) |
Create a vector of ints from given elements.
elements |
double autopas::utils::Math::normalCDF | ( | double | x | ) |
Cumulative distribution function CDF of the standard normal distribution.
x |
double autopas::utils::Math::normalPDF | ( | double | x | ) |
Probability density function PDF of the standard normal distribution.
x |
double autopas::utils::Math::roundFixed | ( | double | d, |
int | fixedPrecision | ||
) |
Round a floating point number to a given number of decimal digits.
d | Number to round. |
fixedPrecision | Number of decimal digits. Negative values lead to rounding of digits left of the decimal. |
double autopas::utils::Math::roundFloating | ( | double | d, |
int | floatingPrecision | ||
) |
Round a floating point number to a given floating precision.
d | Number to round. |
floatingPrecision | Number of significant digits. Values <0 will return in 0. |
double autopas::utils::Math::sigmoid | ( | double | x | ) |
Sigmoid logistic function.
x |