Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType > Class Template Reference

Generic expression where a coefficient-wise binary operator is applied to two expressions. More...

#include <CwiseBinaryOp.h>

+ Inheritance diagram for Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >:

Public Types

typedef internal::remove_all_t< BinaryOp > Functor
 
typedef internal::remove_all_t< LhsType > Lhs
 
typedef internal::remove_all_t< RhsType > Rhs
 
typedef CwiseBinaryOpImpl< BinaryOp, LhsType, RhsType, typename internal::cwise_promote_storage_type< typename internal::traits< LhsType >::StorageKind, typename internal::traits< Rhs >::StorageKind, BinaryOp >::ret >::Base Base
 
typedef internal::ref_selector< LhsType >::type LhsNested
 
typedef internal::ref_selector< RhsType >::type RhsNested
 
typedef std::remove_reference_t< LhsNestedLhsNested_
 
typedef std::remove_reference_t< RhsNestedRhsNested_
 
- Public Types inherited from Eigen::CwiseBinaryOpImpl< BinaryOp, LhsType, RhsType, internal::cwise_promote_storage_type< internal::traits< LhsType >::StorageKind, internal::traits< RhsType >::StorageKind, BinaryOp >::ret >
typedef internal::generic_xpr_base< CwiseBinaryOp< BinaryOp, LhsType, RhsType > >::type Base
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CwiseBinaryOp (const Lhs &aLhs, const Rhs &aRhs, const BinaryOp &func=BinaryOp())
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNested_lhs () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNested_rhs () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const BinaryOp & functor () const
 

Protected Attributes

LhsNested m_lhs
 
RhsNested m_rhs
 
const BinaryOp m_functor
 

Detailed Description

template<typename BinaryOp, typename LhsType, typename RhsType>
class Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >

Generic expression where a coefficient-wise binary operator is applied to two expressions.

Template Parameters
BinaryOptemplate functor implementing the operator
LhsTypethe type of the left-hand side
RhsTypethe type of the right-hand side

This class represents an expression where a coefficient-wise binary operator is applied to two expressions. It is the return type of binary operators, by which we mean only those binary operators where both the left-hand side and the right-hand side are Eigen expressions. For example, the return type of matrix1+matrix2 is a CwiseBinaryOp.

Most of the time, this is the only way that it is used, so you typically don't have to name CwiseBinaryOp types explicitly.

See also
MatrixBase::binaryExpr(const MatrixBase<OtherDerived> &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp

Member Typedef Documentation

◆ Base

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef CwiseBinaryOpImpl< BinaryOp, LhsType, RhsType, typename internal::cwise_promote_storage_type<typename internal::traits<LhsType>::StorageKind, typename internal::traits<Rhs>::StorageKind, BinaryOp>::ret>::Base Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::Base

◆ Functor

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef internal::remove_all_t<BinaryOp> Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::Functor

◆ Lhs

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef internal::remove_all_t<LhsType> Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::Lhs

◆ LhsNested

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef internal::ref_selector<LhsType>::type Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::LhsNested

◆ LhsNested_

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef std::remove_reference_t<LhsNested> Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::LhsNested_

◆ Rhs

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef internal::remove_all_t<RhsType> Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::Rhs

◆ RhsNested

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef internal::ref_selector<RhsType>::type Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::RhsNested

◆ RhsNested_

template<typename BinaryOp , typename LhsType , typename RhsType >
typedef std::remove_reference_t<RhsNested> Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::RhsNested_

Constructor & Destructor Documentation

◆ CwiseBinaryOp()

template<typename BinaryOp , typename LhsType , typename RhsType >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::CwiseBinaryOp ( const Lhs aLhs,
const Rhs aRhs,
const BinaryOp &  func = BinaryOp() 
)
inline
107  : m_lhs(aLhs), m_rhs(aRhs), m_functor(func) {
108  eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols());
109  }
#define eigen_assert(x)
Definition: Macros.h:910
const BinaryOp m_functor
Definition: CwiseBinaryOp.h:132
LhsNested m_lhs
Definition: CwiseBinaryOp.h:130
RhsNested m_rhs
Definition: CwiseBinaryOp.h:131
Definition: benchGeometry.cpp:21

References eigen_assert.

Member Function Documentation

◆ cols()

◆ functor()

template<typename BinaryOp , typename LhsType , typename RhsType >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const BinaryOp& Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::functor ( ) const
inline
Returns
the functor representing the binary operation
127 { return m_functor; }

References Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::m_functor.

◆ lhs()

◆ rhs()

◆ rows()

Member Data Documentation

◆ m_functor

template<typename BinaryOp , typename LhsType , typename RhsType >
const BinaryOp Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::m_functor
protected

◆ m_lhs

template<typename BinaryOp , typename LhsType , typename RhsType >
LhsNested Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::m_lhs
protected

◆ m_rhs

template<typename BinaryOp , typename LhsType , typename RhsType >
RhsNested Eigen::CwiseBinaryOp< BinaryOp, LhsType, RhsType >::m_rhs
protected

The documentation for this class was generated from the following file: