mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: doxygen comments for min/max functions
This commit is contained in:
@ -58,6 +58,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- Compare two values for equality
|
||||||
template<class T>
|
template<class T>
|
||||||
inline bool equal(const T& s1, const T& s2)
|
inline bool equal(const T& s1, const T& s2)
|
||||||
{
|
{
|
||||||
@ -65,24 +66,25 @@ inline bool equal(const T& s1, const T& s2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define MAXMINPOW(retType, type1, type2) \
|
#define MAXMINPOW(retType, type1, type2) \
|
||||||
\
|
\
|
||||||
MAXMIN(retType, type1, type2) \
|
MAXMIN(retType, type1, type2) \
|
||||||
\
|
\
|
||||||
inline double pow(const type1 s, const type2 e) \
|
/** \brief Raise base to the power expon */ \
|
||||||
{ \
|
inline double pow(const type1 base, const type2 expon) \
|
||||||
return ::pow(double(s), double(e)); \
|
{ \
|
||||||
|
return ::pow(double(base), double(expon)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MAXMINPOW(double, double, double)
|
MAXMINPOW(double, double, double)
|
||||||
MAXMINPOW(double, double, float)
|
MAXMINPOW(double, double, float)
|
||||||
MAXMINPOW(double, float, double)
|
MAXMINPOW(double, float, double)
|
||||||
MAXMINPOW(float, float, float)
|
|
||||||
MAXMINPOW(double, double, int)
|
MAXMINPOW(double, double, int)
|
||||||
MAXMINPOW(double, int, double)
|
MAXMINPOW(double, int, double)
|
||||||
MAXMINPOW(double, double, long)
|
MAXMINPOW(double, double, long)
|
||||||
MAXMINPOW(double, long, double)
|
MAXMINPOW(double, long, double)
|
||||||
|
MAXMINPOW(float, float, float)
|
||||||
MAXMINPOW(float, float, int)
|
MAXMINPOW(float, float, int)
|
||||||
MAXMINPOW(float, int, float)
|
MAXMINPOW(float, int, float)
|
||||||
MAXMINPOW(float, float, long)
|
MAXMINPOW(float, float, long)
|
||||||
|
|||||||
@ -44,16 +44,18 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
#define MAXMIN(retType, type1, type2) \
|
#define MAXMIN(retType, type1, type2) \
|
||||||
\
|
\
|
||||||
inline retType max(const type1 s1, const type2 s2) \
|
/** \brief Floating/integral min. Use stdFoam::min() to preserve references */ \
|
||||||
{ \
|
inline retType min(const type1 s1, const type2 s2) \
|
||||||
return (s1 > s2)? s1: s2; \
|
{ \
|
||||||
} \
|
return (s1 < s2) ? s1 : s2; \
|
||||||
\
|
} \
|
||||||
inline retType min(const type1 s1, const type2 s2) \
|
\
|
||||||
{ \
|
/** \brief Floating/integral max. Use stdFoam::max() to preserve references */ \
|
||||||
return (s1 < s2)? s1: s2; \
|
inline retType max(const type1 s1, const type2 s2) \
|
||||||
|
{ \
|
||||||
|
return (s2 < s1) ? s1 : s2; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -44,19 +44,20 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
#define MAXMIN(retType, type1, type2) \
|
#define MAXMIN(retType, type1, type2) \
|
||||||
\
|
\
|
||||||
inline retType max(const type1 s1, const type2 s2) \
|
/** \brief Floating/integral min. Use stdFoam::min() to preserve references */ \
|
||||||
{ \
|
inline retType min(const type1 s1, const type2 s2) \
|
||||||
return (s1 > s2)? s1: s2; \
|
{ \
|
||||||
} \
|
return (s1 < s2) ? s1 : s2; \
|
||||||
\
|
} \
|
||||||
inline retType min(const type1 s1, const type2 s2) \
|
\
|
||||||
{ \
|
/** \brief Floating/integral max. Use stdFoam::max() to preserve references */ \
|
||||||
return (s1 < s2)? s1: s2; \
|
inline retType max(const type1 s1, const type2 s2) \
|
||||||
|
{ \
|
||||||
|
return (s2 < s1) ? s1 : s2; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MAXMIN(uint8_t, uint8_t, uint8_t)
|
MAXMIN(uint8_t, uint8_t, uint8_t)
|
||||||
MAXMIN(uint16_t, uint16_t, uint16_t)
|
MAXMIN(uint16_t, uint16_t, uint16_t)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user