MatrixCwiseBinaryOps.h File Reference

Go to the source code of this file.

Typedefs

template<typename OtherDerived >
using CwiseBinaryEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryGreaterOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryGreaterReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryLessOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryLessReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryNotEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ, true >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedGreaterOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE, true >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedGreaterReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT, true >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedLessOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE, true >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedLessReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT, true >, const Derived, const OtherDerived >
 
template<typename OtherDerived >
using CwiseBinaryTypedNotEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ, true >, const Derived, const OtherDerived >
 
using CwiseScalarEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ >, const Derived, const ConstantReturnType >
 
using CwiseScalarGreaterOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE >, const Derived, const ConstantReturnType >
 
using CwiseScalarGreaterReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT >, const Derived, const ConstantReturnType >
 
using CwiseScalarLessOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE >, const Derived, const ConstantReturnType >
 
using CwiseScalarLessReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT >, const Derived, const ConstantReturnType >
 
using CwiseScalarNotEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ, true >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedGreaterOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE, true >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedGreaterReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT, true >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedLessOrEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE, true >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedLessReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT, true >, const Derived, const ConstantReturnType >
 
using CwiseScalarTypedNotEqualReturnType = CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ, true >, const Derived, const ConstantReturnType >
 

Functions

template<typename OtherDerived >
const CwiseBinaryEqualReturnType< OtherDerived > cwiseEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarEqualReturnType cwiseEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryGreaterReturnType< OtherDerived > cwiseGreater (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarGreaterReturnType cwiseGreater (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryGreaterOrEqualReturnType< OtherDerived > cwiseGreaterOrEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryLessReturnType< OtherDerived > cwiseLess (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarLessReturnType cwiseLess (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryLessOrEqualReturnType< OtherDerived > cwiseLessOrEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual (const Scalar &s) const
 
template<int NaNPropagation = PropagateFast, typename OtherDerived >
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMax (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > cwiseMax (const Scalar &other) const
 
template<int NaNPropagation = PropagateFast, typename OtherDerived >
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMin (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > cwiseMin (const Scalar &other) const
 
template<typename OtherDerived >
const CwiseBinaryNotEqualReturnType< OtherDerived > cwiseNotEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarNotEqualReturnType cwiseNotEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > cwiseProduct (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
template<typename OtherDerived >
const CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const Derived, const OtherDerived > cwiseQuotient (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
template<typename OtherDerived >
const CwiseBinaryTypedEqualReturnType< OtherDerived > cwiseTypedEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedEqualReturnType cwiseTypedEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryTypedGreaterReturnType< OtherDerived > cwiseTypedGreater (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedGreaterReturnType cwiseTypedGreater (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryTypedGreaterOrEqualReturnType< OtherDerived > cwiseTypedGreaterOrEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedGreaterOrEqualReturnType cwiseTypedGreaterOrEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryTypedLessReturnType< OtherDerived > cwiseTypedLess (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedLessReturnType cwiseTypedLess (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryTypedLessOrEqualReturnType< OtherDerived > cwiseTypedLessOrEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedLessOrEqualReturnType cwiseTypedLessOrEqual (const Scalar &s) const
 
template<typename OtherDerived >
const CwiseBinaryTypedNotEqualReturnType< OtherDerived > cwiseTypedNotEqual (const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
 
const CwiseScalarTypedNotEqualReturnType cwiseTypedNotEqual (const Scalar &s) const
 

Typedef Documentation

◆ CwiseBinaryEqualReturnType

template<typename OtherDerived >
using CwiseBinaryEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ>, const Derived, const OtherDerived>

Definition at line 28 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryGreaterOrEqualReturnType

template<typename OtherDerived >
using CwiseBinaryGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const OtherDerived>

Definition at line 33 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryGreaterReturnType

template<typename OtherDerived >
using CwiseBinaryGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const OtherDerived>

Definition at line 31 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryLessOrEqualReturnType

template<typename OtherDerived >
using CwiseBinaryLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const OtherDerived>

Definition at line 32 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryLessReturnType

template<typename OtherDerived >
using CwiseBinaryLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const OtherDerived>

Definition at line 30 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryNotEqualReturnType

template<typename OtherDerived >
using CwiseBinaryNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const OtherDerived>

Definition at line 29 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedEqualReturnType

template<typename OtherDerived >
using CwiseBinaryTypedEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>, const Derived, const OtherDerived>

Definition at line 253 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedGreaterOrEqualReturnType

template<typename OtherDerived >
using CwiseBinaryTypedGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const OtherDerived>

Definition at line 258 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedGreaterReturnType

template<typename OtherDerived >
using CwiseBinaryTypedGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>, const Derived, const OtherDerived>

Definition at line 256 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedLessOrEqualReturnType

template<typename OtherDerived >
using CwiseBinaryTypedLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived, const OtherDerived>

Definition at line 257 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedLessReturnType

template<typename OtherDerived >
using CwiseBinaryTypedLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>, const Derived, const OtherDerived>

Definition at line 255 of file MatrixCwiseBinaryOps.h.

◆ CwiseBinaryTypedNotEqualReturnType

template<typename OtherDerived >
using CwiseBinaryTypedNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived, const OtherDerived>

Definition at line 254 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarEqualReturnType

using CwiseScalarEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar,internal::cmp_EQ>, const Derived, const ConstantReturnType>

Definition at line 181 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarGreaterOrEqualReturnType

using CwiseScalarGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE>, const Derived, const ConstantReturnType>

Definition at line 186 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarGreaterReturnType

using CwiseScalarGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT>, const Derived, const ConstantReturnType>

Definition at line 184 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarLessOrEqualReturnType

using CwiseScalarLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE>, const Derived, const ConstantReturnType>

Definition at line 185 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarLessReturnType

using CwiseScalarLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT>, const Derived, const ConstantReturnType>

Definition at line 183 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarNotEqualReturnType

using CwiseScalarNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ>, const Derived, const ConstantReturnType>

Definition at line 182 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedEqualReturnType

using CwiseScalarTypedEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_EQ, true>, const Derived, const ConstantReturnType>

Definition at line 284 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedGreaterOrEqualReturnType

using CwiseScalarTypedGreaterOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const ConstantReturnType>

Definition at line 289 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedGreaterReturnType

using CwiseScalarTypedGreaterReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GT, true>, const Derived, const ConstantReturnType>

Definition at line 287 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedLessOrEqualReturnType

using CwiseScalarTypedLessOrEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LE, true>, const Derived, const ConstantReturnType>

Definition at line 288 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedLessReturnType

using CwiseScalarTypedLessReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_LT, true>, const Derived, const ConstantReturnType>

Definition at line 286 of file MatrixCwiseBinaryOps.h.

◆ CwiseScalarTypedNotEqualReturnType

using CwiseScalarTypedNotEqualReturnType = CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_NEQ, true>, const Derived, const ConstantReturnType>

Definition at line 285 of file MatrixCwiseBinaryOps.h.

Function Documentation

◆ cwiseEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise == operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

MatrixXi m(2,2);
m << 1, 0,
1, 1;
cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl;
Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
cout << "Number of coefficients that are equal: " << count << endl;
Matrix3f m
Matrix< int, Dynamic, Dynamic > MatrixXi
Dynamic×Dynamic matrix of type int.
Definition: Matrix.h:500
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82

Output:

Comparing m with identity matrix:
1 1
0 1
Number of coefficients that are equal: 3
See also
cwiseNotEqual(), isApprox(), isMuchSmallerThan()

Definition at line 50 of file MatrixCwiseBinaryOps.h.

51 {
52  return CwiseBinaryEqualReturnType<OtherDerived>(derived(), other.derived());
53 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ >, const Derived, const OtherDerived > CwiseBinaryEqualReturnType

◆ cwiseEqual() [2/2]

const CwiseScalarEqualReturnType cwiseEqual ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise == operator of *this and a scalar s
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().
See also
cwiseEqual(const MatrixBase<OtherDerived> &) const

Definition at line 199 of file MatrixCwiseBinaryOps.h.

200 {
201  return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
202 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ >, const Derived, const ConstantReturnType > CwiseScalarEqualReturnType

◆ cwiseGreater() [1/2]

template<typename OtherDerived >
const CwiseBinaryGreaterReturnType<OtherDerived> cwiseGreater ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise > operator of *this and other

Definition at line 88 of file MatrixCwiseBinaryOps.h.

89 {
90  return CwiseBinaryGreaterReturnType<OtherDerived>(derived(), other.derived());
91 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT >, const Derived, const OtherDerived > CwiseBinaryGreaterReturnType

◆ cwiseGreater() [2/2]

const CwiseScalarGreaterReturnType cwiseGreater ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise > operator of *this and a scalar s

Definition at line 232 of file MatrixCwiseBinaryOps.h.

233 {
234  return CwiseScalarGreaterReturnType(derived(), Derived::Constant(rows(), cols(), s));
235 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT >, const Derived, const ConstantReturnType > CwiseScalarGreaterReturnType

◆ cwiseGreaterOrEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise >= operator of *this and other

Definition at line 106 of file MatrixCwiseBinaryOps.h.

107 {
108  return CwiseBinaryGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
109 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE >, const Derived, const OtherDerived > CwiseBinaryGreaterOrEqualReturnType

◆ cwiseGreaterOrEqual() [2/2]

const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise >= operator of *this and a scalar s

Definition at line 248 of file MatrixCwiseBinaryOps.h.

249 {
250  return CwiseScalarGreaterOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
251 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE >, const Derived, const ConstantReturnType > CwiseScalarGreaterOrEqualReturnType

◆ cwiseLess() [1/2]

template<typename OtherDerived >
const CwiseBinaryLessReturnType<OtherDerived> cwiseLess ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise < operator of *this and other

Definition at line 79 of file MatrixCwiseBinaryOps.h.

80 {
81  return CwiseBinaryLessReturnType<OtherDerived>(derived(), other.derived());
82 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT >, const Derived, const OtherDerived > CwiseBinaryLessReturnType

◆ cwiseLess() [2/2]

const CwiseScalarLessReturnType cwiseLess ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise < operator of *this and a scalar s

Definition at line 224 of file MatrixCwiseBinaryOps.h.

225 {
226  return CwiseScalarLessReturnType(derived(), Derived::Constant(rows(), cols(), s));
227 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT >, const Derived, const ConstantReturnType > CwiseScalarLessReturnType

◆ cwiseLessOrEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryLessOrEqualReturnType<OtherDerived> cwiseLessOrEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise <= operator of *this and other

Definition at line 97 of file MatrixCwiseBinaryOps.h.

98 {
99  return CwiseBinaryLessOrEqualReturnType<OtherDerived>(derived(), other.derived());
100 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE >, const Derived, const OtherDerived > CwiseBinaryLessOrEqualReturnType

◆ cwiseLessOrEqual() [2/2]

const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise <= operator of *this and a scalar s

Definition at line 240 of file MatrixCwiseBinaryOps.h.

241 {
242  return CwiseScalarLessOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
243 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE >, const Derived, const ConstantReturnType > CwiseScalarLessOrEqualReturnType

◆ cwiseMax() [1/2]

template<int NaNPropagation = PropagateFast, typename OtherDerived >
const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived> cwiseMax ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise max of *this and other

Example:

Vector3d v(2,3,4), w(4,2,3);
cout << v.cwiseMax(w) << endl;
Array< int, Dynamic, 1 > v
RowVector3d w
Matrix< double, 3, 1 > Vector3d
3×1 vector of type double.
Definition: Matrix.h:502

Output:

4
3
4
See also
class CwiseBinaryOp, min()

Definition at line 148 of file MatrixCwiseBinaryOps.h.

149 {
150  return CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>(derived(), other.derived());
151 }

◆ cwiseMax() [2/2]

template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp<internal::scalar_max_op<Scalar,Scalar,NaNPropagation>, const Derived, const ConstantReturnType> cwiseMax ( const Scalar &  other) const
inline
Returns
an expression of the coefficient-wise max of *this and scalar other
See also
class CwiseBinaryOp, min()

Definition at line 160 of file MatrixCwiseBinaryOps.h.

161 {
162  return cwiseMax<NaNPropagation>(Derived::Constant(rows(), cols(), other));
163 }

◆ cwiseMin() [1/2]

template<int NaNPropagation = PropagateFast, typename OtherDerived >
const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived> cwiseMin ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise min of *this and other

Example:

Vector3d v(2,3,4), w(4,2,3);
cout << v.cwiseMin(w) << endl;

Output:

2
2
3
See also
class CwiseBinaryOp, max()

Definition at line 121 of file MatrixCwiseBinaryOps.h.

122 {
123  return CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const OtherDerived>(derived(), other.derived());
124 }

◆ cwiseMin() [2/2]

template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp<internal::scalar_min_op<Scalar,Scalar,NaNPropagation>, const Derived, const ConstantReturnType> cwiseMin ( const Scalar &  other) const
inline
Returns
an expression of the coefficient-wise min of *this and scalar other
See also
class CwiseBinaryOp, min()

Definition at line 133 of file MatrixCwiseBinaryOps.h.

134 {
135  return cwiseMin<NaNPropagation>(Derived::Constant(rows(), cols(), other));
136 }

◆ cwiseNotEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryNotEqualReturnType<OtherDerived> cwiseNotEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise != operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

MatrixXi m(2,2);
m << 1, 0,
1, 1;
cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
cout << "Number of coefficients that are not equal: " << count << endl;

Output:

Comparing m with identity matrix:
0 0
1 0
Number of coefficients that are not equal: 1
See also
cwiseEqual(), isApprox(), isMuchSmallerThan()

Definition at line 70 of file MatrixCwiseBinaryOps.h.

71 {
72  return CwiseBinaryNotEqualReturnType<OtherDerived>(derived(), other.derived());
73 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ >, const Derived, const OtherDerived > CwiseBinaryNotEqualReturnType

◆ cwiseNotEqual() [2/2]

const CwiseScalarNotEqualReturnType cwiseNotEqual ( const Scalar &  s) const
inline
Returns
an expression of the coefficient-wise == operator of *this and a scalar s
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().
See also
cwiseEqual(const MatrixBase<OtherDerived> &) const

Definition at line 216 of file MatrixCwiseBinaryOps.h.

217 {
218  return CwiseScalarNotEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
219 }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ >, const Derived, const ConstantReturnType > CwiseScalarNotEqualReturnType

◆ cwiseProduct()

template<typename OtherDerived >
const CwiseBinaryOp< internal::scalar_product_op < Derived ::Scalar, OtherDerived ::Scalar>, const Derived , const OtherDerived > cwiseProduct ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the Schur product (coefficient wise product) of *this and other

Example:

Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random();
Matrix3i c = a.cwiseProduct(b);
cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
Array< int, 3, 1 > b
Array33i c
Matrix< int, 3, 3 > Matrix3i
3×3 matrix of type int.
Definition: Matrix.h:500

Output:

a:
 7  6 -3
-2  9  6
 6 -6 -5
b:
 1 -3  9
 0  0  3
 3  9  5
c:
  7 -18 -27
  0   0  18
 18 -54 -25
See also
class CwiseBinaryOp, cwiseAbs2

Definition at line 23 of file MatrixCwiseBinaryOps.h.

24 {
25  return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,product)(derived(), other.derived());
26 }
#define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS, RHS, OPNAME)
Definition: Macros.h:1182

◆ cwiseQuotient()

template<typename OtherDerived >
const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived> cwiseQuotient ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline
Returns
an expression of the coefficient-wise quotient of *this and other

Example:

Vector3d v(2,3,4), w(4,2,3);
cout << v.cwiseQuotient(w) << endl;

Output:

 0.5
 1.5
1.33
See also
class CwiseBinaryOp, cwiseProduct(), cwiseInverse()

Definition at line 176 of file MatrixCwiseBinaryOps.h.

177 {
178  return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(), other.derived());
179 }

◆ cwiseTypedEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedEqualReturnType<OtherDerived> cwiseTypedEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 262 of file MatrixCwiseBinaryOps.h.

262 { return CwiseBinaryTypedEqualReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ, true >, const Derived, const OtherDerived > CwiseBinaryTypedEqualReturnType

◆ cwiseTypedEqual() [2/2]

const CwiseScalarTypedEqualReturnType cwiseTypedEqual ( const Scalar &  s) const
inline

Definition at line 292 of file MatrixCwiseBinaryOps.h.

292 { return CwiseScalarTypedEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_EQ, true >, const Derived, const ConstantReturnType > CwiseScalarTypedEqualReturnType

◆ cwiseTypedGreater() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedGreaterReturnType<OtherDerived> cwiseTypedGreater ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 274 of file MatrixCwiseBinaryOps.h.

274 { return CwiseBinaryTypedGreaterReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT, true >, const Derived, const OtherDerived > CwiseBinaryTypedGreaterReturnType

◆ cwiseTypedGreater() [2/2]

const CwiseScalarTypedGreaterReturnType cwiseTypedGreater ( const Scalar &  s) const
inline

Definition at line 301 of file MatrixCwiseBinaryOps.h.

301 { return CwiseScalarTypedGreaterReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GT, true >, const Derived, const ConstantReturnType > CwiseScalarTypedGreaterReturnType

◆ cwiseTypedGreaterOrEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived> cwiseTypedGreaterOrEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 282 of file MatrixCwiseBinaryOps.h.

282 { return CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE, true >, const Derived, const OtherDerived > CwiseBinaryTypedGreaterOrEqualReturnType

◆ cwiseTypedGreaterOrEqual() [2/2]

const CwiseScalarTypedGreaterOrEqualReturnType cwiseTypedGreaterOrEqual ( const Scalar &  s) const
inline

Definition at line 307 of file MatrixCwiseBinaryOps.h.

307 { return CwiseScalarTypedGreaterOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_GE, true >, const Derived, const ConstantReturnType > CwiseScalarTypedGreaterOrEqualReturnType

◆ cwiseTypedLess() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedLessReturnType<OtherDerived> cwiseTypedLess ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 270 of file MatrixCwiseBinaryOps.h.

270 { return CwiseBinaryTypedLessReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT, true >, const Derived, const OtherDerived > CwiseBinaryTypedLessReturnType

◆ cwiseTypedLess() [2/2]

const CwiseScalarTypedLessReturnType cwiseTypedLess ( const Scalar &  s) const
inline

Definition at line 298 of file MatrixCwiseBinaryOps.h.

298 { return CwiseScalarTypedLessReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LT, true >, const Derived, const ConstantReturnType > CwiseScalarTypedLessReturnType

◆ cwiseTypedLessOrEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedLessOrEqualReturnType<OtherDerived> cwiseTypedLessOrEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 278 of file MatrixCwiseBinaryOps.h.

278 { return CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE, true >, const Derived, const OtherDerived > CwiseBinaryTypedLessOrEqualReturnType

◆ cwiseTypedLessOrEqual() [2/2]

const CwiseScalarTypedLessOrEqualReturnType cwiseTypedLessOrEqual ( const Scalar &  s) const
inline

Definition at line 304 of file MatrixCwiseBinaryOps.h.

304 { return CwiseScalarTypedLessOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_LE, true >, const Derived, const ConstantReturnType > CwiseScalarTypedLessOrEqualReturnType

◆ cwiseTypedNotEqual() [1/2]

template<typename OtherDerived >
const CwiseBinaryTypedNotEqualReturnType<OtherDerived> cwiseTypedNotEqual ( const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &  other) const
inline

Definition at line 266 of file MatrixCwiseBinaryOps.h.

266 { return CwiseBinaryTypedNotEqualReturnType<OtherDerived>(derived(), other.derived()); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ, true >, const Derived, const OtherDerived > CwiseBinaryTypedNotEqualReturnType

◆ cwiseTypedNotEqual() [2/2]

const CwiseScalarTypedNotEqualReturnType cwiseTypedNotEqual ( const Scalar &  s) const
inline

Definition at line 295 of file MatrixCwiseBinaryOps.h.

295 { return CwiseScalarTypedNotEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s)); }
CwiseBinaryOp< internal::scalar_cmp_op< Scalar, Scalar, internal::cmp_NEQ, true >, const Derived, const ConstantReturnType > CwiseScalarTypedNotEqualReturnType