Lines 81-87
Link Here
|
81 |
* |
81 |
* |
82 |
* \sa all(), any(), operator>(), operator<=() |
82 |
* \sa all(), any(), operator>(), operator<=() |
83 |
*/ |
83 |
*/ |
84 |
EIGEN_MAKE_CWISE_BINARY_OP(operator<,std::less) |
84 |
template<typename OtherDerived> |
|
|
85 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LT>, const Derived, const OtherDerived> |
86 |
operator<(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
87 |
{ |
88 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LT>, const Derived, const OtherDerived>(derived(), other.derived()); |
89 |
} |
90 |
|
91 |
|
92 |
|
85 |
|
93 |
|
86 |
/** \returns an expression of the coefficient-wise \<= operator of *this and \a other |
94 |
/** \returns an expression of the coefficient-wise \<= operator of *this and \a other |
87 |
* |
95 |
* |
Lines 90-96
Link Here
|
90 |
* |
98 |
* |
91 |
* \sa all(), any(), operator>=(), operator<() |
99 |
* \sa all(), any(), operator>=(), operator<() |
92 |
*/ |
100 |
*/ |
93 |
EIGEN_MAKE_CWISE_BINARY_OP(operator<=,std::less_equal) |
101 |
template<typename OtherDerived> |
|
|
102 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LE>, const Derived, const OtherDerived> |
103 |
operator<=(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
104 |
{ |
105 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LE>, const Derived, const OtherDerived>(derived(), other.derived()); |
106 |
} |
94 |
|
107 |
|
95 |
/** \returns an expression of the coefficient-wise \> operator of *this and \a other |
108 |
/** \returns an expression of the coefficient-wise \> operator of *this and \a other |
96 |
* |
109 |
* |
Lines 99-105
Link Here
|
99 |
* |
112 |
* |
100 |
* \sa all(), any(), operator>=(), operator<() |
113 |
* \sa all(), any(), operator>=(), operator<() |
101 |
*/ |
114 |
*/ |
102 |
EIGEN_MAKE_CWISE_BINARY_OP(operator>,std::greater) |
115 |
template<typename OtherDerived> |
|
|
116 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LT>, const OtherDerived, const Derived> |
117 |
operator>(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
118 |
{ |
119 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LT>, const OtherDerived, const Derived>(other.derived(), derived()); |
120 |
} |
103 |
|
121 |
|
104 |
/** \returns an expression of the coefficient-wise \>= operator of *this and \a other |
122 |
/** \returns an expression of the coefficient-wise \>= operator of *this and \a other |
105 |
* |
123 |
* |
Lines 108-114
Link Here
|
108 |
* |
126 |
* |
109 |
* \sa all(), any(), operator>(), operator<=() |
127 |
* \sa all(), any(), operator>(), operator<=() |
110 |
*/ |
128 |
*/ |
111 |
EIGEN_MAKE_CWISE_BINARY_OP(operator>=,std::greater_equal) |
129 |
template<typename OtherDerived> |
|
|
130 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LE>, const OtherDerived, const Derived> |
131 |
operator>=(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
132 |
{ |
133 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_LE>, const OtherDerived, const Derived>(other.derived(), derived()); |
134 |
} |
112 |
|
135 |
|
113 |
/** \returns an expression of the coefficient-wise == operator of *this and \a other |
136 |
/** \returns an expression of the coefficient-wise == operator of *this and \a other |
114 |
* |
137 |
* |
Lines 122-128
Link Here
|
122 |
* |
145 |
* |
123 |
* \sa all(), any(), isApprox(), isMuchSmallerThan() |
146 |
* \sa all(), any(), isApprox(), isMuchSmallerThan() |
124 |
*/ |
147 |
*/ |
125 |
EIGEN_MAKE_CWISE_BINARY_OP(operator==,std::equal_to) |
148 |
template<typename OtherDerived> |
|
|
149 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_EQ>, const Derived, const OtherDerived> |
150 |
operator==(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
151 |
{ |
152 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_EQ>, const Derived, const OtherDerived>(derived(), other.derived()); |
153 |
} |
126 |
|
154 |
|
127 |
/** \returns an expression of the coefficient-wise != operator of *this and \a other |
155 |
/** \returns an expression of the coefficient-wise != operator of *this and \a other |
128 |
* |
156 |
* |
Lines 136-142
Link Here
|
136 |
* |
164 |
* |
137 |
* \sa all(), any(), isApprox(), isMuchSmallerThan() |
165 |
* \sa all(), any(), isApprox(), isMuchSmallerThan() |
138 |
*/ |
166 |
*/ |
139 |
EIGEN_MAKE_CWISE_BINARY_OP(operator!=,std::not_equal_to) |
167 |
template<typename OtherDerived> |
|
|
168 |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_NE>, const Derived, const OtherDerived> |
169 |
operator!=(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const |
170 |
{ |
171 |
return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_NE>, const Derived, const OtherDerived>(derived(), other.derived()); |
172 |
} |
173 |
|
174 |
|
175 |
|
176 |
#define EIGEN_MAKE_SCALAR_CWISE_CMP_UNARY_OP(METHOD_NAME,COMPARATOR) \ |
177 |
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > Cmp ## COMPARATOR ## ReturnType; \ |
178 |
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, internal::cmp_ ## COMPARATOR>, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject>, const Derived > RCmp ## COMPARATOR ## ReturnType; \ |
179 |
EIGEN_DEVICE_FUNC \ |
180 |
inline const Cmp ## COMPARATOR ## ReturnType \ |
181 |
METHOD_NAME(const Scalar& s) const { \ |
182 |
return METHOD_NAME(Derived::PlainObject::Constant(rows(), cols(), s)); \ |
183 |
} \ |
184 |
friend inline const RCmp ## COMPARATOR ## ReturnType \ |
185 |
METHOD_NAME(const Scalar& s, const Derived& d) { \ |
186 |
return Derived::PlainObject::Constant(d.rows(), d.cols(), s).METHOD_NAME(d); \ |
187 |
} |
188 |
|
189 |
#define EIGEN_MAKE_SCALAR_CWISE_RCMP_UNARY_OP(METHOD_NAME, R_METHOD_NAME, RCOMPARATOR) \ |
190 |
EIGEN_DEVICE_FUNC \ |
191 |
inline const RCmp ## RCOMPARATOR ## ReturnType \ |
192 |
METHOD_NAME(const Scalar& s) const { \ |
193 |
return Derived::PlainObject::Constant(rows(), cols(), s).R_METHOD_NAME(*this); \ |
194 |
} \ |
195 |
friend inline const Cmp ## RCOMPARATOR ## ReturnType \ |
196 |
METHOD_NAME(const Scalar& s, const Derived& d) { \ |
197 |
return d.R_METHOD_NAME(Derived::PlainObject::Constant(d.rows(), d.cols(), s)); \ |
198 |
} |
199 |
|
200 |
EIGEN_MAKE_SCALAR_CWISE_CMP_UNARY_OP(operator==, EQ) |
201 |
EIGEN_MAKE_SCALAR_CWISE_CMP_UNARY_OP(operator!=, NE) |
202 |
EIGEN_MAKE_SCALAR_CWISE_CMP_UNARY_OP(operator<, LT) |
203 |
EIGEN_MAKE_SCALAR_CWISE_CMP_UNARY_OP(operator<=, LE) |
204 |
EIGEN_MAKE_SCALAR_CWISE_RCMP_UNARY_OP(operator>,operator<, LT) |
205 |
EIGEN_MAKE_SCALAR_CWISE_RCMP_UNARY_OP(operator>=,operator<=, LE) |
206 |
|
140 |
|
207 |
|
141 |
// scalar addition |
208 |
// scalar addition |
142 |
|
209 |
|