STYLE: doxygen comments for min/max functions

This commit is contained in:
Mark Olesen
2019-01-09 09:08:20 +01:00
parent 907dd6d49f
commit 26d0d48fb5
3 changed files with 34 additions and 29 deletions

View File

@ -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)
{ {
@ -69,20 +70,21 @@ inline bool equal(const T& s1, const T& s2)
\ \
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)

View File

@ -46,14 +46,16 @@ 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 */ \
{ \
return (s1 > s2)? s1: s2; \
} \
\
inline retType min(const type1 s1, const type2 s2) \ inline retType min(const type1 s1, const type2 s2) \
{ \ { \
return (s1 < s2) ? s1 : s2; \ return (s1 < s2) ? s1 : s2; \
} \
\
/** \brief Floating/integral max. Use stdFoam::max() to preserve references */ \
inline retType max(const type1 s1, const type2 s2) \
{ \
return (s2 < s1) ? s1 : s2; \
} }

View File

@ -46,17 +46,18 @@ 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 */ \
{ \
return (s1 > s2)? s1: s2; \
} \
\
inline retType min(const type1 s1, const type2 s2) \ inline retType min(const type1 s1, const type2 s2) \
{ \ { \
return (s1 < s2) ? s1 : s2; \ return (s1 < s2) ? s1 : s2; \
} \
\
/** \brief Floating/integral max. Use stdFoam::max() to preserve references */ \
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)