clampOp< T > Struct Template Reference

Unary function for applying component-wise clamping. More...

Public Member Functions

 clampOp (const T &min, const T &max)
 Construct from min/max limits. No validity checks. More...
 
 clampOp (const MinMax< T > &range)
 Construct from min/max range. No validity checks. More...
 
 clampOp (const Foam::zero_one)
 Construct as 0-1 min/max range. More...
 
T operator() (const T &val) const
 

Public Attributes

const T lower
 
const T upper
 

Detailed Description

template<class T>
struct Foam::clampOp< T >

Unary function for applying component-wise clamping.

Definition at line 67 of file MinMaxOps.H.

Constructor & Destructor Documentation

◆ clampOp() [1/3]

clampOp ( const T min,
const T max 
)
inline

Construct from min/max limits. No validity checks.

Definition at line 75 of file MinMaxOps.H.

◆ clampOp() [2/3]

clampOp ( const MinMax< T > &  range)
inline

Construct from min/max range. No validity checks.

Definition at line 84 of file MinMaxOps.H.

◆ clampOp() [3/3]

clampOp ( const Foam::zero_one  )
inline

Construct as 0-1 min/max range.

Definition at line 93 of file MinMaxOps.H.

Member Function Documentation

◆ operator()()

T operator() ( const T val) const
inline

Definition at line 98 of file MinMaxOps.H.

References clampOp< T >::lower, Foam::max(), Foam::min(), and clampOp< T >::upper.

Here is the call graph for this function:

Member Data Documentation

◆ lower

const T lower

Definition at line 69 of file MinMaxOps.H.

Referenced by clampOp< T >::operator()().

◆ upper

const T upper

Definition at line 70 of file MinMaxOps.H.

Referenced by clampOp< T >::operator()().


The documentation for this struct was generated from the following file: