CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
npstat::diveq_right_0by0isC< T1, T2 > Struct Template Reference

#include <SimpleFunctors.h>

Public Member Functions

 diveq_right_0by0isC ()
 
 diveq_right_0by0isC (const T2 &value)
 
T2 & operator() (const T1 &left, T2 &right) const
 

Private Attributes

T2 C
 
T1 leftZero
 
T2 rightZero
 

Detailed Description

template<typename T1, typename T2>
struct npstat::diveq_right_0by0isC< T1, T2 >

In-place division on the right side. Allow 0/0 = const.

Definition at line 332 of file SimpleFunctors.h.

Constructor & Destructor Documentation

◆ diveq_right_0by0isC() [1/2]

template<typename T1 , typename T2 >
npstat::diveq_right_0by0isC< T1, T2 >::diveq_right_0by0isC ( )
inline

◆ diveq_right_0by0isC() [2/2]

template<typename T1 , typename T2 >
npstat::diveq_right_0by0isC< T1, T2 >::diveq_right_0by0isC ( const T2 &  value)
inlineexplicit

Member Function Documentation

◆ operator()()

template<typename T1 , typename T2 >
T2& npstat::diveq_right_0by0isC< T1, T2 >::operator() ( const T1 &  left,
T2 &  right 
) const
inline

Definition at line 336 of file SimpleFunctors.h.

References npstat::diveq_right_0by0isC< T1, T2 >::C, npstat::diveq_right_0by0isC< T1, T2 >::leftZero, and npstat::diveq_right_0by0isC< T1, T2 >::rightZero.

336  {
337  if (left == leftZero)
338  if (right == rightZero) {
339  right = C;
340  return right;
341  }
342  return right /= left;
343  }

Member Data Documentation

◆ C

template<typename T1 , typename T2 >
T2 npstat::diveq_right_0by0isC< T1, T2 >::C
private

Definition at line 346 of file SimpleFunctors.h.

Referenced by npstat::diveq_right_0by0isC< T1, T2 >::operator()().

◆ leftZero

template<typename T1 , typename T2 >
T1 npstat::diveq_right_0by0isC< T1, T2 >::leftZero
private

Definition at line 347 of file SimpleFunctors.h.

Referenced by npstat::diveq_right_0by0isC< T1, T2 >::operator()().

◆ rightZero

template<typename T1 , typename T2 >
T2 npstat::diveq_right_0by0isC< T1, T2 >::rightZero
private

Definition at line 348 of file SimpleFunctors.h.

Referenced by npstat::diveq_right_0by0isC< T1, T2 >::operator()().