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 303 of file SimpleFunctors.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 307 of file SimpleFunctors.h.

References gen::C.

307  {
308  if (right == rightZero)
309  if (left == leftZero) {
310  left = C;
311  return left;
312  }
313  return left /= right;
314  }

Member Data Documentation

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

Definition at line 317 of file SimpleFunctors.h.

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

Definition at line 318 of file SimpleFunctors.h.

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

Definition at line 319 of file SimpleFunctors.h.