Functions |
template<typename T , typename R > |
const T & | clamp (const T &x, const T &min, const T &max, R r) |
template<typename T > |
const T & | clamp (const T &x, const T &min, const T &max) |
template<typename T , typename R > |
const T & | clamp_unordered (const T &x, const T &min, const T &max, R r) |
template<typename T > |
const T & | clamp_unordered (const T &x, const T &min, const T &max) |
Detailed Description
As with adobe::min and adobe::max, clamp is a select algorithm. The clamp algorithm returns min if x
is less than min
and max
if x
is greater than max.
The clamp algorithm is stable with respect to the order min, x, max
.
The clamp_unorderd algorithm does not presume an ordering between min
and max
. It is equivalent to median(min, x, max)
.
- See also:
-
Function Documentation
const T& adobe::clamp |
( |
const T & |
x, |
|
|
const T & |
min, |
|
|
const T & |
max, |
|
|
R |
r |
|
) |
| |
clamp implementation
- Precondition:
!r(max, min)
Definition at line 46 of file clamp.hpp.
const T& adobe::clamp |
( |
const T & |
x, |
|
|
const T & |
min, |
|
|
const T & |
max |
|
) |
| |
clamp implementation
- Precondition:
!(max < min)
Definition at line 58 of file clamp.hpp.
const T& adobe::clamp_unordered |
( |
const T & |
x, |
|
|
const T & |
min, |
|
|
const T & |
max, |
|
|
R |
r |
|
) |
| |
clamp_unordered implementation
Definition at line 69 of file clamp.hpp.
const T& adobe::clamp_unordered |
( |
const T & |
x, |
|
|
const T & |
min, |
|
|
const T & |
max |
|
) |
| |
clamp_unordered implementation
Definition at line 78 of file clamp.hpp.