12#ifndef EIGEN_CWISE_TERNARY_OP_H
13#define EIGEN_CWISE_TERNARY_OP_H
18template <
typename TernaryOp,
typename Arg1,
typename Arg2,
typename Arg3>
22 typedef typename remove_all<Arg1>::type Ancestor;
35 const typename Arg1::Scalar&,
const typename Arg2::Scalar&,
36 const typename Arg3::Scalar&)>::type Scalar;
41 typedef typename Arg1::Nested Arg1Nested;
42 typedef typename Arg2::Nested Arg2Nested;
43 typedef typename Arg3::Nested Arg3Nested;
44 typedef typename remove_reference<Arg1Nested>::type _Arg1Nested;
45 typedef typename remove_reference<Arg2Nested>::type _Arg2Nested;
46 typedef typename remove_reference<Arg3Nested>::type _Arg3Nested;
51template <
typename TernaryOp,
typename Arg1,
typename Arg2,
typename Arg3,
85 TernaryOp, Arg1Type, Arg2Type, Arg3Type,
86 typename internal::traits<Arg1Type>::StorageKind>,
90 typedef typename internal::remove_all<Arg1Type>::type Arg1;
91 typedef typename internal::remove_all<Arg2Type>::type Arg2;
92 typedef typename internal::remove_all<Arg3Type>::type Arg3;
102 typedef typename internal::remove_reference<Arg1Nested>::type _Arg1Nested;
103 typedef typename internal::remove_reference<Arg2Nested>::type _Arg2Nested;
104 typedef typename internal::remove_reference<Arg3Nested>::type _Arg3Nested;
110 : m_arg1(
a1), m_arg2(
a2), m_arg3(
a3), m_functor(func) {
112 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg2)
113 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg3)
119 STORAGE_KIND_MUST_MATCH)
123 STORAGE_KIND_MUST_MATCH)
125 eigen_assert(
a1.rows() ==
a2.rows() &&
a1.cols() ==
a2.cols() &&
126 a1.rows() ==
a3.rows() &&
a1.cols() ==
a3.cols());
130 EIGEN_STRONG_INLINE
Index rows()
const {
134 RowsAtCompileTime ==
Dynamic &&
137 return m_arg3.rows();
138 else if (
internal::traits<
typename internal::remove_all<Arg1Nested>::type>::
139 RowsAtCompileTime ==
Dynamic &&
142 return m_arg2.rows();
144 return m_arg1.rows();
147 EIGEN_STRONG_INLINE
Index cols()
const {
151 ColsAtCompileTime ==
Dynamic &&
154 return m_arg3.cols();
155 else if (
internal::traits<
typename internal::remove_all<Arg1Nested>::type>::
156 ColsAtCompileTime ==
Dynamic &&
159 return m_arg2.cols();
161 return m_arg1.cols();
166 const _Arg1Nested&
arg1()
const {
return m_arg1; }
169 const _Arg2Nested&
arg2()
const {
return m_arg2; }
172 const _Arg3Nested&
arg3()
const {
return m_arg3; }
185template <
typename TernaryOp,
typename Arg1,
typename Arg2,
typename Arg3,
186 typename StorageKind>
189 CwiseTernaryOp<TernaryOp, Arg1, Arg2, Arg3> >::type {
Definition CwiseTernaryOp.h:189
Generic expression where a coefficient-wise ternary operator is applied to two expressions.
Definition CwiseTernaryOp.h:88
EIGEN_DEVICE_FUNC const _Arg1Nested & arg1() const
Definition CwiseTernaryOp.h:166
EIGEN_DEVICE_FUNC const _Arg2Nested & arg2() const
Definition CwiseTernaryOp.h:169
EIGEN_DEVICE_FUNC const _Arg3Nested & arg3() const
Definition CwiseTernaryOp.h:172
EIGEN_DEVICE_FUNC const TernaryOp & functor() const
Definition CwiseTernaryOp.h:175
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Definition XprHelper.h:110
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Definition XprHelper.h:501
Definition ForwardDeclarations.h:17