11 #ifndef EIGEN_CWISE_BINARY_OP_H
12 #define EIGEN_CWISE_BINARY_OP_H
19 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
20 struct traits<CwiseBinaryOp<
BinaryOp, Lhs, Rhs> >
24 typedef remove_all_t<Lhs> Ancestor;
25 typedef typename traits<Ancestor>::XprKind XprKind;
27 RowsAtCompileTime = traits<Ancestor>::RowsAtCompileTime,
28 ColsAtCompileTime = traits<Ancestor>::ColsAtCompileTime,
29 MaxRowsAtCompileTime = traits<Ancestor>::MaxRowsAtCompileTime,
30 MaxColsAtCompileTime = traits<Ancestor>::MaxColsAtCompileTime
35 typedef typename result_of<
37 const typename Lhs::Scalar&,
38 const typename Rhs::Scalar&
41 typedef typename cwise_promote_storage_type<typename traits<Lhs>::StorageKind,
42 typename traits<Rhs>::StorageKind,
44 typedef typename promote_index_type<typename traits<Lhs>::StorageIndex,
45 typename traits<Rhs>::StorageIndex>::type StorageIndex;
46 typedef typename Lhs::Nested LhsNested;
47 typedef typename Rhs::Nested RhsNested;
48 typedef std::remove_reference_t<LhsNested> LhsNested_;
49 typedef std::remove_reference_t<RhsNested> RhsNested_;
51 Flags = cwise_promote_storage_order<typename traits<Lhs>::StorageKind,
typename traits<Rhs>::StorageKind,LhsNested_::Flags &
RowMajorBit,RhsNested_::Flags &
RowMajorBit>::value
56 template<
typename BinaryOp,
typename Lhs,
typename Rhs,
typename StorageKind>
57 class CwiseBinaryOpImpl;
78 template<
typename BinaryOp,
typename LhsType,
typename RhsType>
81 BinaryOp, LhsType, RhsType,
82 typename internal::cwise_promote_storage_type<typename internal::traits<LhsType>::StorageKind,
83 typename internal::traits<RhsType>::StorageKind,
85 internal::no_assignment_operator
95 typename internal::cwise_promote_storage_type<typename internal::traits<LhsType>::StorageKind,
96 typename internal::traits<Rhs>::StorageKind,
118 eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
124 return internal::traits<internal::remove_all_t<LhsNested>>::RowsAtCompileTime==
Dynamic ?
m_rhs.rows() :
m_lhs.rows();
129 return internal::traits<internal::remove_all_t<LhsNested>>::ColsAtCompileTime==
Dynamic ?
m_rhs.cols() :
m_lhs.cols();
149 template<
typename BinaryOp,
typename Lhs,
typename Rhs,
typename StorageKind>
151 :
public internal::generic_xpr_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type
154 typedef typename internal::generic_xpr_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type
Base;
161 template<
typename Derived>
162 template<
typename OtherDerived>
166 call_assignment(derived(), other.
derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
174 template<
typename Derived>
175 template<
typename OtherDerived>
179 call_assignment(derived(), other.
derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
#define EIGEN_DEVICE_FUNC
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
internal::generic_xpr_base< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::type Base
Generic expression where a coefficient-wise binary operator is applied to two expressions.
std::remove_reference_t< LhsNested > LhsNested_
std::remove_reference_t< RhsNested > RhsNested_
internal::ref_selector< LhsType >::type LhsNested
internal::remove_all_t< LhsType > Lhs
internal::ref_selector< RhsType >::type RhsNested
internal::remove_all_t< RhsType > Rhs
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
const LhsNested_ & lhs() const
const RhsNested_ & rhs() const
const BinaryOp & functor() const
CwiseBinaryOpImpl< BinaryOp, LhsType, RhsType, typename internal::cwise_promote_storage_type< typename internal::traits< LhsType >::StorageKind, typename internal::traits< Rhs >::StorageKind, BinaryOp >::ret >::Base Base
internal::remove_all_t< BinaryOp > Functor
CwiseBinaryOp(const Lhs &aLhs, const Rhs &aRhs, const BinaryOp &func=BinaryOp())
Base class for all dense matrices, vectors, and expressions.
Derived & operator-=(const MatrixBase< OtherDerived > &other)
Derived & operator+=(const MatrixBase< OtherDerived > &other)
const unsigned int RowMajorBit
void call_assignment(Dst &dst, const Src &src)
typename remove_all< T >::type remove_all_t
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.