Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type > Class Template Reference

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

+ Inheritance diagram for Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >:

Public Types

typedef internal::remove_all_t< Arg1Type > Arg1
 
typedef std::remove_reference_t< Arg1NestedArg1Nested_
 
typedef internal::remove_all_t< Arg2Type > Arg2
 
typedef internal::ref_selector< Arg2Type >::type Arg2Nested
 
typedef std::remove_reference_t< Arg2NestedArg2Nested_
 
typedef internal::remove_all_t< Arg3Type > Arg3
 
typedef internal::ref_selector< Arg3Type >::type Arg3Nested
 
typedef std::remove_reference_t< Arg3NestedArg3Nested_
 

Public Member Functions

const Arg1Nested_arg1 () const
 
const Arg2Nested_arg2 () const
 
const Arg3Nested_arg3 () const
 
Index cols () const
 
 CwiseTernaryOp (const Arg1 &a1, const Arg2 &a2, const Arg3 &a3, const TernaryOp &func=TernaryOp())
 
const TernaryOp & functor () const
 
Index rows () const
 

Public Attributes

EIGEN_STATIC_ASSERT((internal::is_same< typename internal::traits< Arg1Type >::StorageKind, typename internal::traits< Arg2Type >::StorageKind >::value), STORAGE_KIND_MUST_MATCH) EIGEN_STATIC_ASSERT((internal typedef internal::ref_selector< Arg1Type >::type Arg1Nested
 

Protected Attributes

Arg1Nested m_arg1
 
Arg2Nested m_arg2
 
Arg3Nested m_arg3
 
const TernaryOp m_functor
 

Detailed Description

template<typename TernaryOp, typename Arg1Type, typename Arg2Type, typename Arg3Type>
class Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >

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

Template Parameters
TernaryOptemplate functor implementing the operator
Arg1Typethe type of the first argument
Arg2Typethe type of the second argument
Arg3Typethe type of the third argument

This class represents an expression where a coefficient-wise ternary operator is applied to three expressions. It is the return type of ternary operators, by which we mean only those ternary operators where all three arguments are Eigen expressions. For example, the return type of betainc(matrix1, matrix2, matrix3) is a CwiseTernaryOp.

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

See also
MatrixBase::ternaryExpr(const MatrixBase<Argument2> &, const MatrixBase<Argument3> &, const CustomTernaryOp &) const, class CwiseBinaryOp, class CwiseUnaryOp, class CwiseNullaryOp

Definition at line 86 of file CwiseTernaryOp.h.

Member Typedef Documentation

◆ Arg1

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef internal::remove_all_t<Arg1Type> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg1

Definition at line 92 of file CwiseTernaryOp.h.

◆ Arg1Nested_

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef std::remove_reference_t<Arg1Nested> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg1Nested_

Definition at line 118 of file CwiseTernaryOp.h.

◆ Arg2

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef internal::remove_all_t<Arg2Type> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg2

Definition at line 93 of file CwiseTernaryOp.h.

◆ Arg2Nested

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef internal::ref_selector<Arg2Type>::type Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg2Nested

Definition at line 116 of file CwiseTernaryOp.h.

◆ Arg2Nested_

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef std::remove_reference_t<Arg2Nested> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg2Nested_

Definition at line 119 of file CwiseTernaryOp.h.

◆ Arg3

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef internal::remove_all_t<Arg3Type> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg3

Definition at line 94 of file CwiseTernaryOp.h.

◆ Arg3Nested

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef internal::ref_selector<Arg3Type>::type Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg3Nested

Definition at line 117 of file CwiseTernaryOp.h.

◆ Arg3Nested_

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
typedef std::remove_reference_t<Arg3Nested> Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg3Nested_

Definition at line 120 of file CwiseTernaryOp.h.

Constructor & Destructor Documentation

◆ CwiseTernaryOp()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::CwiseTernaryOp ( const Arg1 a1,
const Arg2 a2,
const Arg3 a3,
const TernaryOp &  func = TernaryOp() 
)
inline

Definition at line 123 of file CwiseTernaryOp.h.

126  : m_arg1(a1), m_arg2(a2), m_arg3(a3), m_functor(func) {
127  eigen_assert(a1.rows() == a2.rows() && a1.cols() == a2.cols() &&
128  a1.rows() == a3.rows() && a1.cols() == a3.cols());
129  }
#define eigen_assert(x)
Definition: Macros.h:902
const TernaryOp m_functor

Member Function Documentation

◆ arg1()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
const Arg1Nested_& Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::arg1 ( ) const
inline
Returns
the first argument nested expression

Definition at line 168 of file CwiseTernaryOp.h.

168 { return m_arg1; }

◆ arg2()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
const Arg2Nested_& Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::arg2 ( ) const
inline
Returns
the first argument nested expression

Definition at line 171 of file CwiseTernaryOp.h.

171 { return m_arg2; }

◆ arg3()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
const Arg3Nested_& Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::arg3 ( ) const
inline
Returns
the third argument nested expression

Definition at line 174 of file CwiseTernaryOp.h.

174 { return m_arg3; }

◆ cols()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Index Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::cols ( ) const
inline

Definition at line 149 of file CwiseTernaryOp.h.

149  {
150  // return the fixed size type if available to enable compile time
151  // optimizations
152  if (internal::traits<internal::remove_all_t<Arg1Nested>>::
153  ColsAtCompileTime == Dynamic &&
154  internal::traits<internal::remove_all_t<Arg2Nested>>::
155  ColsAtCompileTime == Dynamic)
156  return m_arg3.cols();
157  else if (internal::traits<internal::remove_all_t<Arg1Nested>>::
158  ColsAtCompileTime == Dynamic &&
159  internal::traits<internal::remove_all_t<Arg3Nested>>::
160  ColsAtCompileTime == Dynamic)
161  return m_arg2.cols();
162  else
163  return m_arg1.cols();
164  }
const int Dynamic
Definition: Constants.h:24

◆ functor()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
const TernaryOp& Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::functor ( ) const
inline
Returns
the functor representing the ternary operation

Definition at line 177 of file CwiseTernaryOp.h.

177 { return m_functor; }

◆ rows()

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Index Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::rows ( ) const
inline

Definition at line 132 of file CwiseTernaryOp.h.

132  {
133  // return the fixed size type if available to enable compile time
134  // optimizations
135  if (internal::traits<internal::remove_all_t<Arg1Nested>>::
136  RowsAtCompileTime == Dynamic &&
137  internal::traits<internal::remove_all_t<Arg2Nested>>::
138  RowsAtCompileTime == Dynamic)
139  return m_arg3.rows();
140  else if (internal::traits<internal::remove_all_t<Arg1Nested>>::
141  RowsAtCompileTime == Dynamic &&
142  internal::traits<internal::remove_all_t<Arg3Nested>>::
143  RowsAtCompileTime == Dynamic)
144  return m_arg2.rows();
145  else
146  return m_arg1.rows();
147  }

Member Data Documentation

◆ Arg1Nested

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
EIGEN_STATIC_ASSERT ((internal::is_same< typename internal::traits<Arg1Type>::StorageKind, typename internal::traits<Arg2Type>::StorageKind>::value), STORAGE_KIND_MUST_MATCH) EIGEN_STATIC_ASSERT((internal typedef internal::ref_selector<Arg1Type>::type Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::Arg1Nested

Definition at line 115 of file CwiseTernaryOp.h.

◆ m_arg1

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Arg1Nested Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::m_arg1
protected

Definition at line 180 of file CwiseTernaryOp.h.

◆ m_arg2

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Arg2Nested Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::m_arg2
protected

Definition at line 181 of file CwiseTernaryOp.h.

◆ m_arg3

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
Arg3Nested Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::m_arg3
protected

Definition at line 182 of file CwiseTernaryOp.h.

◆ m_functor

template<typename TernaryOp , typename Arg1Type , typename Arg2Type , typename Arg3Type >
const TernaryOp Eigen::CwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type >::m_functor
protected

Definition at line 183 of file CwiseTernaryOp.h.


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