CMS 3D CMS Logo

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

#include <SimpleFunctors.h>

Public Member Functions

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

Private Attributes

T1 C
 
T1 leftZero
 
T2 rightZero
 

Detailed Description

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

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

Definition at line 311 of file SimpleFunctors.h.

Constructor & Destructor Documentation

◆ diveq_left_0by0isC() [1/2]

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

Definition at line 312 of file SimpleFunctors.h.

312 : C(T1()), leftZero(T1()), rightZero(T2()) {}

◆ diveq_left_0by0isC() [2/2]

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

Definition at line 313 of file SimpleFunctors.h.

313 : C(value), leftZero(T1()), rightZero(T2()) {}

Member Function Documentation

◆ operator()()

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

Definition at line 315 of file SimpleFunctors.h.

315  {
316  if (right == rightZero)
317  if (left == leftZero) {
318  left = C;
319  return left;
320  }
321  return left /= right;
322  }

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

Member Data Documentation

◆ C

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

Definition at line 325 of file SimpleFunctors.h.

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

◆ leftZero

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

Definition at line 326 of file SimpleFunctors.h.

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

◆ rightZero

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

Definition at line 327 of file SimpleFunctors.h.

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

npstat::diveq_left_0by0isC::leftZero
T1 leftZero
Definition: SimpleFunctors.h:326
npstat::diveq_left_0by0isC::C
T1 C
Definition: SimpleFunctors.h:325
value
Definition: value.py:1
npstat::diveq_left_0by0isC::rightZero
T2 rightZero
Definition: SimpleFunctors.h:327