$treeview $search $mathjax
Eigen
3.2.5
$projectbrief
|
$projectbrief
|
$searchbox |
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, 00037 const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > 00038 #ifdef EIGEN_PARSED_BY_DOXYGEN 00039 min 00040 #else 00041 (min) 00042 #endif 00043 (const Scalar &other) const 00044 { 00045 return (min)(Derived::PlainObject::Constant(rows(), cols(), other)); 00046 } 00047 00055 EIGEN_MAKE_CWISE_BINARY_OP(max,internal::scalar_max_op) 00056 00057 00061 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, 00062 const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > 00063 #ifdef EIGEN_PARSED_BY_DOXYGEN 00064 max 00065 #else 00066 (max) 00067 #endif 00068 (const Scalar &other) const 00069 { 00070 return (max)(Derived::PlainObject::Constant(rows(), cols(), other)); 00071 } 00072 00073 00074 #define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \ 00075 template<typename OtherDerived> \ 00076 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived> \ 00077 OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \ 00078 { \ 00079 return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived>(derived(), other.derived()); \ 00080 }\ 00081 typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > Cmp ## COMPARATOR ## ReturnType; \ 00082 typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject>, const Derived > RCmp ## COMPARATOR ## ReturnType; \ 00083 EIGEN_STRONG_INLINE const Cmp ## COMPARATOR ## ReturnType \ 00084 OP(const Scalar& s) const { \ 00085 return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \ 00086 } \ 00087 friend EIGEN_STRONG_INLINE const RCmp ## COMPARATOR ## ReturnType \ 00088 OP(const Scalar& s, const Derived& d) { \ 00089 return Derived::PlainObject::Constant(d.rows(), d.cols(), s).OP(d); \ 00090 } 00091 00092 #define EIGEN_MAKE_CWISE_COMP_R_OP(OP, R_OP, RCOMPARATOR) \ 00093 template<typename OtherDerived> \ 00094 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_##RCOMPARATOR>, const OtherDerived, const Derived> \ 00095 OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \ 00096 { \ 00097 return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_##RCOMPARATOR>, const OtherDerived, const Derived>(other.derived(), derived()); \ 00098 } \ 00099 \ 00100 inline const RCmp ## RCOMPARATOR ## ReturnType \ 00101 OP(const Scalar& s) const { \ 00102 return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \ 00103 } \ 00104 friend inline const Cmp ## RCOMPARATOR ## ReturnType \ 00105 OP(const Scalar& s, const Derived& d) { \ 00106 return d.R_OP(Derived::PlainObject::Constant(d.rows(), d.cols(), s)); \ 00107 } 00108 00109 00117 EIGEN_MAKE_CWISE_COMP_OP(operator<, LT) 00118 00119 00126 EIGEN_MAKE_CWISE_COMP_OP(operator<=, LE) 00127 00135 EIGEN_MAKE_CWISE_COMP_R_OP(operator>, operator<, LT) 00136 00144 EIGEN_MAKE_CWISE_COMP_R_OP(operator>=, operator<=, LE) 00145 00158 EIGEN_MAKE_CWISE_COMP_OP(operator==, EQ) 00159 00172 EIGEN_MAKE_CWISE_COMP_OP(operator!=, NEQ) 00173 00174 #undef EIGEN_MAKE_CWISE_COMP_OP 00175 #undef EIGEN_MAKE_CWISE_COMP_R_OP 00176 00177 // scalar addition 00178 00186 inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> 00187 operator+(const Scalar& scalar) const 00188 { 00189 return CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>(derived(), internal::scalar_add_op<Scalar>(scalar)); 00190 } 00191 00192 friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> 00193 operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other) 00194 { 00195 return other + scalar; 00196 } 00197 00205 inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived> 00206 operator-(const Scalar& scalar) const 00207 { 00208 return *this + (-scalar); 00209 } 00210 00211 friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> > 00212 operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other) 00213 { 00214 return (-other) + scalar; 00215 } 00216 00226 template<typename OtherDerived> 00227 inline const CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived> 00228 operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const 00229 { 00230 EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value), 00231 THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL); 00232 return CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived>(derived(),other.derived()); 00233 } 00234 00244 template<typename OtherDerived> 00245 inline const CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived> 00246 operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const 00247 { 00248 EIGEN_STATIC_ASSERT((internal::is_same<bool,Scalar>::value && internal::is_same<bool,typename OtherDerived::Scalar>::value), 00249 THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL); 00250 return CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>(derived(),other.derived()); 00251 } 00252 00253