11 #ifndef EIGEN_CWISE_BINARY_OP_H 12 #define EIGEN_CWISE_BINARY_OP_H 37 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
63 typedef typename Lhs::Nested LhsNested;
64 typedef typename Rhs::Nested RhsNested;
68 LhsCoeffReadCost = _LhsNested::CoeffReadCost,
69 RhsCoeffReadCost = _RhsNested::CoeffReadCost,
70 LhsFlags = _LhsNested::Flags,
71 RhsFlags = _RhsNested::Flags,
74 Flags0 = (
int(LhsFlags) | int(RhsFlags)) & (
76 | (
int(LhsFlags) &
int(RhsFlags) &
84 Cost0 = EIGEN_ADD_COST(LhsCoeffReadCost,RhsCoeffReadCost),
97 #define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \ 98 EIGEN_STATIC_ASSERT((internal::functor_is_product_like<BINOP>::ret \ 99 ? int(internal::scalar_product_traits<LHS, RHS>::Defined) \ 100 : int(internal::is_same<LHS, RHS>::value)), \ 101 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 103 template<
typename BinaryOp,
typename Lhs,
typename Rhs,
typename StorageKind>
106 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
110 typename internal::promote_storage_type<typename internal::traits<Lhs>::StorageKind,
111 typename internal::traits<Rhs>::StorageKind>::ret>
126 EIGEN_STRONG_INLINE
CwiseBinaryOp(
const Lhs& aLhs,
const Rhs& aRhs,
const BinaryOp&
func = BinaryOp())
127 : m_lhs(aLhs), m_rhs(aRhs), m_functor(
func)
131 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs)
132 eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
135 EIGEN_STRONG_INLINE Index rows()
const {
142 EIGEN_STRONG_INLINE Index cols()
const {
151 const _LhsNested&
lhs()
const {
return m_lhs; }
153 const _RhsNested&
rhs()
const {
return m_rhs; }
155 const BinaryOp&
functor()
const {
return m_functor; }
160 const BinaryOp m_functor;
163 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
171 EIGEN_DENSE_PUBLIC_INTERFACE( Derived )
173 EIGEN_STRONG_INLINE
const Scalar coeff(Index rowId, Index colId)
const 175 return derived().functor()(derived().lhs().coeff(rowId, colId),
176 derived().rhs().coeff(rowId, colId));
179 template<
int LoadMode>
180 EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId)
const 182 return derived().functor().packetOp(derived().lhs().
template packet<LoadMode>(rowId, colId),
183 derived().rhs().
template packet<LoadMode>(rowId, colId));
186 EIGEN_STRONG_INLINE
const Scalar coeff(Index index)
const 188 return derived().functor()(derived().lhs().coeff(index),
189 derived().rhs().coeff(index));
192 template<
int LoadMode>
193 EIGEN_STRONG_INLINE PacketScalar packet(Index index)
const 195 return derived().functor().packetOp(derived().lhs().
template packet<LoadMode>(index),
196 derived().rhs().
template packet<LoadMode>(index));
204 template<
typename Derived>
205 template<
typename OtherDerived>
210 tmp = other.derived();
218 template<
typename Derived>
219 template<
typename OtherDerived>
220 EIGEN_STRONG_INLINE Derived &
224 tmp = other.derived();
230 #endif // EIGEN_CWISE_BINARY_OP_H Definition: gtest_unittest.cc:5031
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:53
Definition: XprHelper.h:32
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition: Constants.h:81
Definition: XprHelper.h:350
const _LhsNested & lhs() const
Definition: CwiseBinaryOp.h:151
Definition: CwiseBinaryOp.h:104
const unsigned int AlignedBit
means the first coefficient packet is guaranteed to be aligned
Definition: Constants.h:147
Definition: SelfCwiseBinaryOp.h:45
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:107
const _RhsNested & rhs() const
Definition: CwiseBinaryOp.h:153
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Definition: XprHelper.h:89
The type used to identify a dense storage.
Definition: Constants.h:428
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:117
Definition: ForwardDeclarations.h:17
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48
const BinaryOp & functor() const
Definition: CwiseBinaryOp.h:155