11 #ifndef EIGEN_XPRHELPER_H 12 #define EIGEN_XPRHELPER_H 17 #if EIGEN_COMP_GNUC && !EIGEN_GNUC_AT(4,3) 18 #define EIGEN_EMPTY_STRUCT_CTOR(X) \ 19 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X() {} \ 20 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X(const X& ) {} 22 #define EIGEN_EMPTY_STRUCT_CTOR(X) 29 template<
typename IndexDest,
typename IndexSrc>
31 inline IndexDest convert_index(
const IndexSrc& idx) {
33 eigen_internal_assert(idx <= NumTraits<IndexDest>::highest() &&
"Index value to big for target type");
34 return IndexDest(idx);
38 template<
typename T>
struct is_valid_index_type
41 #if EIGEN_HAS_TYPE_TRAITS 42 internal::is_integral<T>::value || std::is_enum<T>::value
44 internal::is_integral<T>::value || __is_enum(T)
47 internal::is_convertible<T,Index>::value && !internal::is_same<T,float>::value && !is_same<T,double>::value
53 template<
typename RowIndices,
typename ColIndices>
54 struct valid_indexed_view_overload {
55 enum { value = !(internal::is_valid_index_type<RowIndices>::value && internal::is_valid_index_type<ColIndices>::value) };
67 template<
typename ExprScalar,
typename T,
bool IsSupported>
68 struct promote_scalar_arg;
70 template<
typename S,
typename T>
71 struct promote_scalar_arg<S,T,true>
77 template<
typename ExprScalar,
typename T,
typename PromotedType,
78 bool ConvertibleToLiteral = internal::is_convertible<T,PromotedType>::value,
79 bool IsSafe = NumTraits<T>::IsInteger || !NumTraits<PromotedType>::IsInteger>
80 struct promote_scalar_arg_unsupported;
83 template<
typename S,
typename T>
84 struct promote_scalar_arg<S,T,false> : promote_scalar_arg_unsupported<S,T,typename NumTraits<S>::Literal> {};
87 template<
typename S,
typename T,
typename PromotedType>
88 struct promote_scalar_arg_unsupported<S,T,PromotedType,true,true>
90 typedef PromotedType type;
95 template<
typename ExprScalar,
typename T,
typename PromotedType>
96 struct promote_scalar_arg_unsupported<ExprScalar,T,PromotedType,false,true>
97 : promote_scalar_arg_unsupported<ExprScalar,T,ExprScalar>
101 template<
typename S,
typename T,
typename PromotedType,
bool ConvertibleToLiteral>
102 struct promote_scalar_arg_unsupported<S,T,PromotedType,ConvertibleToLiteral,false> {};
105 template<
typename S,
typename T>
106 struct promote_scalar_arg_unsupported<S,T,S,false,true> {};
109 class no_assignment_operator
112 no_assignment_operator& operator=(
const no_assignment_operator&);
114 EIGEN_DEFAULT_COPY_CONSTRUCTOR(no_assignment_operator)
115 EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(no_assignment_operator)
119 template<
typename I1,
typename I2>
120 struct promote_index_type
122 typedef typename conditional<(sizeof(I1)<sizeof(I2)), I2, I1>::type type;
129 template<
typename T,
int Value>
class variable_if_dynamic
132 EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(variable_if_dynamic)
133 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit variable_if_dynamic(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
134 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
135 T value() {
return T(Value); }
136 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
137 operator T()
const {
return T(Value); }
138 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
139 void setValue(T v)
const { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
142 template<
typename T>
class variable_if_dynamic<T,
Dynamic>
146 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit variable_if_dynamic(T value = 0) EIGEN_NO_THROW : m_value(value) {}
147 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T value()
const {
return m_value; }
148 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
operator T()
const {
return m_value; }
149 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void setValue(T value) { m_value = value; }
154 template<
typename T,
int Value>
class variable_if_dynamicindex
157 EIGEN_EMPTY_STRUCT_CTOR(variable_if_dynamicindex)
158 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit variable_if_dynamicindex(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); }
159 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
160 T value() {
return T(Value); }
161 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
165 template<
typename T>
class variable_if_dynamicindex<T,
DynamicIndex>
168 EIGEN_DEVICE_FUNC variable_if_dynamicindex() { eigen_assert(
false); }
170 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit variable_if_dynamicindex(T value) : m_value(value) {}
171 EIGEN_DEVICE_FUNC T EIGEN_STRONG_INLINE value()
const {
return m_value; }
172 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void setValue(T value) { m_value = value; }
175 template<
typename T>
struct functor_traits
180 PacketAccess =
false,
185 template<
typename T>
struct packet_traits;
187 template<
typename T>
struct unpacket_traits;
189 template<
int Size,
typename PacketType,
190 bool Stop = Size==
Dynamic || (Size%unpacket_traits<PacketType>::size)==0 || is_same<PacketType,
typename unpacket_traits<PacketType>::half>::value>
191 struct find_best_packet_helper;
193 template<
int Size,
typename PacketType>
194 struct find_best_packet_helper<Size,PacketType,true>
196 typedef PacketType type;
199 template<
int Size,
typename PacketType>
200 struct find_best_packet_helper<Size,PacketType,false>
202 typedef typename find_best_packet_helper<Size,typename unpacket_traits<PacketType>::half>::type type;
205 template<
typename T,
int Size>
206 struct find_best_packet
208 typedef typename find_best_packet_helper<Size,typename packet_traits<T>::type>::type type;
211 #if EIGEN_MAX_STATIC_ALIGN_BYTES>0 212 template<
int ArrayBytes,
int AlignmentBytes,
213 bool Match = bool((ArrayBytes%AlignmentBytes)==0),
214 bool TryHalf = bool(EIGEN_MIN_ALIGN_BYTES<AlignmentBytes) >
215 struct compute_default_alignment_helper
220 template<
int ArrayBytes,
int AlignmentBytes,
bool TryHalf>
221 struct compute_default_alignment_helper<ArrayBytes, AlignmentBytes, true, TryHalf>
223 enum { value = AlignmentBytes };
226 template<
int ArrayBytes,
int AlignmentBytes>
227 struct compute_default_alignment_helper<ArrayBytes, AlignmentBytes, false, true>
230 enum { value = compute_default_alignment_helper<ArrayBytes, AlignmentBytes/2>::value };
235 template<
int ArrayBytes,
int AlignmentBytes>
236 struct compute_default_alignment_helper
242 template<
typename T,
int Size>
struct compute_default_alignment {
243 enum { value = compute_default_alignment_helper<Size*sizeof(T),EIGEN_MAX_STATIC_ALIGN_BYTES>::value };
246 template<
typename T>
struct compute_default_alignment<T,
Dynamic> {
247 enum { value = EIGEN_MAX_ALIGN_BYTES };
250 template<
typename _Scalar,
int _Rows,
int _Cols,
254 : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION ),
255 int _MaxRows = _Rows,
257 >
class make_proper_matrix_type
260 IsColVector = _Cols==1 && _Rows!=1,
261 IsRowVector = _Rows==1 && _Cols!=1,
267 typedef Matrix<_Scalar, _Rows, _Cols, Options, _MaxRows, _MaxCols> type;
270 template<
typename Scalar,
int Rows,
int Cols,
int Options,
int MaxRows,
int MaxCols>
271 class compute_matrix_flags
281 template<
int _Rows,
int _Cols>
struct size_at_compile_time
286 template<
typename XprType>
struct size_of_xpr_at_compile_time
288 enum { ret = size_at_compile_time<traits<XprType>::RowsAtCompileTime,traits<XprType>::ColsAtCompileTime>::ret };
295 template<typename T, typename StorageKind = typename traits<T>::StorageKind>
struct plain_matrix_type;
296 template<
typename T,
typename BaseClassType,
int Flags>
struct plain_matrix_type_dense;
297 template<
typename T>
struct plain_matrix_type<T,Dense>
299 typedef typename plain_matrix_type_dense<T,typename traits<T>::XprKind, traits<T>::Flags>::type type;
301 template<
typename T>
struct plain_matrix_type<T,DiagonalShape>
303 typedef typename T::PlainObject type;
306 template<
typename T,
int Flags>
struct plain_matrix_type_dense<T,MatrixXpr,Flags>
308 typedef Matrix<typename traits<T>::Scalar,
309 traits<T>::RowsAtCompileTime,
310 traits<T>::ColsAtCompileTime,
312 traits<T>::MaxRowsAtCompileTime,
313 traits<T>::MaxColsAtCompileTime
317 template<
typename T,
int Flags>
struct plain_matrix_type_dense<T,ArrayXpr,Flags>
319 typedef Array<typename traits<T>::Scalar,
320 traits<T>::RowsAtCompileTime,
321 traits<T>::ColsAtCompileTime,
323 traits<T>::MaxRowsAtCompileTime,
324 traits<T>::MaxColsAtCompileTime
332 template<typename T, typename StorageKind = typename traits<T>::StorageKind>
struct eval;
334 template<
typename T>
struct eval<T,Dense>
336 typedef typename plain_matrix_type<T>::type type;
347 template<
typename T>
struct eval<T,DiagonalShape>
349 typedef typename plain_matrix_type<T>::type type;
353 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
354 struct eval<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, Dense>
356 typedef const Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& type;
359 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
360 struct eval<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, Dense>
362 typedef const Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& type;
367 template<typename T, typename StorageKind = typename traits<T>::StorageKind>
struct plain_object_eval;
370 struct plain_object_eval<T,Dense>
372 typedef typename plain_matrix_type_dense<T,typename traits<T>::XprKind, evaluator<T>::Flags>::type type;
378 template<
typename T>
struct plain_matrix_type_column_major
380 enum { Rows = traits<T>::RowsAtCompileTime,
381 Cols = traits<T>::ColsAtCompileTime,
382 MaxRows = traits<T>::MaxRowsAtCompileTime,
383 MaxCols = traits<T>::MaxColsAtCompileTime
385 typedef Matrix<typename traits<T>::Scalar,
396 template<
typename T>
struct plain_matrix_type_row_major
398 enum { Rows = traits<T>::RowsAtCompileTime,
399 Cols = traits<T>::ColsAtCompileTime,
400 MaxRows = traits<T>::MaxRowsAtCompileTime,
401 MaxCols = traits<T>::MaxColsAtCompileTime
403 typedef Matrix<typename traits<T>::Scalar,
415 template <
typename T>
418 typedef typename conditional<
419 bool(traits<T>::Flags & NestByRefBit),
424 typedef typename conditional<
425 bool(traits<T>::Flags & NestByRefBit),
428 >::type non_const_type;
432 template<
typename T1,
typename T2>
433 struct transfer_constness
435 typedef typename conditional<
436 bool(internal::is_const<T1>::value),
437 typename internal::add_const_on_value_type<T2>::type,
457 template<typename T, int n, typename PlainObject = typename plain_object_eval<T>::type>
struct nested_eval
460 ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost,
461 CoeffReadCost = evaluator<T>::CoeffReadCost,
467 CostEval = (NAsInteger+1) * ScalarReadCost + CoeffReadCost,
468 CostNoEval = NAsInteger * CoeffReadCost,
469 Evaluate = (
int(evaluator<T>::Flags) &
EvalBeforeNestingBit) || (
int(CostEval) < int(CostNoEval))
472 typedef typename conditional<Evaluate, PlainObject, typename ref_selector<T>::type>::type type;
477 inline T* const_cast_ptr(
const T* ptr)
479 return const_cast<T*
>(ptr);
482 template<typename Derived, typename XprKind = typename traits<Derived>::XprKind>
483 struct dense_xpr_base
488 template<
typename Derived>
489 struct dense_xpr_base<Derived, MatrixXpr>
491 typedef MatrixBase<Derived> type;
494 template<
typename Derived>
495 struct dense_xpr_base<Derived, ArrayXpr>
497 typedef ArrayBase<Derived> type;
500 template<typename Derived, typename XprKind = typename traits<Derived>::XprKind,
typename StorageKind =
typename traits<Derived>::StorageKind>
501 struct generic_xpr_base;
503 template<
typename Derived,
typename XprKind>
504 struct generic_xpr_base<Derived, XprKind, Dense>
506 typedef typename dense_xpr_base<Derived,XprKind>::type type;
509 template<
typename XprType,
typename CastType>
struct cast_return_type
511 typedef typename XprType::Scalar CurrentScalarType;
512 typedef typename remove_all<CastType>::type _CastType;
513 typedef typename _CastType::Scalar NewScalarType;
514 typedef typename conditional<is_same<CurrentScalarType,NewScalarType>::value,
515 const XprType&,CastType>::type type;
518 template <
typename A,
typename B>
struct promote_storage_type;
520 template <
typename A>
struct promote_storage_type<A,A>
524 template <
typename A>
struct promote_storage_type<A, const A>
528 template <
typename A>
struct promote_storage_type<const A, A>
546 template <
typename A,
typename B,
typename Functor>
struct cwise_promote_storage_type;
548 template <
typename A,
typename Functor>
struct cwise_promote_storage_type<A,A,Functor> {
typedef A ret; };
549 template <
typename Functor>
struct cwise_promote_storage_type<Dense,Dense,Functor> {
typedef Dense ret; };
550 template <
typename A,
typename Functor>
struct cwise_promote_storage_type<A,Dense,Functor> {
typedef Dense ret; };
551 template <
typename B,
typename Functor>
struct cwise_promote_storage_type<Dense,B,Functor> {
typedef Dense ret; };
552 template <
typename Functor>
struct cwise_promote_storage_type<Sparse,Dense,Functor> {
typedef Sparse ret; };
553 template <
typename Functor>
struct cwise_promote_storage_type<Dense,Sparse,Functor> {
typedef Sparse ret; };
555 template <
typename LhsKind,
typename RhsKind,
int LhsOrder,
int RhsOrder>
struct cwise_promote_storage_order {
556 enum { value = LhsOrder };
559 template <
typename LhsKind,
int LhsOrder,
int RhsOrder>
struct cwise_promote_storage_order<LhsKind,Sparse,LhsOrder,RhsOrder> {
enum { value = RhsOrder }; };
560 template <
typename RhsKind,
int LhsOrder,
int RhsOrder>
struct cwise_promote_storage_order<Sparse,RhsKind,LhsOrder,RhsOrder> {
enum { value = LhsOrder }; };
561 template <
int Order>
struct cwise_promote_storage_order<Sparse,Sparse,Order,Order> {
enum { value = Order }; };
578 template <
typename A,
typename B,
int ProductTag>
struct product_promote_storage_type;
580 template <
typename A,
int ProductTag>
struct product_promote_storage_type<A, A, ProductTag> {
typedef A ret;};
581 template <
int ProductTag>
struct product_promote_storage_type<Dense, Dense, ProductTag> {
typedef Dense ret;};
582 template <
typename A,
int ProductTag>
struct product_promote_storage_type<A, Dense, ProductTag> {
typedef Dense ret; };
583 template <
typename B,
int ProductTag>
struct product_promote_storage_type<Dense, B, ProductTag> {
typedef Dense ret; };
585 template <
typename A,
int ProductTag>
struct product_promote_storage_type<A, DiagonalShape, ProductTag> {
typedef A ret; };
586 template <
typename B,
int ProductTag>
struct product_promote_storage_type<DiagonalShape, B, ProductTag> {
typedef B ret; };
587 template <
int ProductTag>
struct product_promote_storage_type<Dense, DiagonalShape, ProductTag> {
typedef Dense ret; };
588 template <
int ProductTag>
struct product_promote_storage_type<DiagonalShape, Dense, ProductTag> {
typedef Dense ret; };
590 template <
typename A,
int ProductTag>
struct product_promote_storage_type<A, PermutationStorage, ProductTag> {
typedef A ret; };
591 template <
typename B,
int ProductTag>
struct product_promote_storage_type<PermutationStorage, B, ProductTag> {
typedef B ret; };
592 template <
int ProductTag>
struct product_promote_storage_type<Dense, PermutationStorage, ProductTag> {
typedef Dense ret; };
593 template <
int ProductTag>
struct product_promote_storage_type<PermutationStorage, Dense, ProductTag> {
typedef Dense ret; };
598 template<
typename ExpressionType,
typename Scalar =
typename ExpressionType::Scalar>
599 struct plain_row_type
601 typedef Matrix<Scalar, 1, ExpressionType::ColsAtCompileTime,
602 int(ExpressionType::PlainObject::Options) | int(
RowMajor), 1, ExpressionType::MaxColsAtCompileTime> MatrixRowType;
603 typedef Array<Scalar, 1, ExpressionType::ColsAtCompileTime,
604 int(ExpressionType::PlainObject::Options) | int(
RowMajor), 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType;
606 typedef typename conditional<
607 is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
613 template<
typename ExpressionType,
typename Scalar =
typename ExpressionType::Scalar>
614 struct plain_col_type
616 typedef Matrix<Scalar, ExpressionType::RowsAtCompileTime, 1,
617 ExpressionType::PlainObject::Options & ~
RowMajor, ExpressionType::MaxRowsAtCompileTime, 1> MatrixColType;
618 typedef Array<Scalar, ExpressionType::RowsAtCompileTime, 1,
619 ExpressionType::PlainObject::Options & ~
RowMajor, ExpressionType::MaxRowsAtCompileTime, 1> ArrayColType;
621 typedef typename conditional<
622 is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
628 template<
typename ExpressionType,
typename Scalar =
typename ExpressionType::Scalar>
629 struct plain_diag_type
631 enum { diag_size = EIGEN_SIZE_MIN_PREFER_DYNAMIC(ExpressionType::RowsAtCompileTime, ExpressionType::ColsAtCompileTime),
632 max_diag_size = EIGEN_SIZE_MIN_PREFER_FIXED(ExpressionType::MaxRowsAtCompileTime, ExpressionType::MaxColsAtCompileTime)
634 typedef Matrix<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1> MatrixDiagType;
635 typedef Array<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1> ArrayDiagType;
637 typedef typename conditional<
638 is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value,
644 template<
typename Expr,
typename Scalar =
typename Expr::Scalar>
645 struct plain_constant_type
650 Options, traits<Expr>::MaxRowsAtCompileTime,traits<Expr>::MaxColsAtCompileTime> array_type;
653 Options, traits<Expr>::MaxRowsAtCompileTime,traits<Expr>::MaxColsAtCompileTime> matrix_type;
655 typedef CwiseNullaryOp<scalar_constant_op<Scalar>,
const typename conditional<is_same< typename traits<Expr>::XprKind, MatrixXpr >::value, matrix_type, array_type>::type > type;
658 template<
typename ExpressionType>
661 enum { value = (!bool(is_const<ExpressionType>::value)) &&
662 bool(traits<ExpressionType>::Flags &
LvalueBit) };
665 template<
typename T>
struct is_diagonal
666 {
enum { ret =
false }; };
668 template<
typename T>
struct is_diagonal<DiagonalBase<T> >
669 {
enum { ret =
true }; };
671 template<
typename T>
struct is_diagonal<DiagonalWrapper<T> >
672 {
enum { ret =
true }; };
674 template<
typename T,
int S>
struct is_diagonal<DiagonalMatrix<T,S> >
675 {
enum { ret =
true }; };
678 template<
typename T>
struct is_identity
679 {
enum { value =
false }; };
681 template<
typename T>
struct is_identity<CwiseNullaryOp<
internal::scalar_identity_op<typename T::Scalar>, T> >
682 {
enum { value =
true }; };
685 template<
typename S1,
typename S2>
struct glue_shapes;
686 template<>
struct glue_shapes<DenseShape,TriangularShape> {
typedef TriangularShape type; };
688 template<
typename T1,
typename T2>
689 struct possibly_same_dense {
690 enum { value = has_direct_access<T1>::ret && has_direct_access<T2>::ret && is_same<typename T1::Scalar,typename T2::Scalar>::value };
693 template<
typename T1,
typename T2>
695 bool is_same_dense(
const T1 &mat1,
const T2 &mat2,
typename enable_if<possibly_same_dense<T1,T2>::value>::type * = 0)
697 return (mat1.data()==mat2.data()) && (mat1.innerStride()==mat2.innerStride()) && (mat1.outerStride()==mat2.outerStride());
700 template<
typename T1,
typename T2>
702 bool is_same_dense(
const T1 &,
const T2 &,
typename enable_if<!possibly_same_dense<T1,T2>::value>::type * = 0)
709 template<
typename T,
bool Vectorized=false,
typename EnableIf =
void>
710 struct scalar_div_cost {
711 enum { value = 8*NumTraits<T>::MulCost };
714 template<
typename T,
bool Vectorized>
715 struct scalar_div_cost<
std::complex<T>, Vectorized> {
716 enum { value = 2*scalar_div_cost<T>::value
717 + 6*NumTraits<T>::MulCost
718 + 3*NumTraits<T>::AddCost
723 template<
bool Vectorized>
724 struct scalar_div_cost<signed long,Vectorized,typename conditional<sizeof(long)==8,void,false_type>::type> {
enum { value = 24 }; };
725 template<
bool Vectorized>
726 struct scalar_div_cost<unsigned long,Vectorized,typename conditional<sizeof(long)==8,void,false_type>::type> {
enum { value = 21 }; };
729 #ifdef EIGEN_DEBUG_ASSIGN 730 std::string demangle_traversal(
int t)
732 if(t==DefaultTraversal)
return "DefaultTraversal";
733 if(t==LinearTraversal)
return "LinearTraversal";
734 if(t==InnerVectorizedTraversal)
return "InnerVectorizedTraversal";
735 if(t==LinearVectorizedTraversal)
return "LinearVectorizedTraversal";
736 if(t==SliceVectorizedTraversal)
return "SliceVectorizedTraversal";
739 std::string demangle_unrolling(
int t)
741 if(t==NoUnrolling)
return "NoUnrolling";
742 if(t==InnerUnrolling)
return "InnerUnrolling";
743 if(t==CompleteUnrolling)
return "CompleteUnrolling";
746 std::string demangle_flags(
int f)
754 if(f&NestByRefBit) res +=
" | NestByRef";
800 template<
typename ScalarA,
typename ScalarB,
typename BinaryOp=
internal::scalar_product_op<ScalarA,ScalarB> >
802 #ifndef EIGEN_PARSED_BY_DOXYGEN
804 : internal::scalar_product_traits<ScalarA,ScalarB>
805 #endif // EIGEN_PARSED_BY_DOXYGEN 808 template<
typename T,
typename BinaryOp>
811 typedef T ReturnType;
814 template <
typename T,
typename BinaryOp>
815 struct ScalarBinaryOpTraits<T, typename NumTraits<typename internal::enable_if<NumTraits<T>::IsComplex,T>::type>::Real, BinaryOp>
817 typedef T ReturnType;
819 template <
typename T,
typename BinaryOp>
820 struct ScalarBinaryOpTraits<typename NumTraits<typename internal::enable_if<NumTraits<T>::IsComplex,T>::type>::Real, T, BinaryOp>
822 typedef T ReturnType;
826 template<
typename T,
typename BinaryOp>
829 typedef T ReturnType;
833 template<
typename T,
typename BinaryOp>
836 typedef T ReturnType;
840 template<
typename BinaryOp>
843 typedef void ReturnType;
850 #define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \ 851 EIGEN_STATIC_ASSERT((Eigen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS,BINOP> >::value), \ 852 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 856 #endif // EIGEN_XPRHELPER_H Definition: Constants.h:319
const int HugeCost
Definition: Constants.h:44
const unsigned int DirectAccessBit
Definition: Constants.h:155
const unsigned int LvalueBit
Definition: Constants.h:144
Namespace containing all symbols from the Eigen library.
Definition: Core:141
const int DynamicIndex
Definition: Constants.h:27
Definition: BFloat16.h:88
const unsigned int RowMajorBit
Definition: Constants.h:66
const unsigned int PacketAccessBit
Definition: Constants.h:94
Definition: Constants.h:323
Definition: Eigen_Colamd.h:50
Definition: DenseBase.h:100
Definition: Constants.h:321
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:801
const int Dynamic
Definition: Constants.h:22
const unsigned int EvalBeforeNestingBit
Definition: Constants.h:70
const unsigned int LinearAccessBit
Definition: Constants.h:130
const unsigned int NoPreferredStorageOrderBit
Definition: Constants.h:178