diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-10-25 22:13:49 +0200 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-10-25 22:13:49 +0200 |
commit | 7bc8e3ac0917cdc14015e00e8b29ac299b2b772a (patch) | |
tree | 8c6af03e1d27e0e035bc4bd9be042f78384d10e1 /Eigen/src/Core | |
parent | 597b2745e1cfe1bf1cc4c4c189ecd16d2a0c1738 (diff) |
Initial fixes for bug #85.
Renamed meta_{true|false} to {true|false}_type, meta_if to conditional, is_same_type to is_same, un{ref|pointer|const} to remove_{reference|pointer|const} and makeconst to add_const.
Changed boolean type 'ret' member to 'value'.
Changed 'ret' members refering to types to 'type'.
Adapted all code occurences.
Diffstat (limited to 'Eigen/src/Core')
39 files changed, 179 insertions, 179 deletions
diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index 37b0049a2..96451a9e7 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -497,7 +497,7 @@ EIGEN_STRONG_INLINE Derived& DenseBase<Derived> ::lazyAssign(const DenseBase<OtherDerived>& other) { enum{ - SameType = internal::is_same_type<typename Derived::Scalar,typename OtherDerived::Scalar>::ret + SameType = internal::is_same<typename Derived::Scalar,typename OtherDerived::Scalar>::value }; EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h index d5c0957ee..d70927e31 100644 --- a/Eigen/src/Core/BandMatrix.h +++ b/Eigen/src/Core/BandMatrix.h @@ -147,9 +147,9 @@ class BandMatrix : public EigenBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs,Opt : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex)) }; typedef Block<DataType,1, DiagonalSize> BuildType; - typedef typename internal::meta_if<Conjugate, + typedef typename internal::conditional<Conjugate, CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>,BuildType >, - BuildType>::ret Type; + BuildType>::type Type; }; /** \returns a vector expression of the \a N -th sub or super diagonal */ diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 76fb46e25..3ab242537 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -67,7 +67,7 @@ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel, HasDirectAccess> typedef typename traits<XprType>::StorageKind StorageKind; typedef typename traits<XprType>::XprKind XprKind; typedef typename nested<XprType>::type XprTypeNested; - typedef typename unref<XprTypeNested>::type _XprTypeNested; + typedef typename remove_reference<XprTypeNested>::type _XprTypeNested; enum{ MatrixRows = traits<XprType>::RowsAtCompileTime, MatrixCols = traits<XprType>::ColsAtCompileTime, diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index 8e9761640..9b5908532 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -75,14 +75,14 @@ struct traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > typename traits<Rhs>::Index>::type Index; typedef typename Lhs::Nested LhsNested; typedef typename Rhs::Nested RhsNested; - typedef typename unref<LhsNested>::type _LhsNested; - typedef typename unref<RhsNested>::type _RhsNested; + typedef typename remove_reference<LhsNested>::type _LhsNested; + typedef typename remove_reference<RhsNested>::type _RhsNested; enum { LhsCoeffReadCost = _LhsNested::CoeffReadCost, RhsCoeffReadCost = _RhsNested::CoeffReadCost, LhsFlags = _LhsNested::Flags, RhsFlags = _RhsNested::Flags, - SameType = is_same_type<typename _LhsNested::Scalar,typename _RhsNested::Scalar>::ret, + SameType = is_same<typename _LhsNested::Scalar,typename _RhsNested::Scalar>::value, StorageOrdersAgree = (int(Lhs::Flags)&RowMajorBit)==(int(Rhs::Flags)&RowMajorBit), Flags0 = (int(LhsFlags) | int(RhsFlags)) & ( HereditaryBits @@ -108,8 +108,8 @@ struct traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > // add together a float matrix and a double matrix. #define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \ EIGEN_STATIC_ASSERT((internal::functor_allows_mixing_real_and_complex<BINOP>::ret \ - ? int(internal::is_same_type<typename NumTraits<LHS>::Real, typename NumTraits<RHS>::Real>::ret) \ - : int(internal::is_same_type<LHS, RHS>::ret)), \ + ? int(internal::is_same<typename NumTraits<LHS>::Real, typename NumTraits<RHS>::Real>::value) \ + : int(internal::is_same<LHS, RHS>::value)), \ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) template<typename BinaryOp, typename Lhs, typename Rhs, typename StorageKind> @@ -132,8 +132,8 @@ class CwiseBinaryOp : internal::no_assignment_operator, typedef typename internal::nested<Lhs>::type LhsNested; typedef typename internal::nested<Rhs>::type RhsNested; - typedef typename internal::unref<LhsNested>::type _LhsNested; - typedef typename internal::unref<RhsNested>::type _RhsNested; + typedef typename internal::remove_reference<LhsNested>::type _LhsNested; + typedef typename internal::remove_reference<RhsNested>::type _RhsNested; EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& lhs, const Rhs& rhs, const BinaryOp& func = BinaryOp()) : m_lhs(lhs), m_rhs(rhs), m_functor(func) diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index 284eb39b0..7bc813d14 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -55,7 +55,7 @@ struct traits<CwiseUnaryOp<UnaryOp, XprType> > UnaryOp(typename XprType::Scalar) >::type Scalar; typedef typename XprType::Nested XprTypeNested; - typedef typename unref<XprTypeNested>::type _XprTypeNested; + typedef typename remove_reference<XprTypeNested>::type _XprTypeNested; enum { Flags = _XprTypeNested::Flags & ( HereditaryBits | LinearAccessBit | AlignedBit diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index f8ad160bf..6e028cfac 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -395,8 +395,8 @@ template<typename Derived> class DenseBase inline const NestByValue<Derived> nestByValue() const; inline const ForceAlignedAccess<Derived> forceAlignedAccess() const; inline ForceAlignedAccess<Derived> forceAlignedAccess(); - template<bool Enable> inline const typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret forceAlignedAccessIf() const; - template<bool Enable> inline typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret forceAlignedAccessIf(); + template<bool Enable> inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const; + template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf(); Scalar sum() const; Scalar mean() const; @@ -482,7 +482,7 @@ template<typename Derived> class DenseBase // disable the use of evalTo for dense objects with a nice compilation error template<typename Dest> inline void evalTo(Dest& ) const { - EIGEN_STATIC_ASSERT((internal::is_same_type<Dest,void>::ret),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); + EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); } protected: diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h index d39aafc08..9de9ae280 100644 --- a/Eigen/src/Core/DenseCoeffsBase.h +++ b/Eigen/src/Core/DenseCoeffsBase.h @@ -44,10 +44,10 @@ class DenseCoeffsBase<Derived,ReadOnlyAccessors> : public EigenBase<Derived> typedef typename internal::traits<Derived>::Index Index; typedef typename internal::traits<Derived>::Scalar Scalar; typedef typename internal::packet_traits<Scalar>::type PacketScalar; - typedef typename internal::meta_if<bool(internal::traits<Derived>::Flags&LvalueBit), + typedef typename internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit), const Scalar&, - typename internal::meta_if<internal::is_arithmetic<Scalar>::ret, Scalar, const Scalar>::ret - >::ret CoeffReturnType; + typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type + >::type CoeffReturnType; typedef typename internal::makeconst_return_type<typename internal::packet_traits<Scalar>::type>::type PacketReturnType; typedef EigenBase<Derived> Base; diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 1a86b4e39..158bc6df7 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -50,7 +50,7 @@ struct traits<Diagonal<MatrixType,DiagIndex> > : traits<MatrixType> { typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; typedef typename MatrixType::StorageKind StorageKind; enum { AbsDiagIndex = DiagIndex<0 ? -DiagIndex : DiagIndex, // only used if DiagIndex != Dynamic diff --git a/Eigen/src/Core/DiagonalProduct.h b/Eigen/src/Core/DiagonalProduct.h index 6c9b62920..de0c6ed11 100644 --- a/Eigen/src/Core/DiagonalProduct.h +++ b/Eigen/src/Core/DiagonalProduct.h @@ -41,7 +41,7 @@ struct traits<DiagonalProduct<MatrixType, DiagonalType, ProductOrder> > _StorageOrder = MatrixType::Flags & RowMajorBit ? RowMajor : ColMajor, _PacketOnDiag = !((int(_StorageOrder) == RowMajor && int(ProductOrder) == OnTheLeft) ||(int(_StorageOrder) == ColMajor && int(ProductOrder) == OnTheRight)), - _SameTypes = is_same_type<typename MatrixType::Scalar, typename DiagonalType::Scalar>::ret, + _SameTypes = is_same<typename MatrixType::Scalar, typename DiagonalType::Scalar>::value, // FIXME currently we need same types, but in the future the next rule should be the one //_Vectorizable = bool(int(MatrixType::Flags)&PacketAccessBit) && ((!_PacketOnDiag) || (_SameTypes && bool(int(DiagonalType::Flags)&PacketAccessBit))), _Vectorizable = bool(int(MatrixType::Flags)&PacketAccessBit) && _SameTypes && ((!_PacketOnDiag) || (bool(int(DiagonalType::Flags)&PacketAccessBit))), @@ -83,21 +83,21 @@ class DiagonalProduct : internal::no_assignment_operator, }; const Index indexInDiagonalVector = ProductOrder == OnTheLeft ? row : col; - return packet_impl<LoadMode>(row,col,indexInDiagonalVector,typename internal::meta_if< + return packet_impl<LoadMode>(row,col,indexInDiagonalVector,typename internal::conditional< ((int(StorageOrder) == RowMajor && int(ProductOrder) == OnTheLeft) - ||(int(StorageOrder) == ColMajor && int(ProductOrder) == OnTheRight)), internal::meta_true, internal::meta_false>::ret()); + ||(int(StorageOrder) == ColMajor && int(ProductOrder) == OnTheRight)), internal::true_type, internal::false_type>::type()); } protected: template<int LoadMode> - EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::meta_true) const + EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::true_type) const { return internal::pmul(m_matrix.template packet<LoadMode>(row, col), internal::pset1<PacketScalar>(m_diagonal.diagonal().coeff(id))); } template<int LoadMode> - EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::meta_false) const + EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::false_type) const { enum { InnerSize = (MatrixType::Flags & RowMajorBit) ? MatrixType::ColsAtCompileTime : MatrixType::RowsAtCompileTime, diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 9e02f1bf3..74d5652c1 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -76,7 +76,7 @@ MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) - EIGEN_STATIC_ASSERT((internal::is_same_type<Scalar, typename OtherDerived::Scalar>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) eigen_assert(size() == other.size()); @@ -117,7 +117,7 @@ inline const typename MatrixBase<Derived>::PlainObject MatrixBase<Derived>::normalized() const { typedef typename internal::nested<Derived>::type Nested; - typedef typename internal::unref<Nested>::type _Nested; + typedef typename internal::remove_reference<Nested>::type _Nested; _Nested n(derived()); return n / n.norm(); } diff --git a/Eigen/src/Core/Flagged.h b/Eigen/src/Core/Flagged.h index 8d2207a7f..208f51afb 100644 --- a/Eigen/src/Core/Flagged.h +++ b/Eigen/src/Core/Flagged.h @@ -56,8 +56,8 @@ template<typename ExpressionType, unsigned int Added, unsigned int Removed> clas typedef MatrixBase<Flagged> Base; EIGEN_DENSE_PUBLIC_INTERFACE(Flagged) - typedef typename internal::meta_if<internal::must_nest_by_value<ExpressionType>::ret, - ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; + typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret, + ExpressionType, const ExpressionType&>::type ExpressionTypeNested; typedef typename ExpressionType::InnerIterator InnerIterator; inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {} diff --git a/Eigen/src/Core/ForceAlignedAccess.h b/Eigen/src/Core/ForceAlignedAccess.h index 727b87e64..2a6f1cf4e 100644 --- a/Eigen/src/Core/ForceAlignedAccess.h +++ b/Eigen/src/Core/ForceAlignedAccess.h @@ -137,7 +137,7 @@ MatrixBase<Derived>::forceAlignedAccess() */ template<typename Derived> template<bool Enable> -inline typename internal::makeconst<typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret>::type +inline typename internal::add_const<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type MatrixBase<Derived>::forceAlignedAccessIf() const { return derived(); @@ -148,7 +148,7 @@ MatrixBase<Derived>::forceAlignedAccessIf() const */ template<typename Derived> template<bool Enable> -inline typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret +inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type MatrixBase<Derived>::forceAlignedAccessIf() { return derived(); diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index 6716ccae8..f2aaea145 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -59,7 +59,7 @@ struct functor_traits<scalar_sum_op<Scalar> > { */ template<typename LhsScalar,typename RhsScalar> struct scalar_product_op { enum { - Vectorizable = is_same_type<LhsScalar,RhsScalar>::ret && packet_traits<LhsScalar>::HasMul && packet_traits<RhsScalar>::HasMul + Vectorizable = is_same<LhsScalar,RhsScalar>::value && packet_traits<LhsScalar>::HasMul && packet_traits<RhsScalar>::HasMul }; typedef typename scalar_product_traits<LhsScalar,RhsScalar>::ReturnType result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_product_op) @@ -303,7 +303,7 @@ struct scalar_cast_op { }; template<typename Scalar, typename NewType> struct functor_traits<scalar_cast_op<Scalar,NewType> > -{ enum { Cost = is_same_type<Scalar, NewType>::ret ? 0 : NumTraits<NewType>::AddCost, PacketAccess = false }; }; +{ enum { Cost = is_same<Scalar, NewType>::value ? 0 : NumTraits<NewType>::AddCost, PacketAccess = false }; }; /** \internal * \brief Template functor to extract the real part of a complex @@ -419,7 +419,7 @@ struct scalar_multiple_op { EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a * m_other; } EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pmul(a, pset1<Packet>(m_other)); } - typename makeconst<typename NumTraits<Scalar>::Nested>::type m_other; + typename add_const<typename NumTraits<Scalar>::Nested>::type m_other; }; template<typename Scalar> struct functor_traits<scalar_multiple_op<Scalar> > @@ -431,7 +431,7 @@ struct scalar_multiple2_op { EIGEN_STRONG_INLINE scalar_multiple2_op(const scalar_multiple2_op& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE scalar_multiple2_op(const Scalar2& other) : m_other(other) { } EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; } - typename makeconst<typename NumTraits<Scalar2>::Nested>::type m_other; + typename add_const<typename NumTraits<Scalar2>::Nested>::type m_other; }; template<typename Scalar1,typename Scalar2> struct functor_traits<scalar_multiple2_op<Scalar1,Scalar2> > @@ -458,7 +458,7 @@ struct scalar_quotient1_impl<Scalar,true> { EIGEN_STRONG_INLINE scalar_quotient1_impl(const scalar_quotient1_impl& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE scalar_quotient1_impl(const Scalar& other) : m_other(other) {} EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } - typename makeconst<typename NumTraits<Scalar>::Nested>::type m_other; + typename add_const<typename NumTraits<Scalar>::Nested>::type m_other; }; template<typename Scalar> struct functor_traits<scalar_quotient1_impl<Scalar,true> > diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 600545b95..990509d48 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -163,7 +163,7 @@ struct real_ref_retval }; template<typename Scalar> -inline typename makeconst< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) +inline typename add_const< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) { return real_ref_impl<Scalar>::run(x); } @@ -215,7 +215,7 @@ struct imag_ref_retval }; template<typename Scalar> -inline typename makeconst< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) +inline typename add_const< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) { return imag_ref_impl<Scalar>::run(x); } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 5ef723e8c..a1b84bd94 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -127,10 +127,10 @@ template<typename Derived> class MatrixBase /** \internal Represents a matrix with all coefficients equal to one another*/ typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,Derived> ConstantReturnType; /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::meta_if<NumTraits<Scalar>::IsComplex, + typedef typename internal::conditional<NumTraits<Scalar>::IsComplex, CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, Eigen::Transpose<Derived> >, Transpose<Derived> - >::ret AdjointReturnType; + >::type AdjointReturnType; /** \internal Return type of eigenvalues() */ typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; /** \internal the return type of identity */ @@ -277,8 +277,8 @@ template<typename Derived> class MatrixBase inline const ForceAlignedAccess<Derived> forceAlignedAccess() const; inline ForceAlignedAccess<Derived> forceAlignedAccess(); - template<bool Enable> inline typename internal::makeconst<typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret>::type forceAlignedAccessIf() const; - template<bool Enable> inline typename internal::meta_if<Enable,ForceAlignedAccess<Derived>,Derived&>::ret forceAlignedAccessIf(); + template<bool Enable> inline typename internal::add_const<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const; + template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf(); Scalar trace() const; diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index fb7b0b0c4..edc2ad2c4 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -71,11 +71,11 @@ template<typename T> struct GenericNumTraits }; typedef T Real; - typedef typename internal::meta_if< + typedef typename internal::conditional< IsInteger, - typename internal::meta_if<sizeof(T)<=2, float, double>::ret, + typename internal::conditional<sizeof(T)<=2, float, double>::type, T - >::ret NonInteger; + >::type NonInteger; typedef T Nested; inline static Real epsilon() { return std::numeric_limits<T>::epsilon(); } diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index 9e99b6f91..e5e5d593a 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -353,7 +353,7 @@ struct permut_matrix_product_retval { const int n = Side==OnTheLeft ? rows() : cols(); - if(is_same_type<MatrixTypeNestedCleaned,Dest>::ret && extract_data(dst) == extract_data(m_matrix)) + if(is_same<MatrixTypeNestedCleaned,Dest>::value && extract_data(dst) == extract_data(m_matrix)) { // apply the permutation inplace Matrix<bool,PermutationType::RowsAtCompileTime,1,0,PermutationType::MaxRowsAtCompileTime> mask(m_permutation.size()); diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index 0848475b3..6bb42f1c9 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -460,15 +460,15 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type template<typename OtherDerived> EIGEN_STRONG_INLINE Derived& _set(const DenseBase<OtherDerived>& other) { - _set_selector(other.derived(), typename internal::meta_if<static_cast<bool>(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::meta_true, internal::meta_false>::ret()); + _set_selector(other.derived(), typename internal::conditional<static_cast<bool>(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::true_type, internal::false_type>::type()); return this->derived(); } template<typename OtherDerived> - EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::meta_true&) { _set_noalias(other.eval()); } + EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::true_type&) { _set_noalias(other.eval()); } template<typename OtherDerived> - EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::meta_false&) { _set_noalias(other); } + EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::false_type&) { _set_noalias(other); } /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which * is the case when creating a new matrix) so one can enforce lazy evaluation. @@ -511,7 +511,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type template<typename OtherDerived> void _swap(DenseBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other) { - enum { SwapPointers = internal::is_same_type<Derived, OtherDerived>::ret && Base::SizeAtCompileTime==Dynamic }; + enum { SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime==Dynamic }; internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.const_cast_derived()); } diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 3bb73fa5f..c04701492 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -202,7 +202,7 @@ class GeneralProduct<Lhs, Rhs, InnerProduct> public: GeneralProduct(const Lhs& lhs, const Rhs& rhs) { - EIGEN_STATIC_ASSERT((internal::is_same_type<typename Lhs::RealScalar, typename Rhs::RealScalar>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::RealScalar, typename Rhs::RealScalar>::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) Base::coeffRef(0,0) = (lhs.transpose().cwiseProduct(rhs)).sum(); @@ -239,7 +239,7 @@ class GeneralProduct<Lhs, Rhs, OuterProduct> GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) { - EIGEN_STATIC_ASSERT((internal::is_same_type<typename Lhs::RealScalar, typename Rhs::RealScalar>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::RealScalar, typename Rhs::RealScalar>::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) } @@ -312,12 +312,12 @@ class GeneralProduct<Lhs, Rhs, GemvProduct> GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) { -// EIGEN_STATIC_ASSERT((internal::is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret), +// EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::Scalar, typename Rhs::Scalar>::value), // YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) } enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight }; - typedef typename internal::meta_if<int(Side)==OnTheRight,_LhsNested,_RhsNested>::ret MatrixType; + typedef typename internal::conditional<int(Side)==OnTheRight,_LhsNested,_RhsNested>::type MatrixType; template<typename Dest> void scaleAndAddTo(Dest& dst, Scalar alpha) const { diff --git a/Eigen/src/Core/ProductBase.h b/Eigen/src/Core/ProductBase.h index 87702f4db..d45819132 100644 --- a/Eigen/src/Core/ProductBase.h +++ b/Eigen/src/Core/ProductBase.h @@ -183,7 +183,7 @@ operator*(const ProductBase<Derived,Lhs,Rhs>& prod, typename Derived::Scalar x) { return ScaledProduct<Derived>(prod.derived(), x); } template<typename Derived,typename Lhs,typename Rhs> -typename internal::enable_if<!internal::is_same_type<typename Derived::Scalar,typename Derived::RealScalar>::ret, +typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value, const ScaledProduct<Derived> >::type operator*(const ProductBase<Derived,Lhs,Rhs>& prod, typename Derived::RealScalar x) { return ScaledProduct<Derived>(prod.derived(), x); } @@ -195,7 +195,7 @@ operator*(typename Derived::Scalar x,const ProductBase<Derived,Lhs,Rhs>& prod) { return ScaledProduct<Derived>(prod.derived(), x); } template<typename Derived,typename Lhs,typename Rhs> -typename internal::enable_if<!internal::is_same_type<typename Derived::Scalar,typename Derived::RealScalar>::ret, +typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value, const ScaledProduct<Derived> >::type operator*(typename Derived::RealScalar x,const ProductBase<Derived,Lhs,Rhs>& prod) { return ScaledProduct<Derived>(prod.derived(), x); } diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h index d5022c2cd..87fcfccdd 100644 --- a/Eigen/src/Core/Replicate.h +++ b/Eigen/src/Core/Replicate.h @@ -49,7 +49,7 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> > typedef typename traits<MatrixType>::StorageKind StorageKind; typedef typename traits<MatrixType>::XprKind XprKind; typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; enum { RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic ? Dynamic @@ -81,7 +81,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate inline explicit Replicate(const OriginalMatrixType& matrix) : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) { - EIGEN_STATIC_ASSERT((internal::is_same_type<MatrixType,OriginalMatrixType>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<MatrixType,OriginalMatrixType>::value), THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic); } @@ -90,7 +90,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate inline Replicate(const OriginalMatrixType& matrix, int rowFactor, int colFactor) : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) { - EIGEN_STATIC_ASSERT((internal::is_same_type<MatrixType,OriginalMatrixType>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<MatrixType,OriginalMatrixType>::value), THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) } diff --git a/Eigen/src/Core/Reverse.h b/Eigen/src/Core/Reverse.h index 13fdc50a7..ed32b17fc 100644 --- a/Eigen/src/Core/Reverse.h +++ b/Eigen/src/Core/Reverse.h @@ -51,7 +51,7 @@ struct traits<Reverse<MatrixType, Direction> > typedef typename traits<MatrixType>::StorageKind StorageKind; typedef typename traits<MatrixType>::XprKind XprKind; typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index 489240dd9..623cca027 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -46,7 +46,7 @@ template<typename MatrixType, unsigned int UpLo> struct traits<SelfAdjointView<MatrixType, UpLo> > : traits<MatrixType> { typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; typedef MatrixType ExpressionType; enum { Mode = UpLo | SelfAdjoint, diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h index 9a649c1ee..213983588 100644 --- a/Eigen/src/Core/SelfCwiseBinaryOp.h +++ b/Eigen/src/Core/SelfCwiseBinaryOp.h @@ -173,9 +173,9 @@ inline Derived& DenseBase<Derived>::operator*=(const Scalar& other) template<typename Derived> inline Derived& DenseBase<Derived>::operator/=(const Scalar& other) { - typedef typename internal::meta_if<NumTraits<Scalar>::IsInteger, + typedef typename internal::conditional<NumTraits<Scalar>::IsInteger, internal::scalar_quotient_op<Scalar>, - internal::scalar_product_op<Scalar> >::ret BinOp; + internal::scalar_product_op<Scalar> >::type BinOp; typedef typename Derived::PlainObject PlainObject; SelfCwiseBinaryOp<BinOp, Derived, typename PlainObject::ConstantReturnType> tmp(derived()); tmp = PlainObject::Constant(rows(),cols(), NumTraits<Scalar>::IsInteger ? other : Scalar(1)/other); diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 0b9d3db9d..abbf57553 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -256,11 +256,11 @@ void TriangularView<MatrixType,Mode>::solveInPlace(const MatrixBase<OtherDerived eigen_assert(Mode & (Upper|Lower)); enum { copy = internal::traits<OtherDerived>::Flags & RowMajorBit && OtherDerived::IsVectorAtCompileTime }; - typedef typename internal::meta_if<copy, - typename internal::plain_matrix_type_column_major<OtherDerived>::type, OtherDerived&>::ret OtherCopy; + typedef typename internal::conditional<copy, + typename internal::plain_matrix_type_column_major<OtherDerived>::type, OtherDerived&>::type OtherCopy; OtherCopy otherCopy(other); - internal::triangular_solver_selector<MatrixType, typename internal::unref<OtherCopy>::type, + internal::triangular_solver_selector<MatrixType, typename internal::remove_reference<OtherCopy>::type, Side, Mode>::run(nestedExpression(), otherCopy); if (copy) diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index a011f7df3..b3159a3c5 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -46,7 +46,7 @@ struct traits<Transpose<MatrixType> > : traits<MatrixType> { typedef typename MatrixType::Scalar Scalar; typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; typedef typename traits<MatrixType>::StorageKind StorageKind; typedef typename traits<MatrixType>::XprKind XprKind; enum { diff --git a/Eigen/src/Core/Transpositions.h b/Eigen/src/Core/Transpositions.h index b7c3c339f..32a9f1fec 100644 --- a/Eigen/src/Core/Transpositions.h +++ b/Eigen/src/Core/Transpositions.h @@ -240,7 +240,7 @@ struct transposition_matrix_product_retval const int size = m_transpositions.size(); Index j = 0; - if(!(is_same_type<MatrixTypeNestedCleaned,Dest>::ret && extract_data(dst) == extract_data(m_matrix))) + if(!(is_same<MatrixTypeNestedCleaned,Dest>::value && extract_data(dst) == extract_data(m_matrix))) dst = m_matrix; for(int k=(Transposed?size-1:0) ; Transposed?k>=0:k<size ; Transposed?--k:++k) diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index dc540f9bc..76f07b892 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -134,7 +134,7 @@ template<typename MatrixType, unsigned int _Mode> struct traits<TriangularView<MatrixType, _Mode> > : traits<MatrixType> { typedef typename nested<MatrixType>::type MatrixTypeNested; - typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested; typedef MatrixType ExpressionType; enum { Mode = _Mode, diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index 4c794d5b5..8cd516479 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -182,8 +182,8 @@ template<typename ExpressionType, int Direction> class VectorwiseOp typedef typename ExpressionType::Scalar Scalar; typedef typename ExpressionType::RealScalar RealScalar; typedef typename ExpressionType::Index Index; - typedef typename internal::meta_if<internal::must_nest_by_value<ExpressionType>::ret, - ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; + typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret, + ExpressionType, const ExpressionType&>::type ExpressionTypeNested; template<template<typename _Scalar> class Functor, typename Scalar=typename internal::traits<ExpressionType>::Scalar> struct ReturnType @@ -211,9 +211,9 @@ template<typename ExpressionType, int Direction> class VectorwiseOp /** \internal * \returns the i-th subvector according to the \c Direction */ - typedef typename internal::meta_if<Direction==Vertical, + typedef typename internal::conditional<Direction==Vertical, typename ExpressionType::ColXpr, - typename ExpressionType::RowXpr>::ret SubVector; + typename ExpressionType::RowXpr>::type SubVector; SubVector subVector(Index i) { return SubVector(m_matrix.derived(),i); diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index 98a5a3426..5b1847252 100644 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -39,9 +39,9 @@ typedef __m128 Packet4f; typedef __m128i Packet4i; typedef __m128d Packet2d; -template<> struct is_arithmetic<__m128> { enum { ret = true }; }; -template<> struct is_arithmetic<__m128i> { enum { ret = true }; }; -template<> struct is_arithmetic<__m128d> { enum { ret = true }; }; +template<> struct is_arithmetic<__m128> { enum { value = true }; }; +template<> struct is_arithmetic<__m128i> { enum { value = true }; }; +template<> struct is_arithmetic<__m128d> { enum { value = true }; }; #define vec4f_swizzle1(v,p,q,r,s) \ (_mm_castsi128_ps(_mm_shuffle_epi32( _mm_castps_si128(v), ((s)<<6|(r)<<4|(q)<<2|(p))))) diff --git a/Eigen/src/Core/products/CoeffBasedProduct.h b/Eigen/src/Core/products/CoeffBasedProduct.h index e1f19d787..97cdddcdf 100644 --- a/Eigen/src/Core/products/CoeffBasedProduct.h +++ b/Eigen/src/Core/products/CoeffBasedProduct.h @@ -75,7 +75,7 @@ struct traits<CoeffBasedProduct<LhsNested,RhsNested,NestingFlags> > LhsRowMajor = LhsFlags & RowMajorBit, RhsRowMajor = RhsFlags & RowMajorBit, - SameType = is_same_type<typename _LhsNested::Scalar,typename _RhsNested::Scalar>::ret, + SameType = is_same<typename _LhsNested::Scalar,typename _RhsNested::Scalar>::value, CanVectorizeRhs = RhsRowMajor && (RhsFlags & PacketAccessBit) && (ColsAtCompileTime == Dynamic @@ -162,7 +162,7 @@ class CoeffBasedProduct { // we don't allow taking products of matrices of different real types, as that wouldn't be vectorizable. // We still allow to mix T and complex<T>. - EIGEN_STATIC_ASSERT((internal::is_same_type<typename Lhs::RealScalar, typename Rhs::RealScalar>::ret), + EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::RealScalar, typename Rhs::RealScalar>::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) eigen_assert(lhs.cols() == rhs.rows() && "invalid matrix product" diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 94ed792f7..074534861 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -185,9 +185,9 @@ public: typedef typename packet_traits<RhsScalar>::type _RhsPacket; typedef typename packet_traits<ResScalar>::type _ResPacket; - typedef typename meta_if<Vectorizable,_LhsPacket,LhsScalar>::ret LhsPacket; - typedef typename meta_if<Vectorizable,_RhsPacket,RhsScalar>::ret RhsPacket; - typedef typename meta_if<Vectorizable,_ResPacket,ResScalar>::ret ResPacket; + typedef typename conditional<Vectorizable,_LhsPacket,LhsScalar>::type LhsPacket; + typedef typename conditional<Vectorizable,_RhsPacket,RhsScalar>::type RhsPacket; + typedef typename conditional<Vectorizable,_ResPacket,ResScalar>::type ResPacket; typedef ResPacket AccPacket; @@ -256,9 +256,9 @@ public: typedef typename packet_traits<RhsScalar>::type _RhsPacket; typedef typename packet_traits<ResScalar>::type _ResPacket; - typedef typename meta_if<Vectorizable,_LhsPacket,LhsScalar>::ret LhsPacket; - typedef typename meta_if<Vectorizable,_RhsPacket,RhsScalar>::ret RhsPacket; - typedef typename meta_if<Vectorizable,_ResPacket,ResScalar>::ret ResPacket; + typedef typename conditional<Vectorizable,_LhsPacket,LhsScalar>::type LhsPacket; + typedef typename conditional<Vectorizable,_RhsPacket,RhsScalar>::type RhsPacket; + typedef typename conditional<Vectorizable,_ResPacket,ResScalar>::type ResPacket; typedef ResPacket AccPacket; @@ -285,15 +285,15 @@ public: EIGEN_STRONG_INLINE void madd(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp) const { - madd_impl(a, b, c, tmp, typename meta_if<Vectorizable,meta_true,meta_false>::ret()); + madd_impl(a, b, c, tmp, typename conditional<Vectorizable,true_type,false_type>::type()); } - EIGEN_STRONG_INLINE void madd_impl(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp, const meta_true&) const + EIGEN_STRONG_INLINE void madd_impl(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp, const true_type&) const { tmp = b; tmp = pmul(a.v,tmp); c.v = padd(c.v,tmp); } - EIGEN_STRONG_INLINE void madd_impl(const LhsScalar& a, const RhsScalar& b, ResScalar& c, RhsScalar& /*tmp*/, const meta_false&) const + EIGEN_STRONG_INLINE void madd_impl(const LhsScalar& a, const RhsScalar& b, ResScalar& c, RhsScalar& /*tmp*/, const false_type&) const { c += a * b; } @@ -340,10 +340,10 @@ public: RealPacket second; }; - typedef typename meta_if<Vectorizable,RealPacket, Scalar>::ret LhsPacket; - typedef typename meta_if<Vectorizable,DoublePacket,Scalar>::ret RhsPacket; - typedef typename meta_if<Vectorizable,ScalarPacket,Scalar>::ret ResPacket; - typedef typename meta_if<Vectorizable,DoublePacket,Scalar>::ret AccPacket; + typedef typename conditional<Vectorizable,RealPacket, Scalar>::type LhsPacket; + typedef typename conditional<Vectorizable,DoublePacket,Scalar>::type RhsPacket; + typedef typename conditional<Vectorizable,ScalarPacket,Scalar>::type ResPacket; + typedef typename conditional<Vectorizable,DoublePacket,Scalar>::type AccPacket; EIGEN_STRONG_INLINE void initAcc(Scalar& p) { p = Scalar(0); } @@ -461,9 +461,9 @@ public: typedef typename packet_traits<RhsScalar>::type _RhsPacket; typedef typename packet_traits<ResScalar>::type _ResPacket; - typedef typename meta_if<Vectorizable,_LhsPacket,LhsScalar>::ret LhsPacket; - typedef typename meta_if<Vectorizable,_RhsPacket,RhsScalar>::ret RhsPacket; - typedef typename meta_if<Vectorizable,_ResPacket,ResScalar>::ret ResPacket; + typedef typename conditional<Vectorizable,_LhsPacket,LhsScalar>::type LhsPacket; + typedef typename conditional<Vectorizable,_RhsPacket,RhsScalar>::type RhsPacket; + typedef typename conditional<Vectorizable,_ResPacket,ResScalar>::type ResPacket; typedef ResPacket AccPacket; @@ -490,15 +490,15 @@ public: EIGEN_STRONG_INLINE void madd(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp) const { - madd_impl(a, b, c, tmp, typename meta_if<Vectorizable,meta_true,meta_false>::ret()); + madd_impl(a, b, c, tmp, typename conditional<Vectorizable,true_type,false_type>::type()); } - EIGEN_STRONG_INLINE void madd_impl(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp, const meta_true&) const + EIGEN_STRONG_INLINE void madd_impl(const LhsPacket& a, const RhsPacket& b, AccPacket& c, RhsPacket& tmp, const true_type&) const { tmp = b; tmp.v = pmul(a,tmp.v); c = padd(c,tmp); } - EIGEN_STRONG_INLINE void madd_impl(const LhsScalar& a, const RhsScalar& b, ResScalar& c, RhsScalar& /*tmp*/, const meta_false&) const + EIGEN_STRONG_INLINE void madd_impl(const LhsScalar& a, const RhsScalar& b, ResScalar& c, RhsScalar& /*tmp*/, const false_type&) const { c += a * b; } diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 39e65599d..61e1406e7 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -287,16 +287,16 @@ class level3_blocking template<int StorageOrder, typename _LhsScalar, typename _RhsScalar, int MaxRows, int MaxCols, int MaxDepth> class gemm_blocking_space<StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, true> : public level3_blocking< - typename meta_if<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::ret, - typename meta_if<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::ret> + typename conditional<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::type, + typename conditional<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::type> { enum { Transpose = StorageOrder==RowMajor, ActualRows = Transpose ? MaxCols : MaxRows, ActualCols = Transpose ? MaxRows : MaxCols }; - typedef typename meta_if<Transpose,_RhsScalar,_LhsScalar>::ret LhsScalar; - typedef typename meta_if<Transpose,_LhsScalar,_RhsScalar>::ret RhsScalar; + typedef typename conditional<Transpose,_RhsScalar,_LhsScalar>::type LhsScalar; + typedef typename conditional<Transpose,_LhsScalar,_RhsScalar>::type RhsScalar; typedef gebp_traits<LhsScalar,RhsScalar> Traits; enum { SizeA = ActualRows * MaxDepth, @@ -329,14 +329,14 @@ class gemm_blocking_space<StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, M template<int StorageOrder, typename _LhsScalar, typename _RhsScalar, int MaxRows, int MaxCols, int MaxDepth> class gemm_blocking_space<StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, false> : public level3_blocking< - typename meta_if<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::ret, - typename meta_if<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::ret> + typename conditional<StorageOrder==RowMajor,_RhsScalar,_LhsScalar>::type, + typename conditional<StorageOrder==RowMajor,_LhsScalar,_RhsScalar>::type> { enum { Transpose = StorageOrder==RowMajor }; - typedef typename meta_if<Transpose,_RhsScalar,_LhsScalar>::ret LhsScalar; - typedef typename meta_if<Transpose,_LhsScalar,_RhsScalar>::ret RhsScalar; + typedef typename conditional<Transpose,_RhsScalar,_LhsScalar>::type LhsScalar; + typedef typename conditional<Transpose,_LhsScalar,_RhsScalar>::type RhsScalar; typedef gebp_traits<LhsScalar,RhsScalar> Traits; DenseIndex m_sizeA; diff --git a/Eigen/src/Core/products/GeneralMatrixVector.h b/Eigen/src/Core/products/GeneralMatrixVector.h index 41df6170c..540638b5a 100644 --- a/Eigen/src/Core/products/GeneralMatrixVector.h +++ b/Eigen/src/Core/products/GeneralMatrixVector.h @@ -57,9 +57,9 @@ typedef typename packet_traits<LhsScalar>::type _LhsPacket; typedef typename packet_traits<RhsScalar>::type _RhsPacket; typedef typename packet_traits<ResScalar>::type _ResPacket; -typedef typename meta_if<Vectorizable,_LhsPacket,LhsScalar>::ret LhsPacket; -typedef typename meta_if<Vectorizable,_RhsPacket,RhsScalar>::ret RhsPacket; -typedef typename meta_if<Vectorizable,_ResPacket,ResScalar>::ret ResPacket; +typedef typename conditional<Vectorizable,_LhsPacket,LhsScalar>::type LhsPacket; +typedef typename conditional<Vectorizable,_RhsPacket,RhsScalar>::type RhsPacket; +typedef typename conditional<Vectorizable,_ResPacket,ResScalar>::type ResPacket; EIGEN_DONT_INLINE static void run( Index rows, Index cols, @@ -313,9 +313,9 @@ typedef typename packet_traits<LhsScalar>::type _LhsPacket; typedef typename packet_traits<RhsScalar>::type _RhsPacket; typedef typename packet_traits<ResScalar>::type _ResPacket; -typedef typename meta_if<Vectorizable,_LhsPacket,LhsScalar>::ret LhsPacket; -typedef typename meta_if<Vectorizable,_RhsPacket,RhsScalar>::ret RhsPacket; -typedef typename meta_if<Vectorizable,_ResPacket,ResScalar>::ret ResPacket; +typedef typename conditional<Vectorizable,_LhsPacket,LhsScalar>::type LhsPacket; +typedef typename conditional<Vectorizable,_RhsPacket,RhsScalar>::type RhsPacket; +typedef typename conditional<Vectorizable,_ResPacket,ResScalar>::type ResPacket; EIGEN_DONT_INLINE static void run( Index rows, Index cols, diff --git a/Eigen/src/Core/products/SelfadjointRank2Update.h b/Eigen/src/Core/products/SelfadjointRank2Update.h index 13b088031..ece4c426b 100644 --- a/Eigen/src/Core/products/SelfadjointRank2Update.h +++ b/Eigen/src/Core/products/SelfadjointRank2Update.h @@ -63,7 +63,7 @@ struct selfadjoint_rank2_update_selector<Scalar,Index,UType,VType,Upper> }; template<bool Cond, typename T> struct conj_expr_if - : meta_if<!Cond, const T&, + : conditional<!Cond, const T&, CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>,T> > {}; } // end namespace internal @@ -88,8 +88,8 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo> enum { IsRowMajor = (internal::traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 }; internal::selfadjoint_rank2_update_selector<Scalar, Index, - typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::ret>::type, - typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::ret>::type, + typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type, + typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type, (IsRowMajor ? int(UpLo==Upper ? Lower : Upper) : UpLo)> ::run(const_cast<Scalar*>(_expression().data()),_expression().outerStride(),actualU,actualV,actualAlpha); diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index 4c1cfc492..2b175fdf3 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -57,8 +57,8 @@ struct product_triangular_vector_selector<true,Lhs,Rhs,Result,Mode,ConjLhs,ConjR static EIGEN_DONT_INLINE void run(const Lhs& lhs, const Rhs& rhs, Result& res, typename traits<Lhs>::Scalar alpha) { static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; - typename conj_expr_if<ConjLhs,Lhs>::ret cjLhs(lhs); - typename conj_expr_if<ConjRhs,Rhs>::ret cjRhs(rhs); + typename conj_expr_if<ConjLhs,Lhs>::type cjLhs(lhs); + typename conj_expr_if<ConjRhs,Rhs>::type cjRhs(rhs); Index size = lhs.cols(); for (Index pi=0; pi<size; pi+=PanelWidth) @@ -100,8 +100,8 @@ struct product_triangular_vector_selector<true,Lhs,Rhs,Result,Mode,ConjLhs,ConjR static void run(const Lhs& lhs, const Rhs& rhs, Result& res, typename traits<Lhs>::Scalar alpha) { static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; - typename conj_expr_if<ConjLhs,Lhs>::ret cjLhs(lhs); - typename conj_expr_if<ConjRhs,Rhs>::ret cjRhs(rhs); + typename conj_expr_if<ConjLhs,Lhs>::type cjLhs(lhs); + typename conj_expr_if<ConjRhs,Rhs>::type cjRhs(rhs); Index size = lhs.cols(); for (Index pi=0; pi<size; pi+=PanelWidth) { diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h index 7c976a5bc..d776c4507 100644 --- a/Eigen/src/Core/util/BlasUtil.h +++ b/Eigen/src/Core/util/BlasUtil.h @@ -173,10 +173,10 @@ template<typename XprType> struct blas_traits int(inner_stride_at_compile_time<XprType>::ret) == 1) ) ? 1 : 0 }; - typedef typename meta_if<bool(HasUsableDirectAccess), + typedef typename conditional<bool(HasUsableDirectAccess), ExtractType, typename _ExtractType::PlainObject - >::ret DirectLinearAccessType; + >::type DirectLinearAccessType; static inline ExtractType extract(const XprType& x) { return x; } static inline Scalar extractScalarFactor(const XprType&) { return Scalar(1); } }; @@ -234,10 +234,10 @@ struct blas_traits<Transpose<NestedXpr> > typedef Transpose<NestedXpr> XprType; typedef Transpose<typename Base::_ExtractType> ExtractType; typedef Transpose<typename Base::_ExtractType> _ExtractType; - typedef typename meta_if<bool(Base::HasUsableDirectAccess), + typedef typename conditional<bool(Base::HasUsableDirectAccess), ExtractType, typename ExtractType::PlainObject - >::ret DirectLinearAccessType; + >::type DirectLinearAccessType; enum { IsTransposed = Base::IsTransposed ? 0 : 1 }; diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 56330db9b..53dfa9949 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -35,29 +35,29 @@ namespace internal { * we however don't want to add a dependency to Boost. */ -struct meta_true { enum { ret = 1 }; }; -struct meta_false { enum { ret = 0 }; }; +struct true_type { enum { value = 1 }; }; +struct false_type { enum { value = 0 }; }; template<bool Condition, typename Then, typename Else> -struct meta_if { typedef Then ret; }; +struct conditional { typedef Then type; }; template<typename Then, typename Else> -struct meta_if <false, Then, Else> { typedef Else ret; }; +struct conditional <false, Then, Else> { typedef Else type; }; -template<typename T, typename U> struct is_same_type { enum { ret = 0 }; }; -template<typename T> struct is_same_type<T,T> { enum { ret = 1 }; }; +template<typename T, typename U> struct is_same { enum { value = 0 }; }; +template<typename T> struct is_same<T,T> { enum { value = 1 }; }; -template<typename T> struct unref { typedef T type; }; -template<typename T> struct unref<T&> { typedef T type; }; +template<typename T> struct remove_reference { typedef T type; }; +template<typename T> struct remove_reference<T&> { typedef T type; }; -template<typename T> struct unpointer { typedef T type; }; -template<typename T> struct unpointer<T*> { typedef T type; }; -template<typename T> struct unpointer<T*const> { typedef T type; }; +template<typename T> struct remove_pointer { typedef T type; }; +template<typename T> struct remove_pointer<T*> { typedef T type; }; +template<typename T> struct remove_pointer<T*const> { typedef T type; }; -template<typename T> struct unconst { typedef T type; }; -template<typename T> struct unconst<const T> { typedef T type; }; -template<typename T> struct unconst<T const &> { typedef T & type; }; -template<typename T> struct unconst<T const *> { typedef T * type; }; +template<typename T> struct remove_const { typedef T type; }; +template<typename T> struct remove_const<const T> { typedef T type; }; +template<typename T> struct remove_const<T const &> { typedef T & type; }; +template<typename T> struct remove_const<T const *> { typedef T * type; }; template<typename T> struct cleantype { typedef T type; }; template<typename T> struct cleantype<const T> { typedef typename cleantype<T>::type type; }; @@ -66,33 +66,33 @@ template<typename T> struct cleantype<T&> { typedef typename cleantype<T> template<typename T> struct cleantype<const T*> { typedef typename cleantype<T>::type type; }; template<typename T> struct cleantype<T*> { typedef typename cleantype<T>::type type; }; -template<typename T> struct is_arithmetic { enum { ret = false }; }; -template<> struct is_arithmetic<float> { enum { ret = true }; }; -template<> struct is_arithmetic<double> { enum { ret = true }; }; -template<> struct is_arithmetic<long double> { enum { ret = true }; }; -template<> struct is_arithmetic<bool> { enum { ret = true }; }; -template<> struct is_arithmetic<char> { enum { ret = true }; }; -template<> struct is_arithmetic<signed char> { enum { ret = true }; }; -template<> struct is_arithmetic<unsigned char> { enum { ret = true }; }; -template<> struct is_arithmetic<signed short> { enum { ret = true }; }; -template<> struct is_arithmetic<unsigned short>{ enum { ret = true }; }; -template<> struct is_arithmetic<signed int> { enum { ret = true }; }; -template<> struct is_arithmetic<unsigned int> { enum { ret = true }; }; -template<> struct is_arithmetic<signed long> { enum { ret = true }; }; -template<> struct is_arithmetic<unsigned long> { enum { ret = true }; }; -template<> struct is_arithmetic<signed long long> { enum { ret = true }; }; -template<> struct is_arithmetic<unsigned long long> { enum { ret = true }; }; - -template<typename T> struct makeconst { typedef const T type; }; -template<typename T> struct makeconst<const T> { typedef const T type; }; -template<typename T> struct makeconst<T&> { typedef const T& type; }; -template<typename T> struct makeconst<const T&> { typedef const T& type; }; -template<typename T> struct makeconst<T*> { typedef const T* type; }; -template<typename T> struct makeconst<const T*> { typedef const T* type; }; +template<typename T> struct is_arithmetic { enum { value = false }; }; +template<> struct is_arithmetic<float> { enum { value = true }; }; +template<> struct is_arithmetic<double> { enum { value = true }; }; +template<> struct is_arithmetic<long double> { enum { value = true }; }; +template<> struct is_arithmetic<bool> { enum { value = true }; }; +template<> struct is_arithmetic<char> { enum { value = true }; }; +template<> struct is_arithmetic<signed char> { enum { value = true }; }; +template<> struct is_arithmetic<unsigned char> { enum { value = true }; }; +template<> struct is_arithmetic<signed short> { enum { value = true }; }; +template<> struct is_arithmetic<unsigned short>{ enum { value = true }; }; +template<> struct is_arithmetic<signed int> { enum { value = true }; }; +template<> struct is_arithmetic<unsigned int> { enum { value = true }; }; +template<> struct is_arithmetic<signed long> { enum { value = true }; }; +template<> struct is_arithmetic<unsigned long> { enum { value = true }; }; +template<> struct is_arithmetic<signed long long> { enum { value = true }; }; +template<> struct is_arithmetic<unsigned long long> { enum { value = true }; }; + +template<typename T> struct add_const { typedef const T type; }; +template<typename T> struct add_const<const T> { typedef const T type; }; +template<typename T> struct add_const<T&> { typedef const T& type; }; +template<typename T> struct add_const<const T&> { typedef const T& type; }; +template<typename T> struct add_const<T*> { typedef const T* type; }; +template<typename T> struct add_const<const T*> { typedef const T* type; }; template<typename T> struct makeconst_return_type { - typedef typename meta_if<is_arithmetic<T>::ret, T, typename makeconst<T>::type>::ret type; + typedef typename conditional<is_arithmetic<T>::value, T, typename add_const<T>::type>::type type; }; /** \internal Allows to enable/disable an overload diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 9f5bd7d71..89df78de0 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -52,7 +52,7 @@ class no_assignment_operator template<typename I1, typename I2> struct promote_index_type { - typedef typename meta_if<(sizeof(I1)<sizeof(I2)), I2, I1>::ret type; + typedef typename conditional<(sizeof(I1)<sizeof(I2)), I2, I1>::type type; }; /** \internal If the template parameter Value is Dynamic, this class is just a wrapper around a T variable that @@ -281,11 +281,11 @@ struct is_reference<T&> template <typename T> struct ref_selector { - typedef typename meta_if< + typedef typename conditional< bool(traits<T>::Flags & NestByRefBit), T const&, T - >::ret type; + >::type type; }; /** \internal Determines how a given expression should be nested into another one. @@ -319,12 +319,12 @@ template<typename T, int n=1, typename PlainObject = typename eval<T>::type> str CostNoEval = (N-1) * int(CoeffReadCost) }; - typedef typename meta_if< + typedef typename conditional< ( int(traits<T>::Flags) & EvalBeforeNestingBit ) || ( int(CostEval) <= int(CostNoEval) ), PlainObject, typename ref_selector<T>::type - >::ret type; + >::type type; /* this is what the above logic should be updated to look like: enum { @@ -334,14 +334,14 @@ template<typename T, int n=1, typename PlainObject = typename eval<T>::type> str CostNoEval = n == Dynamic || (CoeffReadCost == Dynamic && n>1) ? int(Dynamic) : (n-1) * int(CoeffReadCost) }; - typedef typename meta_if< + typedef typename conditional< ( int(traits<T>::Flags) & EvalBeforeNestingBit ) || ( int(CostNoEval) == Dynamic ? true : int(CostEval) == Dynamic ? false : int(CostEval) <= int(CostNoEval) ), PlainObject, typename ref_selector<T>::type - >::ret type; + >::type type; */ }; @@ -371,7 +371,7 @@ struct dense_xpr_base<Derived, ArrayXpr> /** \internal Helper base class to add a scalar multiple operator * overloads for complex types */ template<typename Derived,typename Scalar,typename OtherScalar, - bool EnableIt = !is_same_type<Scalar,OtherScalar>::ret > + bool EnableIt = !is_same<Scalar,OtherScalar>::value > struct special_scalar_op_base : public DenseCoeffsBase<Derived> { // dummy operator* so that the @@ -412,8 +412,8 @@ template<typename XprType, typename CastType> struct cast_return_type typedef typename XprType::Scalar CurrentScalarType; typedef typename cleantype<CastType>::type _CastType; typedef typename _CastType::Scalar NewScalarType; - typedef typename meta_if<is_same_type<CurrentScalarType,NewScalarType>::ret, - const XprType&,CastType>::ret type; + typedef typename conditional<is_same<CurrentScalarType,NewScalarType>::value, + const XprType&,CastType>::type type; }; template <typename A, typename B> struct promote_storage_type; @@ -434,11 +434,11 @@ struct plain_row_type typedef Array<Scalar, 1, ExpressionType::ColsAtCompileTime, ExpressionType::PlainObject::Options | RowMajor, 1, ExpressionType::MaxColsAtCompileTime> ArrayRowType; - typedef typename meta_if< - is_same_type< typename traits<ExpressionType>::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value, MatrixRowType, ArrayRowType - >::ret type; + >::type type; }; template<typename ExpressionType, typename Scalar = typename ExpressionType::Scalar> @@ -449,11 +449,11 @@ struct plain_col_type typedef Array<Scalar, ExpressionType::RowsAtCompileTime, 1, ExpressionType::PlainObject::Options & ~RowMajor, ExpressionType::MaxRowsAtCompileTime, 1> ArrayColType; - typedef typename meta_if< - is_same_type< typename traits<ExpressionType>::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value, MatrixColType, ArrayColType - >::ret type; + >::type type; }; template<typename ExpressionType, typename Scalar = typename ExpressionType::Scalar> @@ -465,11 +465,11 @@ struct plain_diag_type typedef Matrix<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1> MatrixDiagType; typedef Array<Scalar, diag_size, 1, ExpressionType::PlainObject::Options & ~RowMajor, max_diag_size, 1> ArrayDiagType; - typedef typename meta_if< - is_same_type< typename traits<ExpressionType>::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits<ExpressionType>::XprKind, MatrixXpr >::value, MatrixDiagType, ArrayDiagType - >::ret type; + >::type type; }; } // end namespace internal |