Functions
openfluid::scientific Namespace Reference

Functions

template<typename T1 , typename T2 >
bool isCloseEnough (const T1 &A, const T2 &B, const double &Epsilon=0.00001)
 
template<typename T1 , typename T2 >
bool isVeryClose (const T1 &A, const T2 &B, const double &Epsilon=0.00001)
 
bool IsCloseEnough (double A, double B, double Epsilon=0.00001) OPENFLUID_DEPRECATED
 
bool IsVeryClose (double A, double B, double Epsilon=0.00001) OPENFLUID_DEPRECATED
 
template<typename T >
linearInterpolation (const T &X0, const T &Y0, const T &X1, const T &Y1, const T &X)
 
template<typename T >
linearInterpolationFromXOrigin (const T &Y0, const T &X1, const T &Y1, const T &X)
 

Function Documentation

template<typename T1 , typename T2 >
bool openfluid::scientific::isCloseEnough ( const T1 &  A,
const T2 &  B,
const double &  Epsilon = 0.00001 
)
inline

Tests equality between two floating point values, using the "close enough" method.

Parameters
[in]Athe first term of the equality
[in]Bthe second term of the equality
[in]Epsilonthe comparison tolerance factor
See also
http://www.parashift.com/c++-faq-lite/floating-point-arith.html
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
bool openfluid::scientific::IsCloseEnough ( double  A,
double  B,
double  Epsilon = 0.00001 
)
inline
Deprecated:
Since version 2.1.0. Use openfluid::scientific::isCloseEnough instead
template<typename T1 , typename T2 >
bool openfluid::scientific::isVeryClose ( const T1 &  A,
const T2 &  B,
const double &  Epsilon = 0.00001 
)
inline

Tests equality between two floating point values, using the "very close" method.

Parameters
[in]Athe first term of the equality
[in]Bthe seond term of the equality
[in]Epsilonthe comparison tolerance factor
See also
http://www.parashift.com/c++-faq-lite/floating-point-arith.html
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
bool openfluid::scientific::IsVeryClose ( double  A,
double  B,
double  Epsilon = 0.00001 
)
inline
Deprecated:
Since version 2.1.0.Use openfluid::scientific::isVeryClose instead
template<typename T >
T openfluid::scientific::linearInterpolation ( const T &  X0,
const T &  Y0,
const T &  X1,
const T &  Y1,
const T &  X 
)
inline

Performs a linear interpolation between (x0,y0) and (x1,y1), giving the y value for the x coordinate

Parameters
[in]X0the x0 coordinate
[in]Y0the y0 coordinate
[in]X1the x1 coordinate
[in]Y1the y1 coordinate
[in]Xthe x coordinate
Returns
the y coordinate
template<typename T >
T openfluid::scientific::linearInterpolationFromXOrigin ( const T &  Y0,
const T &  X1,
const T &  Y1,
const T &  X 
)
inline

Performs a linear interpolation between (0,y0) and (x1,y1), giving the y value for the origin x coordinate

Parameters
[in]Y0the y0 coordinate
[in]X1the x1 coordinate
[in]Y1the y1 coordinate
[in]Xthe x coordinate
Returns
the y coordinate