AutoPas  3.0.0
Loading...
Searching...
No Matches
Namespaces | Functions
Math.cpp File Reference
#include "Math.h"
Include dependency graph for Math.cpp:

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.
 

Detailed Description

Author
Jan Nguyen
Date
18.08.19

Function Documentation

◆ isNearAbs()

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 ==.

Parameters
a
b
maxAbsoluteDifferenceinclusive
Returns

◆ isNearRel()

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 ==.

Parameters
a
b
maxRelativeDifferenceinclusive, relative to max(|a|, |b|).
Returns

◆ makeVectorXd()

Eigen::VectorXd autopas::utils::Math::makeVectorXd ( const std::vector< double > &  elements)

Create a vector of doubles from given elements.

Parameters
elements
Returns

◆ makeVectorXi()

Eigen::VectorXi autopas::utils::Math::makeVectorXi ( const std::vector< int > &  elements)

Create a vector of ints from given elements.

Parameters
elements
Returns

◆ normalCDF()

double autopas::utils::Math::normalCDF ( double  x)

Cumulative distribution function CDF of the standard normal distribution.

Parameters
x
Returns
CDF(x)

◆ normalPDF()

double autopas::utils::Math::normalPDF ( double  x)

Probability density function PDF of the standard normal distribution.

Parameters
x
Returns
PDF(x)

◆ roundFixed()

double autopas::utils::Math::roundFixed ( double  d,
int  fixedPrecision 
)

Round a floating point number to a given number of decimal digits.

Parameters
dNumber to round.
fixedPrecisionNumber of decimal digits. Negative values lead to rounding of digits left of the decimal.
Returns
d rounded to the given number of digits.

◆ roundFloating()

double autopas::utils::Math::roundFloating ( double  d,
int  floatingPrecision 
)

Round a floating point number to a given floating precision.

Parameters
dNumber to round.
floatingPrecisionNumber of significant digits. Values <0 will return in 0.
Returns
d rounded to the given number of digits.

◆ sigmoid()

double autopas::utils::Math::sigmoid ( double  x)

Sigmoid logistic function.

Parameters
x
Returns
S(x)