MinMax.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/
3 
4 This software is provided 'as-is', without any express or implied warranty.
5 In no event will the authors be held liable for any damages arising from the use of this software.
6 Permission is granted to anyone to use this software for any purpose,
7 including commercial applications, and to alter it and redistribute it freely,
8 subject to the following restrictions:
9 
10 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
11 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
12 3. This notice may not be removed or altered from any source distribution.
13 */
14 
15 
16 
17 #ifndef TF_MINMAX_H
18 #define TF_MINMAX_H
19 
20 template <class T>
21 TFSIMD_FORCE_INLINE const T& tfMin(const T& a, const T& b)
22 {
23  return a < b ? a : b ;
24 }
25 
26 template <class T>
27 TFSIMD_FORCE_INLINE const T& tfMax(const T& a, const T& b)
28 {
29  return a > b ? a : b;
30 }
31 
32 
33 template <class T>
34 TFSIMD_FORCE_INLINE void tfSetMin(T& a, const T& b)
35 {
36  if (b < a)
37  {
38  a = b;
39  }
40 }
41 
42 template <class T>
43 TFSIMD_FORCE_INLINE void tfSetMax(T& a, const T& b)
44 {
45  if (a < b)
46  {
47  a = b;
48  }
49 }
50 
51 
52 #endif
TFSIMD_FORCE_INLINE const T & tfMax(const T &a, const T &b)
Definition: MinMax.h:27
TFSIMD_FORCE_INLINE void tfSetMin(T &a, const T &b)
Definition: MinMax.h:34
#define TFSIMD_FORCE_INLINE
Definition: Scalar.h:130
TFSIMD_FORCE_INLINE const T & tfMin(const T &a, const T &b)
Definition: MinMax.h:21
TFSIMD_FORCE_INLINE void tfSetMax(T &a, const T &b)
Definition: MinMax.h:43


tf
Author(s): Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
autogenerated on Mon Feb 28 2022 22:26:19