ArrayCwiseBinaryOps.h
Go to the documentation of this file.
00001 
00005 template<typename OtherDerived>
00006 EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)
00007 operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
00008 {
00009   return EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)(derived(), other.derived());
00010 }
00011 
00016 template<typename OtherDerived>
00017 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
00018 operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
00019 {
00020   return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
00021 }
00022 
00030 EIGEN_MAKE_CWISE_BINARY_OP(min,internal::scalar_min_op)
00031 
00032 
00036 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived, const ConstantReturnType>
00037 (min)(const Scalar &other) const
00038 {
00039   return (min)(Derived::PlainObject::Constant(rows(), cols(), other));
00040 }
00041 
00049 EIGEN_MAKE_CWISE_BINARY_OP(max,internal::scalar_max_op)
00050 
00051 
00055 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const ConstantReturnType>
00056 (max)(const Scalar &other) const
00057 {
00058   return (max)(Derived::PlainObject::Constant(rows(), cols(), other));
00059 }
00060 
00068 EIGEN_MAKE_CWISE_BINARY_OP(operator<,std::less)
00069 
00070 
00077 EIGEN_MAKE_CWISE_BINARY_OP(operator<=,std::less_equal)
00078 
00086 EIGEN_MAKE_CWISE_BINARY_OP(operator>,std::greater)
00087 
00095 EIGEN_MAKE_CWISE_BINARY_OP(operator>=,std::greater_equal)
00096 
00109 EIGEN_MAKE_CWISE_BINARY_OP(operator==,std::equal_to)
00110 
00123 EIGEN_MAKE_CWISE_BINARY_OP(operator!=,std::not_equal_to)
00124 
00125 // scalar addition
00126 
00134 inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>
00135 operator+(const Scalar& scalar) const
00136 {
00137   return CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>(derived(), internal::scalar_add_op<Scalar>(scalar));
00138 }
00139 
00140 friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>
00141 operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other)
00142 {
00143   return other + scalar;
00144 }
00145 
00153 inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>
00154 operator-(const Scalar& scalar) const
00155 {
00156   return *this + (-scalar);
00157 }
00158 
00159 friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> >
00160 operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other)
00161 {
00162   return (-other) + scalar;
00163 }
00164 
00174 template<typename OtherDerived>
00175 inline const CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived>
00176 operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
00177 {
00178   EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value),
00179                       THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL);
00180   return CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived>(derived(),other.derived());
00181 }
00182 
00192 template<typename OtherDerived>
00193 inline const CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>
00194 operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
00195 {
00196   EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value),
00197                       THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL);
00198   return CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>(derived(),other.derived());
00199 }