10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_EXPR_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_EXPR_H 31 template<
typename NullaryOp,
typename XprType>
36 typedef typename XprType::Scalar Scalar;
37 typedef typename XprType::Nested XprTypeNested;
39 static const int NumDimensions = XprTraits::NumDimensions;
40 static const int Layout = XprTraits::Layout;
51 template<
typename NullaryOp,
typename XprType>
57 typedef typename XprType::CoeffReturnType CoeffReturnType;
63 : m_xpr(xpr), m_functor(
func) {}
67 nestedExpression()
const {
return m_xpr; }
70 const NullaryOp& functor()
const {
return m_functor; }
73 typename XprType::Nested m_xpr;
74 const NullaryOp m_functor;
80 template<
typename UnaryOp,
typename XprType>
88 typedef typename XprType::Nested XprTypeNested;
90 static const int NumDimensions = XprTraits::NumDimensions;
91 static const int Layout = XprTraits::Layout;
94 template<
typename UnaryOp,
typename XprType>
100 template<
typename UnaryOp,
typename XprType>
110 template<
typename UnaryOp,
typename XprType>
118 typedef Scalar CoeffReturnType;
123 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
TensorCwiseUnaryOp(
const XprType& xpr,
const UnaryOp&
func = UnaryOp())
124 : m_xpr(xpr), m_functor(
func) {}
127 const UnaryOp& functor()
const {
return m_functor; }
135 typename XprType::Nested m_xpr;
136 const UnaryOp m_functor;
141 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
149 BinaryOp(
typename LhsXprType::Scalar,
150 typename RhsXprType::Scalar)>::type Scalar;
158 typedef typename LhsXprType::Nested LhsNested;
159 typedef typename RhsXprType::Nested RhsNested;
162 static const int NumDimensions = XprTraits::NumDimensions;
163 static const int Layout = XprTraits::Layout;
170 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
176 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
186 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
194 typedef Scalar CoeffReturnType;
199 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
TensorCwiseBinaryOp(
const LhsXprType& lhs,
const RhsXprType& rhs,
const BinaryOp&
func = BinaryOp())
200 : m_lhs_xpr(lhs), m_rhs_xpr(rhs), m_functor(
func) {}
203 const BinaryOp& functor()
const {
return m_functor; }
212 rhsExpression()
const {
return m_rhs_xpr; }
215 typename LhsXprType::Nested m_lhs_xpr;
216 typename RhsXprType::Nested m_rhs_xpr;
217 const BinaryOp m_functor;
222 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
227 TernaryOp(
typename Arg1XprType::Scalar,
228 typename Arg2XprType::Scalar,
229 typename Arg3XprType::Scalar)>::type Scalar;
233 typedef typename Arg1XprType::Nested Arg1Nested;
234 typedef typename Arg2XprType::Nested Arg2Nested;
235 typedef typename Arg3XprType::Nested Arg3Nested;
239 static const int NumDimensions = XprTraits::NumDimensions;
240 static const int Layout = XprTraits::Layout;
247 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
253 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
263 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
269 typedef Scalar CoeffReturnType;
274 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
TensorCwiseTernaryOp(
const Arg1XprType& arg1,
const Arg2XprType& arg2,
const Arg3XprType& arg3,
const TernaryOp&
func = TernaryOp())
275 : m_arg1_xpr(arg1), m_arg2_xpr(arg2), m_arg3_xpr(arg3), m_functor(
func) {}
278 const TernaryOp& functor()
const {
return m_functor; }
287 arg2Expression()
const {
return m_arg2_xpr; }
291 arg3Expression()
const {
return m_arg3_xpr; }
294 typename Arg1XprType::Nested m_arg1_xpr;
295 typename Arg2XprType::Nested m_arg2_xpr;
296 typename Arg3XprType::Nested m_arg3_xpr;
297 const TernaryOp m_functor;
302 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
312 typedef typename IfXprType::Nested IfNested;
313 typedef typename ThenXprType::Nested ThenNested;
314 typedef typename ElseXprType::Nested ElseNested;
315 static const int NumDimensions = XprTraits::NumDimensions;
316 static const int Layout = XprTraits::Layout;
319 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
325 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
334 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
341 typename ElseXprType::CoeffReturnType>::ret CoeffReturnType;
348 const ThenXprType& a_then,
349 const ElseXprType& a_else)
350 : m_condition(a_condition), m_then(a_then), m_else(a_else)
354 const IfXprType& ifExpression()
const {
return m_condition; }
357 const ThenXprType& thenExpression()
const {
return m_then; }
360 const ElseXprType& elseExpression()
const {
return m_else; }
363 typename IfXprType::Nested m_condition;
364 typename ThenXprType::Nested m_then;
365 typename ElseXprType::Nested m_else;
371 #endif // EIGEN_CXX11_TENSOR_TENSOR_EXPR_H Definition: TensorExpr.h:187
Definition: TensorExpr.h:111
EIGEN_DEVICE_FUNC const internal::remove_all< typename LhsXprType::Nested >::type & lhsExpression() const
Definition: TensorExpr.h:208
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
EIGEN_DEVICE_FUNC const internal::remove_all< typename Arg1XprType::Nested >::type & arg1Expression() const
Definition: TensorExpr.h:283
Definition: TensorExpr.h:264
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
The tensor base class.
Definition: TensorBase.h:827
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Definition: TensorExpr.h:335
Definition: TensorTraits.h:170
The type used to identify a dense storage.
Definition: Constants.h:491
Definition: TensorExpr.h:52
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:312
EIGEN_DEVICE_FUNC const internal::remove_all< typename XprType::Nested >::type & nestedExpression() const
Definition: TensorExpr.h:132