15 #ifndef _GENERICARITHMETICI_H_ 16 #define _GENERICARITHMETICI_H_ 25 template<
typename ScalarT,
typename SelfT>
bool 28 return m_child->operatorCompare( rhs, std::less<ScalarT>() );
31 template<
typename ScalarT,
typename SelfT>
bool 34 return m_child->operatorCompare( rhs, std::greater<ScalarT>() );
37 template<
typename ScalarT,
typename SelfT>
bool 40 return m_child->operatorCompare( rhs, std::less_equal<ScalarT>() );
43 template<
typename ScalarT,
typename SelfT>
bool 46 return m_child->operatorCompare( rhs, std::greater_equal<ScalarT>() );
52 template<
typename ScalarT,
typename SelfT> SelfT&
55 return m_child->operatorOpEquals( rhs, std::plus<ScalarT>() );
58 template<
typename ScalarT,
typename SelfT> SelfT&
61 return m_child->operatorOpEquals( a, std::plus<ScalarT>() );
64 template<
typename ScalarT,
typename SelfT> SelfT&
67 return m_child->operatorOpEquals( rhs, std::minus<ScalarT>() );
70 template<
typename ScalarT,
typename SelfT> SelfT&
73 return m_child->operatorOpEquals( a, std::minus<ScalarT>() );
76 template<
typename ScalarT,
typename SelfT> SelfT&
79 return m_child->operatorOpEquals( rhs, std::multiplies<ScalarT>() );
82 template<
typename ScalarT,
typename SelfT> SelfT&
85 return m_child->operatorOpEquals( a, std::multiplies<ScalarT>() );
88 template<
typename ScalarT,
typename SelfT> SelfT&
91 return m_child->operatorOpEquals( rhs, std::divides<ScalarT>() );
94 template<
typename ScalarT,
typename SelfT> SelfT&
97 return m_child->operatorOpEquals( a, std::divides<ScalarT>() );
103 C
operatorOp(
const C& c1,
const C& c2, C& (C::*op)(
const C&) )
113 C& (C::*op)(
const typename C::scalar_type&) )
124 template<
class C>
typename C::self_type
operator+(
const C& c1,
const C& c2 )
126 return operatorOp< C >( c1, c2, &C::operator+= );
128 template<
class C>
typename C::self_type
operator-(
const C& c1,
const C& c2 )
130 return operatorOp< C >( c1, c2, &C::operator-= );
132 template<
class C>
typename C::self_type
operator*(
const C& c1,
const C& c2 )
134 return operatorOp< C >( c1, c2, &C::operator*= );
136 template<
class C>
typename C::self_type
operator/(
const C& c1,
const C& c2 )
138 return operatorOp< C >( c1, c2, &C::operator/= );
145 template<
class C>
typename C::self_type
operator+(
const C& c,
const typename C::scalar_type& x )
147 return operatorOpScalar<C>( c, x, &C::operator+= );
149 template<
class C>
typename C::self_type
operator+(
const typename C::scalar_type& x,
const C& c )
154 template<
class C>
typename C::self_type
operator*(
const C& c,
const typename C::scalar_type& x )
156 return operatorOpScalar<C>( c, x, &C::operator*= );
158 template<
class C>
typename C::self_type
operator*(
const typename C::scalar_type& x,
const C& c )
163 template<
class C>
typename C::self_type
operator-(
const C& c,
const typename C::scalar_type& x )
165 return operatorOpScalar<C>( c, x, &C::operator-= );
167 template<
class C>
typename C::self_type
operator-(
const typename C::scalar_type& x,
const C& c )
173 template<
class C>
typename C::self_type
operator/(
const C& c,
const typename C::scalar_type& x )
175 return operatorOpScalar<C>( c, x, &C::operator/= );
177 template<
class C>
typename C::self_type
operator/(
const typename C::scalar_type& x,
const C& c )
180 return temp.reciprocal() * x;
187 #endif // include guard bool operator>(const SelfT &) const
Definition: GenericArithmeticI.H:32
bool operator<(const SelfT &) const
Definition: GenericArithmeticI.H:26
bool operator>=(const SelfT &) const
Definition: GenericArithmeticI.H:44
SelfT & operator+=(const SelfT &)
Definition: GenericArithmeticI.H:53
C::self_type operator/(const C &c1, const C &c2)
Definition: GenericArithmeticI.H:136
C::self_type operator*(const C &c1, const C &c2)
Definition: GenericArithmeticI.H:132
C::self_type operator-(const C &c1, const C &c2)
Definition: GenericArithmeticI.H:128
C::self_type operator+(const C &c1, const C &c2)
Definition: GenericArithmeticI.H:124
C operatorOpScalar(const C &c1, const typename C::scalar_type &x, C &(C::*op)(const typename C::scalar_type &))
Definition: GenericArithmeticI.H:112
bool operator<=(const SelfT &) const
Definition: GenericArithmeticI.H:38
SelfT & operator*=(const SelfT &)
Definition: GenericArithmeticI.H:77
SelfT & operator/=(const SelfT &)
Definition: GenericArithmeticI.H:89
SelfT & operator-=(const SelfT &)
Definition: GenericArithmeticI.H:65
C operatorOp(const C &c1, const C &c2, C &(C::*op)(const C &))
Definition: GenericArithmeticI.H:103