G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gismo::math Namespace Reference

This namespace contains common mathematical functions. More...

Classes

struct  numeric_limits
 

Functions

template<typename T >
util::make_unsigned< T >::type abs_diff (T a, T b)
 
template<typename T >
int getSign (T val)
 Returns the sign of val.
 
int ipow (int x, unsigned exp)
 integer power
 
unsigned isqrt (unsigned value)
 integer square root
 
template<class T >
mix (T const &a, T const &b, T const &t)
 Returns convex combination of a and b with weight t.
 
template<typename T >
nextafter (T x, T y)
 

Detailed Description

This namespace contains common mathematical functions.

Function Documentation

util::make_unsigned<T>::type gismo::math::abs_diff ( a,
b 
)
inline

Return smallest difference between two (integer)T numbers as unsigned T especially the case abs_diff(INT32_MAX, INT32_MIN) := UINT32_MAX is correct

T gismo::math::nextafter ( x,
y 
)
inline

For numeric types, this function returns the next representable value after x in the direction of y