SPH
Functions
MathBasic.h File Reference

Basic math routines. More...

#include "objects/Object.h"

Go to the source code of this file.

Functions

template<typename T >
NAMESPACE_SPH_BEGIN constexpr INLINEmin (const T &f1, const T &f2)
 Minimum & Maximum value. More...
 
template<typename T >
constexpr INLINEmax (const T &f1, const T &f2)
 
template<typename T , typename... TArgs>
constexpr INLINEmin (const T &f1, const T &f2, const TArgs &... rest)
 
template<typename T , typename... TArgs>
constexpr INLINEmax (const T &f1, const T &f2, const TArgs &... rest)
 
template<typename T >
constexpr INLINEclamp (const T &f, const T &f1, const T &f2)
 
template<typename T >
constexpr INLINE bool isOdd (const T &f)
 

Detailed Description

Basic math routines.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file MathBasic.h.

Function Documentation

◆ clamp()

template<typename T >
constexpr INLINE T clamp ( const T &  f,
const T &  f1,
const T &  f2 
)
constexpr

Definition at line 35 of file MathBasic.h.

◆ isOdd()

template<typename T >
constexpr INLINE bool isOdd ( const T &  f)
constexpr

Definition at line 40 of file MathBasic.h.

◆ max() [1/2]

template<typename T >
constexpr INLINE T max ( const T &  f1,
const T &  f2 
)
constexpr

Definition at line 20 of file MathBasic.h.

◆ max() [2/2]

template<typename T , typename... TArgs>
constexpr INLINE T max ( const T &  f1,
const T &  f2,
const TArgs &...  rest 
)
constexpr

Definition at line 30 of file MathBasic.h.

◆ min() [1/2]

template<typename T >
NAMESPACE_SPH_BEGIN constexpr INLINE T min ( const T &  f1,
const T &  f2 
)
constexpr

Minimum & Maximum value.

Definition at line 15 of file MathBasic.h.

◆ min() [2/2]

template<typename T , typename... TArgs>
constexpr INLINE T min ( const T &  f1,
const T &  f2,
const TArgs &...  rest 
)
constexpr

Definition at line 25 of file MathBasic.h.