![]() |
define a custom template unary functor to execute the clamp operation over an Eigen matrix structure. More...
#include <SurgSim/Math/Scalar.h>
Public Member Functions | |
clampOperator (const T &min, const T &max, const T &epsilon) | |
Constructor. More... | |
const T | operator() (const T &x) const |
Execute the clamp operator. More... | |
Private Attributes | |
T | m_min |
The minimum value of the interval. More... | |
T | m_max |
The maximum value of the interval. More... | |
T | m_epsilon |
The closeness parameter for the clamp. More... | |
define a custom template unary functor to execute the clamp operation over an Eigen matrix structure.
The operation clamps based on an epsilon interval. For values outside the interval min to max, the clamp proceeds as expected. However, values within the interval that lie within epsilon of an endpoint are also clamped to th endpoint.
T | the type over which the operator is defined. |
|
inline |
Constructor.
min | minimum value for the clamp interval |
max | maximum value for the clamp interval |
epsilon | values within epsilon of an interval endpoint are clamped to the interval regardless of if they are within the interval or not |
const T SurgSim::Math::clampOperator< T >::operator() | ( | const T & | x | ) | const |
Execute the clamp operator.
x | the value to clamp based |
|
private |
The closeness parameter for the clamp.
Values within epsilon of an interval endpoint are clamped to the interval regardless of if they are within the interval or not
|
private |
The maximum value of the interval.
|
private |
The minimum value of the interval.