SOFA API  56988ca1
Open source framework for multi-physics simuation
sofa::type::pairwise Namespace Reference

Functions

template<class T >
const T & stdclamp (const T &v, const T &lo, const T &hi)
 clamp a single value. This function should be removed when std::clamp will be available More...
 
template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
clamp (const T &in, const TT &minValue, const TT &maxValue)
 clamp all the values of a fixed_array to be within a given interval. More...
 
template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
constexpr T operator+ (const T &l, const T &r)
 pairwise add of two fixed_array More...
 
template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
constexpr T operator- (const T &l, const T &r)
 pairwise subtract of two fixed_array More...
 
template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
operator* (const T &r, const typename T::value_type &f)
 multiply from l the r components. More...
 
template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
operator/ (const T &r, const typename T::value_type &f)
 multiply from l the r components. More...
 

Function Documentation

◆ clamp()

template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
T sofa::type::pairwise::clamp ( const T &  in,
const TT &  minValue,
const TT &  maxValue 
)

clamp all the values of a fixed_array to be within a given interval.

◆ operator*()

template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
T sofa::type::pairwise::operator* ( const T &  r,
const typename T::value_type &  f 
)

multiply from l the r components.

◆ operator+()

template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
constexpr T sofa::type::pairwise::operator+ ( const T &  l,
const T &  r 
)
constexpr

pairwise add of two fixed_array

◆ operator-()

template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
constexpr T sofa::type::pairwise::operator- ( const T &  l,
const T &  r 
)
constexpr

pairwise subtract of two fixed_array

◆ operator/()

template<class T , class TT = typename T::value_type, size_t TN = T::static_size>
T sofa::type::pairwise::operator/ ( const T &  r,
const typename T::value_type &  f 
)

multiply from l the r components.

◆ stdclamp()

template<class T >
const T& sofa::type::pairwise::stdclamp ( const T &  v,
const T &  lo,
const T &  hi 
)

clamp a single value. This function should be removed when std::clamp will be available