From 7bc8e3ac0917cdc14015e00e8b29ac299b2b772a Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Mon, 25 Oct 2010 22:13:49 +0200 Subject: [PATCH] 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. --- Eigen/src/Core/Assign.h | 2 +- Eigen/src/Core/BandMatrix.h | 4 +- Eigen/src/Core/Block.h | 2 +- Eigen/src/Core/CwiseBinaryOp.h | 14 ++-- Eigen/src/Core/CwiseUnaryOp.h | 2 +- Eigen/src/Core/DenseBase.h | 6 +- Eigen/src/Core/DenseCoeffsBase.h | 6 +- Eigen/src/Core/Diagonal.h | 2 +- Eigen/src/Core/DiagonalProduct.h | 10 +-- Eigen/src/Core/Dot.h | 4 +- Eigen/src/Core/Flagged.h | 4 +- Eigen/src/Core/ForceAlignedAccess.h | 4 +- Eigen/src/Core/Functors.h | 10 +-- Eigen/src/Core/MathFunctions.h | 4 +- Eigen/src/Core/MatrixBase.h | 8 +- Eigen/src/Core/NumTraits.h | 6 +- Eigen/src/Core/PermutationMatrix.h | 2 +- Eigen/src/Core/PlainObjectBase.h | 8 +- Eigen/src/Core/Product.h | 8 +- Eigen/src/Core/ProductBase.h | 4 +- Eigen/src/Core/Replicate.h | 6 +- Eigen/src/Core/Reverse.h | 2 +- Eigen/src/Core/SelfAdjointView.h | 2 +- Eigen/src/Core/SelfCwiseBinaryOp.h | 4 +- Eigen/src/Core/SolveTriangular.h | 6 +- Eigen/src/Core/Transpose.h | 2 +- Eigen/src/Core/Transpositions.h | 2 +- Eigen/src/Core/TriangularMatrix.h | 2 +- Eigen/src/Core/VectorwiseOp.h | 8 +- Eigen/src/Core/arch/SSE/PacketMath.h | 6 +- Eigen/src/Core/products/CoeffBasedProduct.h | 4 +- .../Core/products/GeneralBlockPanelKernel.h | 38 +++++----- Eigen/src/Core/products/GeneralMatrixMatrix.h | 16 ++-- Eigen/src/Core/products/GeneralMatrixVector.h | 12 +-- .../Core/products/SelfadjointRank2Update.h | 6 +- .../Core/products/TriangularMatrixVector.h | 8 +- Eigen/src/Core/util/BlasUtil.h | 8 +- Eigen/src/Core/util/Meta.h | 76 +++++++++---------- Eigen/src/Core/util/XprHelper.h | 38 +++++----- Eigen/src/Eigen2Support/Cwise.h | 4 +- Eigen/src/Eigen2Support/Minor.h | 2 +- Eigen/src/Eigenvalues/Tridiagonalization.h | 8 +- Eigen/src/Geometry/Homogeneous.h | 2 +- Eigen/src/Geometry/OrthoMethods.h | 2 +- Eigen/src/Geometry/Quaternion.h | 4 +- Eigen/src/Geometry/Transform.h | 8 +- Eigen/src/Geometry/Umeyama.h | 2 +- Eigen/src/Householder/HouseholderSequence.h | 6 +- Eigen/src/Jacobi/Jacobi.h | 10 +-- Eigen/src/LU/Inverse.h | 4 +- Eigen/src/Sparse/SparseCwiseUnaryOp.h | 6 +- Eigen/src/Sparse/SparseDot.h | 4 +- Eigen/src/Sparse/SparseMatrixBase.h | 14 ++-- Eigen/src/Sparse/SparseProduct.h | 8 +- Eigen/src/Sparse/SparseTriangularView.h | 4 +- Eigen/src/Sparse/TriangularSolver.h | 10 +-- Eigen/src/plugins/CommonCwiseUnaryOps.h | 12 +-- test/adjoint.cpp | 2 +- test/array.cpp | 10 +-- test/cholesky.cpp | 2 +- test/eigensolver_selfadjoint.cpp | 2 +- test/geo_homogeneous.cpp | 2 +- test/geo_quaternion.cpp | 4 +- test/geo_transformations.cpp | 4 +- test/meta.cpp | 42 +++++----- test/packetmath.cpp | 2 +- test/qr.cpp | 2 +- test/qr_colpivoting.cpp | 2 +- test/qr_fullpivoting.cpp | 2 +- test/sparse_basic.cpp | 2 +- test/swap.cpp | 2 +- unsupported/Eigen/FFT | 4 +- .../Eigen/src/AutoDiff/AutoDiffScalar.h | 12 +-- .../Eigen/src/Skyline/SkylineProduct.h | 4 +- .../Eigen/src/SparseExtra/CholmodSupport.h | 8 +- .../Eigen/src/SparseExtra/SuperLUSupport.h | 8 +- unsupported/test/polynomialsolver.cpp | 2 +- unsupported/test/sparse_extra.cpp | 2 +- 78 files changed, 293 insertions(+), 293 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 ::lazyAssign(const DenseBase& other) { enum{ - SameType = internal::is_same_type::ret + SameType = internal::is_same::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 BuildType; - typedef typename internal::meta_if,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 typedef typename traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename nested::type XprTypeNested; - typedef typename unref::type _XprTypeNested; + typedef typename remove_reference::type _XprTypeNested; enum{ MatrixRows = traits::RowsAtCompileTime, MatrixCols = traits::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 > typename traits::Index>::type Index; typedef typename Lhs::Nested LhsNested; typedef typename Rhs::Nested RhsNested; - typedef typename unref::type _LhsNested; - typedef typename unref::type _RhsNested; + typedef typename remove_reference::type _LhsNested; + typedef typename remove_reference::type _RhsNested; enum { LhsCoeffReadCost = _LhsNested::CoeffReadCost, RhsCoeffReadCost = _RhsNested::CoeffReadCost, LhsFlags = _LhsNested::Flags, RhsFlags = _RhsNested::Flags, - SameType = is_same_type::ret, + SameType = is_same::value, StorageOrdersAgree = (int(Lhs::Flags)&RowMajorBit)==(int(Rhs::Flags)&RowMajorBit), Flags0 = (int(LhsFlags) | int(RhsFlags)) & ( HereditaryBits @@ -108,8 +108,8 @@ struct traits > // 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::ret \ - ? int(internal::is_same_type::Real, typename NumTraits::Real>::ret) \ - : int(internal::is_same_type::ret)), \ + ? int(internal::is_same::Real, typename NumTraits::Real>::value) \ + : int(internal::is_same::value)), \ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) template @@ -132,8 +132,8 @@ class CwiseBinaryOp : internal::no_assignment_operator, typedef typename internal::nested::type LhsNested; typedef typename internal::nested::type RhsNested; - typedef typename internal::unref::type _LhsNested; - typedef typename internal::unref::type _RhsNested; + typedef typename internal::remove_reference::type _LhsNested; + typedef typename internal::remove_reference::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 > UnaryOp(typename XprType::Scalar) >::type Scalar; typedef typename XprType::Nested XprTypeNested; - typedef typename unref::type _XprTypeNested; + typedef typename remove_reference::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 class DenseBase inline const NestByValue nestByValue() const; inline const ForceAlignedAccess forceAlignedAccess() const; inline ForceAlignedAccess forceAlignedAccess(); - template inline const typename internal::meta_if,Derived&>::ret forceAlignedAccessIf() const; - template inline typename internal::meta_if,Derived&>::ret forceAlignedAccessIf(); + template inline const typename internal::conditional,Derived&>::type forceAlignedAccessIf() const; + template inline typename internal::conditional,Derived&>::type forceAlignedAccessIf(); Scalar sum() const; Scalar mean() const; @@ -482,7 +482,7 @@ template class DenseBase // disable the use of evalTo for dense objects with a nice compilation error template inline void evalTo(Dest& ) const { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); + EIGEN_STATIC_ASSERT((internal::is_same::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 : public EigenBase typedef typename internal::traits::Index Index; typedef typename internal::traits::Scalar Scalar; typedef typename internal::packet_traits::type PacketScalar; - typedef typename internal::meta_if::Flags&LvalueBit), + typedef typename internal::conditional::Flags&LvalueBit), const Scalar&, - typename internal::meta_if::ret, Scalar, const Scalar>::ret - >::ret CoeffReturnType; + typename internal::conditional::value, Scalar, const Scalar>::type + >::type CoeffReturnType; typedef typename internal::makeconst_return_type::type>::type PacketReturnType; typedef EigenBase 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 > : traits { typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::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 > _StorageOrder = MatrixType::Flags & RowMajorBit ? RowMajor : ColMajor, _PacketOnDiag = !((int(_StorageOrder) == RowMajor && int(ProductOrder) == OnTheLeft) ||(int(_StorageOrder) == ColMajor && int(ProductOrder) == OnTheRight)), - _SameTypes = is_same_type::ret, + _SameTypes = is_same::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(row,col,indexInDiagonalVector,typename internal::meta_if< + return packet_impl(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 - 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(row, col), internal::pset1(m_diagonal.diagonal().coeff(id))); } template - 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::dot(const MatrixBase& 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::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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::PlainObject MatrixBase::normalized() const { typedef typename internal::nested::type Nested; - typedef typename internal::unref::type _Nested; + typedef typename internal::remove_reference::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 clas typedef MatrixBase Base; EIGEN_DENSE_PUBLIC_INTERFACE(Flagged) - typedef typename internal::meta_if::ret, - ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; + typedef typename internal::conditional::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::forceAlignedAccess() */ template template -inline typename internal::makeconst,Derived&>::ret>::type +inline typename internal::add_const,Derived&>::type>::type MatrixBase::forceAlignedAccessIf() const { return derived(); @@ -148,7 +148,7 @@ MatrixBase::forceAlignedAccessIf() const */ template template -inline typename internal::meta_if,Derived&>::ret +inline typename internal::conditional,Derived&>::type MatrixBase::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 > { */ template struct scalar_product_op { enum { - Vectorizable = is_same_type::ret && packet_traits::HasMul && packet_traits::HasMul + Vectorizable = is_same::value && packet_traits::HasMul && packet_traits::HasMul }; typedef typename scalar_product_traits::ReturnType result_type; EIGEN_EMPTY_STRUCT_CTOR(scalar_product_op) @@ -303,7 +303,7 @@ struct scalar_cast_op { }; template struct functor_traits > -{ enum { Cost = is_same_type::ret ? 0 : NumTraits::AddCost, PacketAccess = false }; }; +{ enum { Cost = is_same::value ? 0 : NumTraits::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(m_other)); } - typename makeconst::Nested>::type m_other; + typename add_const::Nested>::type m_other; }; template struct functor_traits > @@ -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::Nested>::type m_other; + typename add_const::Nested>::type m_other; }; template struct functor_traits > @@ -458,7 +458,7 @@ struct scalar_quotient1_impl { 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::Nested>::type m_other; + typename add_const::Nested>::type m_other; }; template struct functor_traits > 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 -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::run(x); } @@ -215,7 +215,7 @@ struct imag_ref_retval }; template -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::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 class MatrixBase /** \internal Represents a matrix with all coefficients equal to one another*/ typedef CwiseNullaryOp,Derived> ConstantReturnType; /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::meta_if::IsComplex, + typedef typename internal::conditional::IsComplex, CwiseUnaryOp, Eigen::Transpose >, Transpose - >::ret AdjointReturnType; + >::type AdjointReturnType; /** \internal Return type of eigenvalues() */ typedef Matrix, internal::traits::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; /** \internal the return type of identity */ @@ -277,8 +277,8 @@ template class MatrixBase inline const ForceAlignedAccess forceAlignedAccess() const; inline ForceAlignedAccess forceAlignedAccess(); - template inline typename internal::makeconst,Derived&>::ret>::type forceAlignedAccessIf() const; - template inline typename internal::meta_if,Derived&>::ret forceAlignedAccessIf(); + template inline typename internal::add_const,Derived&>::type>::type forceAlignedAccessIf() const; + template inline typename internal::conditional,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 struct GenericNumTraits }; typedef T Real; - typedef typename internal::meta_if< + typedef typename internal::conditional< IsInteger, - typename internal::meta_if::ret, + typename internal::conditional::type, T - >::ret NonInteger; + >::type NonInteger; typedef T Nested; inline static Real epsilon() { return std::numeric_limits::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::ret && extract_data(dst) == extract_data(m_matrix)) + if(is_same::value && extract_data(dst) == extract_data(m_matrix)) { // apply the permutation inplace Matrix 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::type template EIGEN_STRONG_INLINE Derived& _set(const DenseBase& other) { - _set_selector(other.derived(), typename internal::meta_if(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::meta_true, internal::meta_false>::ret()); + _set_selector(other.derived(), typename internal::conditional(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::true_type, internal::false_type>::type()); return this->derived(); } template - 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 - 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::type template void _swap(DenseBase EIGEN_REF_TO_TEMPORARY other) { - enum { SwapPointers = internal::is_same_type::ret && Base::SizeAtCompileTime==Dynamic }; + enum { SwapPointers = internal::is_same::value && Base::SizeAtCompileTime==Dynamic }; internal::matrix_swap_impl::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 public: GeneralProduct(const Lhs& lhs, const Rhs& rhs) { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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 GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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 GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) { -// EIGEN_STATIC_ASSERT((internal::is_same_type::ret), +// EIGEN_STATIC_ASSERT((internal::is_same::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::ret MatrixType; + typedef typename internal::conditional::type MatrixType; template 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& prod, typename Derived::Scalar x) { return ScaledProduct(prod.derived(), x); } template -typename internal::enable_if::ret, +typename internal::enable_if::value, const ScaledProduct >::type operator*(const ProductBase& prod, typename Derived::RealScalar x) { return ScaledProduct(prod.derived(), x); } @@ -195,7 +195,7 @@ operator*(typename Derived::Scalar x,const ProductBase& prod) { return ScaledProduct(prod.derived(), x); } template -typename internal::enable_if::ret, +typename internal::enable_if::value, const ScaledProduct >::type operator*(typename Derived::RealScalar x,const ProductBase& prod) { return ScaledProduct(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 > typedef typename traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; enum { RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic ? Dynamic @@ -81,7 +81,7 @@ template class Replicate inline explicit Replicate(const OriginalMatrixType& matrix) : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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 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::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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 > typedef typename traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::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 struct traits > : traits { typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::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::operator*=(const Scalar& other) template inline Derived& DenseBase::operator/=(const Scalar& other) { - typedef typename internal::meta_if::IsInteger, + typedef typename internal::conditional::IsInteger, internal::scalar_quotient_op, - internal::scalar_product_op >::ret BinOp; + internal::scalar_product_op >::type BinOp; typedef typename Derived::PlainObject PlainObject; SelfCwiseBinaryOp tmp(derived()); tmp = PlainObject::Constant(rows(),cols(), NumTraits::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::solveInPlace(const MatrixBase::Flags & RowMajorBit && OtherDerived::IsVectorAtCompileTime }; - typedef typename internal::meta_if::type, OtherDerived&>::ret OtherCopy; + typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; OtherCopy otherCopy(other); - internal::triangular_solver_selector::type, + internal::triangular_solver_selector::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 > : traits { typedef typename MatrixType::Scalar Scalar; typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; typedef typename traits::StorageKind StorageKind; typedef typename traits::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::ret && extract_data(dst) == extract_data(m_matrix))) + if(!(is_same::value && extract_data(dst) == extract_data(m_matrix))) dst = m_matrix; for(int k=(Transposed?size-1:0) ; Transposed?k>=0:k struct traits > : traits { typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::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 class VectorwiseOp typedef typename ExpressionType::Scalar Scalar; typedef typename ExpressionType::RealScalar RealScalar; typedef typename ExpressionType::Index Index; - typedef typename internal::meta_if::ret, - ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; + typedef typename internal::conditional::ret, + ExpressionType, const ExpressionType&>::type ExpressionTypeNested; template class Functor, typename Scalar=typename internal::traits::Scalar> struct ReturnType @@ -211,9 +211,9 @@ template class VectorwiseOp /** \internal * \returns the i-th subvector according to the \c Direction */ - typedef typename internal::meta_if::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 > LhsRowMajor = LhsFlags & RowMajorBit, RhsRowMajor = RhsFlags & RowMajorBit, - SameType = is_same_type::ret, + SameType = is_same::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. - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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::type _RhsPacket; typedef typename packet_traits::type _ResPacket; - typedef typename meta_if::ret LhsPacket; - typedef typename meta_if::ret RhsPacket; - typedef typename meta_if::ret ResPacket; + typedef typename conditional::type LhsPacket; + typedef typename conditional::type RhsPacket; + typedef typename conditional::type ResPacket; typedef ResPacket AccPacket; @@ -256,9 +256,9 @@ public: typedef typename packet_traits::type _RhsPacket; typedef typename packet_traits::type _ResPacket; - typedef typename meta_if::ret LhsPacket; - typedef typename meta_if::ret RhsPacket; - typedef typename meta_if::ret ResPacket; + typedef typename conditional::type LhsPacket; + typedef typename conditional::type RhsPacket; + typedef typename conditional::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::ret()); + madd_impl(a, b, c, tmp, typename conditional::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::ret LhsPacket; - typedef typename meta_if::ret RhsPacket; - typedef typename meta_if::ret ResPacket; - typedef typename meta_if::ret AccPacket; + typedef typename conditional::type LhsPacket; + typedef typename conditional::type RhsPacket; + typedef typename conditional::type ResPacket; + typedef typename conditional::type AccPacket; EIGEN_STRONG_INLINE void initAcc(Scalar& p) { p = Scalar(0); } @@ -461,9 +461,9 @@ public: typedef typename packet_traits::type _RhsPacket; typedef typename packet_traits::type _ResPacket; - typedef typename meta_if::ret LhsPacket; - typedef typename meta_if::ret RhsPacket; - typedef typename meta_if::ret ResPacket; + typedef typename conditional::type LhsPacket; + typedef typename conditional::type RhsPacket; + typedef typename conditional::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::ret()); + madd_impl(a, b, c, tmp, typename conditional::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 class gemm_blocking_space : public level3_blocking< - typename meta_if::ret, - typename meta_if::ret> + typename conditional::type, + typename conditional::type> { enum { Transpose = StorageOrder==RowMajor, ActualRows = Transpose ? MaxCols : MaxRows, ActualCols = Transpose ? MaxRows : MaxCols }; - typedef typename meta_if::ret LhsScalar; - typedef typename meta_if::ret RhsScalar; + typedef typename conditional::type LhsScalar; + typedef typename conditional::type RhsScalar; typedef gebp_traits Traits; enum { SizeA = ActualRows * MaxDepth, @@ -329,14 +329,14 @@ class gemm_blocking_space class gemm_blocking_space : public level3_blocking< - typename meta_if::ret, - typename meta_if::ret> + typename conditional::type, + typename conditional::type> { enum { Transpose = StorageOrder==RowMajor }; - typedef typename meta_if::ret LhsScalar; - typedef typename meta_if::ret RhsScalar; + typedef typename conditional::type LhsScalar; + typedef typename conditional::type RhsScalar; typedef gebp_traits 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::type _LhsPacket; typedef typename packet_traits::type _RhsPacket; typedef typename packet_traits::type _ResPacket; -typedef typename meta_if::ret LhsPacket; -typedef typename meta_if::ret RhsPacket; -typedef typename meta_if::ret ResPacket; +typedef typename conditional::type LhsPacket; +typedef typename conditional::type RhsPacket; +typedef typename conditional::type ResPacket; EIGEN_DONT_INLINE static void run( Index rows, Index cols, @@ -313,9 +313,9 @@ typedef typename packet_traits::type _LhsPacket; typedef typename packet_traits::type _RhsPacket; typedef typename packet_traits::type _ResPacket; -typedef typename meta_if::ret LhsPacket; -typedef typename meta_if::ret RhsPacket; -typedef typename meta_if::ret ResPacket; +typedef typename conditional::type LhsPacket; +typedef typename conditional::type RhsPacket; +typedef typename conditional::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 }; template struct conj_expr_if - : meta_if::Scalar>,T> > {}; } // end namespace internal @@ -88,8 +88,8 @@ SelfAdjointView& SelfAdjointView enum { IsRowMajor = (internal::traits::Flags&RowMajorBit) ? 1 : 0 }; internal::selfadjoint_rank2_update_selector::ret>::type, - typename internal::cleantype::ret>::type, + typename internal::cleantype::type>::type, + typename internal::cleantype::type>::type, (IsRowMajor ? int(UpLo==Upper ? Lower : Upper) : UpLo)> ::run(const_cast(_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::Scalar alpha) { static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; - typename conj_expr_if::ret cjLhs(lhs); - typename conj_expr_if::ret cjRhs(rhs); + typename conj_expr_if::type cjLhs(lhs); + typename conj_expr_if::type cjRhs(rhs); Index size = lhs.cols(); for (Index pi=0; pi::Scalar alpha) { static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; - typename conj_expr_if::ret cjLhs(lhs); - typename conj_expr_if::ret cjRhs(rhs); + typename conj_expr_if::type cjLhs(lhs); + typename conj_expr_if::type cjRhs(rhs); Index size = lhs.cols(); for (Index pi=0; pi struct blas_traits int(inner_stride_at_compile_time::ret) == 1) ) ? 1 : 0 }; - typedef typename meta_if::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 > typedef Transpose XprType; typedef Transpose ExtractType; typedef Transpose _ExtractType; - typedef typename meta_if::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 -struct meta_if { typedef Then ret; }; +struct conditional { typedef Then type; }; template -struct meta_if { typedef Else ret; }; +struct conditional { typedef Else type; }; -template struct is_same_type { enum { ret = 0 }; }; -template struct is_same_type { enum { ret = 1 }; }; +template struct is_same { enum { value = 0 }; }; +template struct is_same { enum { value = 1 }; }; -template struct unref { typedef T type; }; -template struct unref { typedef T type; }; +template struct remove_reference { typedef T type; }; +template struct remove_reference { typedef T type; }; -template struct unpointer { typedef T type; }; -template struct unpointer { typedef T type; }; -template struct unpointer { typedef T type; }; +template struct remove_pointer { typedef T type; }; +template struct remove_pointer { typedef T type; }; +template struct remove_pointer { typedef T type; }; -template struct unconst { typedef T type; }; -template struct unconst { typedef T type; }; -template struct unconst { typedef T & type; }; -template struct unconst { typedef T * type; }; +template struct remove_const { typedef T type; }; +template struct remove_const { typedef T type; }; +template struct remove_const { typedef T & type; }; +template struct remove_const { typedef T * type; }; template struct cleantype { typedef T type; }; template struct cleantype { typedef typename cleantype::type type; }; @@ -66,33 +66,33 @@ template struct cleantype { typedef typename cleantype template struct cleantype { typedef typename cleantype::type type; }; template struct cleantype { typedef typename cleantype::type type; }; -template struct is_arithmetic { enum { ret = false }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic{ enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; -template<> struct is_arithmetic { enum { ret = true }; }; +template struct is_arithmetic { enum { value = false }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic{ enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; +template<> struct is_arithmetic { enum { value = true }; }; -template struct makeconst { typedef const T type; }; -template struct makeconst { typedef const T type; }; -template struct makeconst { typedef const T& type; }; -template struct makeconst { typedef const T& type; }; -template struct makeconst { typedef const T* type; }; -template struct makeconst { typedef const T* type; }; +template struct add_const { typedef const T type; }; +template struct add_const { typedef const T type; }; +template struct add_const { typedef const T& type; }; +template struct add_const { typedef const T& type; }; +template struct add_const { typedef const T* type; }; +template struct add_const { typedef const T* type; }; template struct makeconst_return_type { - typedef typename meta_if::ret, T, typename makeconst::type>::ret type; + typedef typename conditional::value, T, typename add_const::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 struct promote_index_type { - typedef typename meta_if<(sizeof(I1)::ret type; + typedef typename conditional<(sizeof(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 template struct ref_selector { - typedef typename meta_if< + typedef typename conditional< bool(traits::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::type> str CostNoEval = (N-1) * int(CoeffReadCost) }; - typedef typename meta_if< + typedef typename conditional< ( int(traits::Flags) & EvalBeforeNestingBit ) || ( int(CostEval) <= int(CostNoEval) ), PlainObject, typename ref_selector::type - >::ret type; + >::type type; /* this is what the above logic should be updated to look like: enum { @@ -334,14 +334,14 @@ template::type> str CostNoEval = n == Dynamic || (CoeffReadCost == Dynamic && n>1) ? int(Dynamic) : (n-1) * int(CoeffReadCost) }; - typedef typename meta_if< + typedef typename conditional< ( int(traits::Flags) & EvalBeforeNestingBit ) || ( int(CostNoEval) == Dynamic ? true : int(CostEval) == Dynamic ? false : int(CostEval) <= int(CostNoEval) ), PlainObject, typename ref_selector::type - >::ret type; + >::type type; */ }; @@ -371,7 +371,7 @@ struct dense_xpr_base /** \internal Helper base class to add a scalar multiple operator * overloads for complex types */ template::ret > + bool EnableIt = !is_same::value > struct special_scalar_op_base : public DenseCoeffsBase { // dummy operator* so that the @@ -412,8 +412,8 @@ template struct cast_return_type typedef typename XprType::Scalar CurrentScalarType; typedef typename cleantype::type _CastType; typedef typename _CastType::Scalar NewScalarType; - typedef typename meta_if::ret, - const XprType&,CastType>::ret type; + typedef typename conditional::value, + const XprType&,CastType>::type type; }; template struct promote_storage_type; @@ -434,11 +434,11 @@ struct plain_row_type typedef Array ArrayRowType; - typedef typename meta_if< - is_same_type< typename traits::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits::XprKind, MatrixXpr >::value, MatrixRowType, ArrayRowType - >::ret type; + >::type type; }; template @@ -449,11 +449,11 @@ struct plain_col_type typedef Array ArrayColType; - typedef typename meta_if< - is_same_type< typename traits::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits::XprKind, MatrixXpr >::value, MatrixColType, ArrayColType - >::ret type; + >::type type; }; template @@ -465,11 +465,11 @@ struct plain_diag_type typedef Matrix MatrixDiagType; typedef Array ArrayDiagType; - typedef typename meta_if< - is_same_type< typename traits::XprKind, MatrixXpr >::ret, + typedef typename conditional< + is_same< typename traits::XprKind, MatrixXpr >::value, MatrixDiagType, ArrayDiagType - >::ret type; + >::type type; }; } // end namespace internal diff --git a/Eigen/src/Eigen2Support/Cwise.h b/Eigen/src/Eigen2Support/Cwise.h index 74fa63aaa..c80f56a69 100644 --- a/Eigen/src/Eigen2Support/Cwise.h +++ b/Eigen/src/Eigen2Support/Cwise.h @@ -62,8 +62,8 @@ template class Cwise public: typedef typename internal::traits::Scalar Scalar; - typedef typename internal::meta_if::ret, - ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; + typedef typename internal::conditional::ret, + ExpressionType, const ExpressionType&>::type ExpressionTypeNested; typedef CwiseUnaryOp, ExpressionType> ScalarAddReturnType; inline Cwise(const ExpressionType& matrix) : m_matrix(matrix) {} diff --git a/Eigen/src/Eigen2Support/Minor.h b/Eigen/src/Eigen2Support/Minor.h index a058ac1e0..3b3acd605 100644 --- a/Eigen/src/Eigen2Support/Minor.h +++ b/Eigen/src/Eigen2Support/Minor.h @@ -45,7 +45,7 @@ struct traits > : traits { typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; typedef typename MatrixType::StorageKind StorageKind; enum { RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ? diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h index fac79cf96..d70c4d433 100644 --- a/Eigen/src/Eigenvalues/Tridiagonalization.h +++ b/Eigen/src/Eigenvalues/Tridiagonalization.h @@ -86,17 +86,17 @@ template class Tridiagonalization typedef typename internal::plain_col_type::type DiagonalType; typedef Matrix SubDiagonalType; - typedef typename internal::meta_if::IsComplex, + typedef typename internal::conditional::IsComplex, typename Diagonal::RealReturnType, Diagonal - >::ret DiagonalReturnType; + >::type DiagonalReturnType; - typedef typename internal::meta_if::IsComplex, + typedef typename internal::conditional::IsComplex, typename Diagonal< Block,0 >::RealReturnType, Diagonal< Block,0 > - >::ret SubDiagonalReturnType; + >::type SubDiagonalReturnType; /** \brief Return type of matrixQ() */ typedef typename HouseholderSequence::ConjugateReturnType HouseholderSequenceType; diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index c6b387b5b..c9304e34c 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -48,7 +48,7 @@ struct traits > { typedef typename traits::StorageKind StorageKind; typedef typename nested::type MatrixTypeNested; - typedef typename unref::type _MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; enum { RowsPlusOne = (MatrixType::RowsAtCompileTime != Dynamic) ? int(MatrixType::RowsAtCompileTime) + 1 : Dynamic, diff --git a/Eigen/src/Geometry/OrthoMethods.h b/Eigen/src/Geometry/OrthoMethods.h index f4695827d..31582d7ae 100644 --- a/Eigen/src/Geometry/OrthoMethods.h +++ b/Eigen/src/Geometry/OrthoMethods.h @@ -114,7 +114,7 @@ const typename VectorwiseOp::CrossReturnType VectorwiseOp::cross(const MatrixBase& other) const { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,3) - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) CrossReturnType res(_expression().rows(),_expression().cols()); diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index ebc720b6c..afbeef26c 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -375,7 +375,7 @@ template EIGEN_STRONG_INLINE Quaternion::Scalar> QuaternionBase::operator* (const QuaternionBase& other) const { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) return internal::quat_product::Scalar, @@ -448,7 +448,7 @@ template template inline Derived& QuaternionBase::operator=(const MatrixBase& xpr) { - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) internal::quaternionbase_assign_impl::run(*this, xpr.derived()); return derived(); diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index b2ed121b6..896bbfd48 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -198,13 +198,13 @@ public: /** type of read/write reference to the linear part of the transformation */ typedef Block LinearPart; /** type of read/write reference to the affine part of the transformation */ - typedef typename internal::meta_if >::ret AffinePart; + Block >::type AffinePart; /** type of read/write reference to the affine part of the transformation */ - typedef typename internal::meta_if >::ret AffinePartNested; + Block >::type AffinePartNested; /** type of a vector */ typedef Matrix VectorType; /** type of a read/write reference to the translation part of the rotation */ diff --git a/Eigen/src/Geometry/Umeyama.h b/Eigen/src/Geometry/Umeyama.h index c34eb1a98..b50f46173 100644 --- a/Eigen/src/Geometry/Umeyama.h +++ b/Eigen/src/Geometry/Umeyama.h @@ -113,7 +113,7 @@ umeyama(const MatrixBase& src, const MatrixBase& dst, boo typedef typename Derived::Index Index; EIGEN_STATIC_ASSERT(!NumTraits::IsComplex, NUMERIC_TYPE_MUST_BE_REAL) - EIGEN_STATIC_ASSERT((internal::is_same_type::Scalar>::ret), + EIGEN_STATIC_ASSERT((internal::is_same::Scalar>::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) enum { Dimension = EIGEN_SIZE_MIN_PREFER_DYNAMIC(Derived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime) }; diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h index b9be94093..ef4c0ca79 100644 --- a/Eigen/src/Householder/HouseholderSequence.h +++ b/Eigen/src/Householder/HouseholderSequence.h @@ -123,9 +123,9 @@ template class HouseholderS typedef HouseholderSequence< VectorsType, - typename internal::meta_if::IsComplex, + typename internal::conditional::IsComplex, typename internal::cleantype::type, - CoeffsType>::ret, + CoeffsType>::type, Side > ConjugateReturnType; @@ -167,7 +167,7 @@ template class HouseholderS // FIXME find a way to pass this temporary if the user want to Matrix temp(rows()); - if( internal::is_same_type::type,DestType>::ret + if( internal::is_same::type,DestType>::value && internal::extract_data(dst) == internal::extract_data(m_vectors)) { // in-place diff --git a/Eigen/src/Jacobi/Jacobi.h b/Eigen/src/Jacobi/Jacobi.h index 58f6c98fb..fb5a2c717 100644 --- a/Eigen/src/Jacobi/Jacobi.h +++ b/Eigen/src/Jacobi/Jacobi.h @@ -80,8 +80,8 @@ template class JacobiRotation void makeGivens(const Scalar& p, const Scalar& q, Scalar* z=0); protected: - void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::meta_true); - void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::meta_false); + void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::true_type); + void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::false_type); Scalar m_c, m_s; }; @@ -157,13 +157,13 @@ inline bool JacobiRotation::makeJacobi(const MatrixBase& m, typ template void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* z) { - makeGivens(p, q, z, typename internal::meta_if::IsComplex, internal::meta_true, internal::meta_false>::ret()); + makeGivens(p, q, z, typename internal::conditional::IsComplex, internal::true_type, internal::false_type>::type()); } // specialization for complexes template -void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::meta_true) +void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::true_type) { if(q==Scalar(0)) { @@ -218,7 +218,7 @@ void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar // specialization for reals template -void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::meta_false) +void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::false_type) { if(q==0) diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h index 99286523a..50061788b 100644 --- a/Eigen/src/LU/Inverse.h +++ b/Eigen/src/LU/Inverse.h @@ -364,11 +364,11 @@ inline void MatrixBase::computeInverseAndDetWithCheck( eigen_assert(rows() == cols()); // for 2x2, it's worth giving a chance to avoid evaluating. // for larger sizes, evaluating has negligible cost and limits code size. - typedef typename internal::meta_if< + typedef typename internal::conditional< RowsAtCompileTime == 2, typename internal::cleantype::type>::type, PlainObject - >::ret MatrixType; + >::type MatrixType; internal::compute_inverse_and_det_with_check::run (derived(), absDeterminantThreshold, inverse, determinant, invertible); } diff --git a/Eigen/src/Sparse/SparseCwiseUnaryOp.h b/Eigen/src/Sparse/SparseCwiseUnaryOp.h index 709661954..aa068835f 100644 --- a/Eigen/src/Sparse/SparseCwiseUnaryOp.h +++ b/Eigen/src/Sparse/SparseCwiseUnaryOp.h @@ -32,7 +32,7 @@ // UnaryOp(typename MatrixType::Scalar) // >::type Scalar; // typedef typename MatrixType::Nested MatrixTypeNested; -// typedef typename internal::unref::type _MatrixTypeNested; +// typedef typename internal::remove_reference::type _MatrixTypeNested; // enum { // CoeffReadCost = _MatrixTypeNested::CoeffReadCost + internal::functor_traits::Cost // }; @@ -45,7 +45,7 @@ class CwiseUnaryOpImpl public: class InnerIterator; -// typedef typename internal::unref::type _LhsNested; +// typedef typename internal::remove_reference::type _LhsNested; typedef CwiseUnaryOp Derived; EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) @@ -87,7 +87,7 @@ class CwiseUnaryViewImpl public: class InnerIterator; -// typedef typename internal::unref::type _LhsNested; +// typedef typename internal::remove_reference::type _LhsNested; typedef CwiseUnaryView Derived; EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) diff --git a/Eigen/src/Sparse/SparseDot.h b/Eigen/src/Sparse/SparseDot.h index 13605ca88..1f10f71a4 100644 --- a/Eigen/src/Sparse/SparseDot.h +++ b/Eigen/src/Sparse/SparseDot.h @@ -33,7 +33,7 @@ SparseMatrixBase::dot(const MatrixBase& 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::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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()); @@ -57,7 +57,7 @@ SparseMatrixBase::dot(const SparseMatrixBase& other) cons 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::ret), + EIGEN_STATIC_ASSERT((internal::is_same::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()); diff --git a/Eigen/src/Sparse/SparseMatrixBase.h b/Eigen/src/Sparse/SparseMatrixBase.h index eb88c8a77..8750de12c 100644 --- a/Eigen/src/Sparse/SparseMatrixBase.h +++ b/Eigen/src/Sparse/SparseMatrixBase.h @@ -98,19 +98,19 @@ template class SparseMatrixBase : public EigenBase }; /* \internal the return type of MatrixBase::conjugate() */ -// typedef typename internal::meta_if::IsComplex, +// typedef typename internal::conditional::IsComplex, // const SparseCwiseUnaryOp, Derived>, // const Derived& -// >::ret ConjugateReturnType; +// >::type ConjugateReturnType; /* \internal the return type of MatrixBase::real() */ // typedef SparseCwiseUnaryOp, Derived> RealReturnType; /* \internal the return type of MatrixBase::imag() */ // typedef SparseCwiseUnaryOp, Derived> ImagReturnType; /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::meta_if::IsComplex, + typedef typename internal::conditional::IsComplex, CwiseUnaryOp, Eigen::Transpose >, Transpose - >::ret AdjointReturnType; + >::type AdjointReturnType; typedef SparseMatrix PlainObject; @@ -132,7 +132,7 @@ template class SparseMatrixBase : public EigenBase /** \internal the return type of coeff() */ - typedef typename internal::meta_if<_HasDirectAccess, const Scalar&, Scalar>::ret CoeffReturnType; + typedef typename internal::conditional<_HasDirectAccess, const Scalar&, Scalar>::type CoeffReturnType; /** \internal Represents a matrix with all coefficients equal to one another*/ typedef CwiseNullaryOp,Matrix > ConstantReturnType; @@ -197,7 +197,7 @@ template class SparseMatrixBase : public EigenBase enum { Flip = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit) }; const Index outerSize = other.outerSize(); - //typedef typename internal::meta_if, Derived>::ret TempType; + //typedef typename internal::conditional, Derived>::type TempType; // thanks to shallow copies, we always eval to a tempary Derived temp(other.rows(), other.cols()); @@ -638,7 +638,7 @@ template class SparseMatrixBase : public EigenBase // { // EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) // EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) -// EIGEN_STATIC_ASSERT((internal::is_same_type::ret), +// EIGEN_STATIC_ASSERT((internal::is_same::value), // YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) // // eigen_assert(derived().size() == other.size()); diff --git a/Eigen/src/Sparse/SparseProduct.h b/Eigen/src/Sparse/SparseProduct.h index aa8bda23d..e994dbb99 100644 --- a/Eigen/src/Sparse/SparseProduct.h +++ b/Eigen/src/Sparse/SparseProduct.h @@ -36,13 +36,13 @@ struct SparseSparseProductReturnType TransposeLhs = LhsRowMajor && (!RhsRowMajor) }; - typedef typename internal::meta_if, - const typename internal::nested::type>::ret LhsNested; + const typename internal::nested::type>::type LhsNested; - typedef typename internal::meta_if, - const typename internal::nested::type>::ret RhsNested; + const typename internal::nested::type>::type RhsNested; typedef SparseSparseProduct Type; }; diff --git a/Eigen/src/Sparse/SparseTriangularView.h b/Eigen/src/Sparse/SparseTriangularView.h index 2d5c9cf75..8d0256599 100644 --- a/Eigen/src/Sparse/SparseTriangularView.h +++ b/Eigen/src/Sparse/SparseTriangularView.h @@ -46,8 +46,8 @@ template class SparseTriangularView inline Index rows() { return m_matrix.rows(); } inline Index cols() { return m_matrix.cols(); } - typedef typename internal::meta_if::ret, - MatrixType, const MatrixType&>::ret MatrixTypeNested; + typedef typename internal::conditional::ret, + MatrixType, const MatrixType&>::type MatrixTypeNested; inline SparseTriangularView(const MatrixType& matrix) : m_matrix(matrix) {} diff --git a/Eigen/src/Sparse/TriangularSolver.h b/Eigen/src/Sparse/TriangularSolver.h index 06721ce86..73468e044 100644 --- a/Eigen/src/Sparse/TriangularSolver.h +++ b/Eigen/src/Sparse/TriangularSolver.h @@ -175,11 +175,11 @@ void SparseTriangularView::solveInPlace(MatrixBase::Flags & RowMajorBit }; - typedef typename internal::meta_if::type, OtherDerived&>::ret OtherCopy; + typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; OtherCopy otherCopy(other.derived()); - internal::sparse_solve_triangular_selector::type, Mode>::run(m_matrix, otherCopy); + internal::sparse_solve_triangular_selector::type, Mode>::run(m_matrix, otherCopy); if (copy) other = otherCopy; @@ -302,8 +302,8 @@ void SparseTriangularView::solveInPlace(SparseMatrixBase::Flags & RowMajorBit }; -// typedef typename internal::meta_if::type, OtherDerived&>::ret OtherCopy; +// typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; // OtherCopy otherCopy(other.derived()); internal::sparse_solve_triangular_sparse_selector::run(m_matrix, other.derived()); diff --git a/Eigen/src/plugins/CommonCwiseUnaryOps.h b/Eigen/src/plugins/CommonCwiseUnaryOps.h index 775e77c81..f2da51efa 100644 --- a/Eigen/src/plugins/CommonCwiseUnaryOps.h +++ b/Eigen/src/plugins/CommonCwiseUnaryOps.h @@ -32,20 +32,20 @@ typedef CwiseUnaryOp, Derived> ScalarMultip /** \internal Represents a quotient of an expression by a scalar*/ typedef CwiseUnaryOp, Derived> ScalarQuotient1ReturnType; /** \internal the return type of conjugate() */ -typedef typename internal::meta_if::IsComplex, +typedef typename internal::conditional::IsComplex, const CwiseUnaryOp, Derived>, const Derived& - >::ret ConjugateReturnType; + >::type ConjugateReturnType; /** \internal the return type of real() const */ -typedef typename internal::meta_if::IsComplex, +typedef typename internal::conditional::IsComplex, const CwiseUnaryOp, Derived>, const Derived& - >::ret RealReturnType; + >::type RealReturnType; /** \internal the return type of real() */ -typedef typename internal::meta_if::IsComplex, +typedef typename internal::conditional::IsComplex, CwiseUnaryView, Derived>, Derived& - >::ret NonConstRealReturnType; + >::type NonConstRealReturnType; /** \internal the return type of imag() const */ typedef CwiseUnaryOp, Derived> ImagReturnType; /** \internal the return type of imag() */ diff --git a/test/adjoint.cpp b/test/adjoint.cpp index f37bad787..72cbf3406 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -41,7 +41,7 @@ template void adjoint(const MatrixType& m) Index cols = m.cols(); RealScalar largerEps = test_precision(); - if (internal::is_same_type::ret) + if (internal::is_same::value) largerEps = RealScalar(1e-3f); MatrixType m1 = MatrixType::Random(rows, cols), diff --git a/test/array.cpp b/test/array.cpp index 70473bd1d..72d3584e6 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -206,11 +206,11 @@ void test_array() CALL_SUBTEST_5( array_real(ArrayXXf(8, 12)) ); } - VERIFY((internal::is_same_type< internal::global_math_functions_filtering_base::type, int >::ret)); - VERIFY((internal::is_same_type< internal::global_math_functions_filtering_base::type, float >::ret)); - VERIFY((internal::is_same_type< internal::global_math_functions_filtering_base::type, ArrayBase >::ret)); + VERIFY((internal::is_same< internal::global_math_functions_filtering_base::type, int >::value)); + VERIFY((internal::is_same< internal::global_math_functions_filtering_base::type, float >::value)); + VERIFY((internal::is_same< internal::global_math_functions_filtering_base::type, ArrayBase >::value)); typedef CwiseUnaryOp, ArrayXd > Xpr; - VERIFY((internal::is_same_type< internal::global_math_functions_filtering_base::type, + VERIFY((internal::is_same< internal::global_math_functions_filtering_base::type, ArrayBase - >::ret)); + >::value)); } diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 0a0424aa1..1a6d4bed6 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -78,7 +78,7 @@ template void cholesky(const MatrixType& m) //symm.template part().setZero(); #ifdef HAS_GSL -// if (internal::is_same_type::ret) +// if (internal::is_same::value) // { // typedef GslTraits Gsl; // typename Gsl::Matrix gMatA=0, gSymm=0; diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp index 9a40ed529..dadf4bfca 100644 --- a/test/eigensolver_selfadjoint.cpp +++ b/test/eigensolver_selfadjoint.cpp @@ -63,7 +63,7 @@ template void selfadjointeigensolver(const MatrixType& m) GeneralizedSelfAdjointEigenSolver eiSymmGen(symmA, symmB); #ifdef HAS_GSL - if (internal::is_same_type::ret) + if (internal::is_same::value) { // restore symmA and symmB. symmA = MatrixType(symmA.template selfadjointView()); diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index 7e93d843e..124071f47 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -42,7 +42,7 @@ template void homogeneous(void) typedef Matrix T3MatrixType; Scalar largeEps = test_precision(); - if (internal::is_same_type::ret) + if (internal::is_same::value) largeEps = 1e-3f; VectorType v0 = VectorType::Random(), diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 6ad9a099d..aab7ed3f7 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -40,7 +40,7 @@ template void quaternion(void) typedef AngleAxis AngleAxisx; Scalar largeEps = test_precision(); - if (internal::is_same_type::ret) + if (internal::is_same::value) largeEps = 1e-3f; Scalar eps = internal::random() * Scalar(1e-2); @@ -96,7 +96,7 @@ template void quaternion(void) VERIFY_IS_APPROX( v2.normalized(),(q2.setFromTwoVectors(v1, v2)*v1).normalized()); VERIFY_IS_APPROX( v1.normalized(),(q2.setFromTwoVectors(v1, v1)*v1).normalized()); VERIFY_IS_APPROX(-v1.normalized(),(q2.setFromTwoVectors(v1,-v1)*v1).normalized()); - if (internal::is_same_type::ret) + if (internal::is_same::value) { v3 = (v1.array()+eps).matrix(); VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized()); diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index bc850e8dc..ac0c7ecbf 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -51,7 +51,7 @@ template void non_projective_only(void) typedef Translation Translation3; Scalar largeEps = test_precision(); - if (internal::is_same_type::ret) + if (internal::is_same::value) largeEps = 1e-2f; Vector3 v0 = Vector3::Random(), @@ -126,7 +126,7 @@ template void transformations(void) typedef Translation Translation3; Scalar largeEps = test_precision(); - if (internal::is_same_type::ret) + if (internal::is_same::value) largeEps = 1e-2f; Vector3 v0 = Vector3::Random(), diff --git a/test/meta.cpp b/test/meta.cpp index ba2167677..fb7d4548c 100644 --- a/test/meta.cpp +++ b/test/meta.cpp @@ -29,30 +29,30 @@ void test_meta() typedef float & FloatRef; typedef const float & ConstFloatRef; - VERIFY((internal::meta_if<(3<4),internal::meta_true, internal::meta_false>::ret::ret)); - VERIFY(( internal::is_same_type::ret)); - VERIFY((!internal::is_same_type::ret)); - VERIFY((!internal::is_same_type::ret)); - VERIFY((!internal::is_same_type::ret)); + VERIFY((internal::conditional<(3<4),internal::true_type, internal::false_type>::type::value)); + VERIFY(( internal::is_same::value)); + VERIFY((!internal::is_same::value)); + VERIFY((!internal::is_same::value)); + VERIFY((!internal::is_same::value)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); - VERIFY(( internal::is_same_type::type >::ret)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); + VERIFY(( internal::is_same::type >::value)); VERIFY(internal::meta_sqrt<1>::ret == 1); #define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt::ret == int(internal::sqrt(double(X)))) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 3d1fc2850..001dbc4d2 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -167,7 +167,7 @@ template void packetmath() CHECK_CWISE2(REF_SUB, internal::psub); CHECK_CWISE2(REF_MUL, internal::pmul); #ifndef EIGEN_VECTORIZE_ALTIVEC - if (!internal::is_same_type::ret) + if (!internal::is_same::value) CHECK_CWISE2(REF_DIV, internal::pdiv); #endif CHECK_CWISE1(internal::negate, internal::pnegate); diff --git a/test/qr.cpp b/test/qr.cpp index 85707a06d..7e9ac9df9 100644 --- a/test/qr.cpp +++ b/test/qr.cpp @@ -76,7 +76,7 @@ template void qr_invertible() MatrixType m1(size, size), m2(size, size), m3(size, size); m1 = MatrixType::Random(size,size); - if (internal::is_same_type::ret) + if (internal::is_same::value) { // let's build a matrix more stable to inverse MatrixType a = MatrixType::Random(size,size*2); diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 13495594b..ddfb1bad5 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -95,7 +95,7 @@ template void qr_invertible() MatrixType m1(size, size), m2(size, size), m3(size, size); m1 = MatrixType::Random(size,size); - if (internal::is_same_type::ret) + if (internal::is_same::value) { // let's build a matrix more stable to inverse MatrixType a = MatrixType::Random(size,size*2); diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index f77ac86a9..175c293b3 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -74,7 +74,7 @@ template void qr_invertible() MatrixType m1(size, size), m2(size, size), m3(size, size); m1 = MatrixType::Random(size,size); - if (internal::is_same_type::ret) + if (internal::is_same::value) { // let's build a matrix more stable to inverse MatrixType a = MatrixType::Random(size,size*2); diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 8dfa0baff..ad294fc98 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -54,7 +54,7 @@ template void sparse_basic(const SparseMatrixType& re for (int i=0; i<(int)zeroCoords.size(); ++i) { VERIFY_IS_MUCH_SMALLER_THAN( m.coeff(zeroCoords[i].x(),zeroCoords[i].y()), eps ); - if(internal::is_same_type >::ret) + if(internal::is_same >::value) VERIFY_RAISES_ASSERT( m.coeffRef(zeroCoords[0].x(),zeroCoords[0].y()) = 5 ); } VERIFY_IS_APPROX(m, refMat); diff --git a/test/swap.cpp b/test/swap.cpp index 4a575e7d7..b18562f28 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -42,7 +42,7 @@ template void swap(const MatrixType& m) typedef typename other_matrix_type::type OtherMatrixType; typedef typename MatrixType::Scalar Scalar; - eigen_assert((!internal::is_same_type::ret)); + eigen_assert((!internal::is_same::value)); typename MatrixType::Index rows = m.rows(); typename MatrixType::Index cols = m.cols(); diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT index 592898078..0b2823058 100644 --- a/unsupported/Eigen/FFT +++ b/unsupported/Eigen/FFT @@ -240,7 +240,7 @@ class FFT EIGEN_STATIC_ASSERT_VECTOR_ONLY(InputDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(ComplexDerived) EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(ComplexDerived,InputDerived) // size at compile-time - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) EIGEN_STATIC_ASSERT(int(InputDerived::Flags)&int(ComplexDerived::Flags)&DirectAccessBit, THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_WITH_DIRECT_MEMORY_ACCESS_SUCH_AS_MAP_OR_PLAIN_MATRICES) @@ -309,7 +309,7 @@ class FFT EIGEN_STATIC_ASSERT_VECTOR_ONLY(OutputDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(ComplexDerived) EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(ComplexDerived,OutputDerived) // size at compile-time - EIGEN_STATIC_ASSERT((internal::is_same_type::ret), + EIGEN_STATIC_ASSERT((internal::is_same::value), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) EIGEN_STATIC_ASSERT(int(OutputDerived::Flags)&int(ComplexDerived::Flags)&DirectAccessBit, THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_WITH_DIRECT_MEMORY_ACCESS_SUCH_AS_MAP_OR_PLAIN_MATRICES) diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 1809d4e93..a2aa42ad0 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -74,13 +74,13 @@ template struct auto_diff_special_op; template class AutoDiffScalar : public internal::auto_diff_special_op - <_DerType, !internal::is_same_type::type>::Scalar, - typename NumTraits::type>::Scalar>::Real>::ret> + <_DerType, !internal::is_same::type>::Scalar, + typename NumTraits::type>::Scalar>::Real>::value> { public: typedef internal::auto_diff_special_op - <_DerType, !internal::is_same_type::type>::Scalar, - typename NumTraits::type>::Scalar>::Real>::ret> Base; + <_DerType, !internal::is_same::type>::Scalar, + typename NumTraits::type>::Scalar>::Real>::value> Base; typedef typename internal::cleantype<_DerType>::type DerType; typedef typename internal::traits::Scalar Scalar; typedef typename NumTraits::Real Real; @@ -341,14 +341,14 @@ namespace internal { template struct auto_diff_special_op<_DerType, true> // : auto_diff_scalar_op<_DerType, typename NumTraits::Real, -// is_same_type::Real>::ret> +// is_same::Real>::value> { typedef typename cleantype<_DerType>::type DerType; typedef typename traits::Scalar Scalar; typedef typename NumTraits::Real Real; // typedef auto_diff_scalar_op<_DerType, typename NumTraits::Real, -// is_same_type::Real>::ret> Base; +// is_same::Real>::value> Base; // using Base::operator+; // using Base::operator+=; diff --git a/unsupported/Eigen/src/Skyline/SkylineProduct.h b/unsupported/Eigen/src/Skyline/SkylineProduct.h index 5a374743f..d7c536880 100644 --- a/unsupported/Eigen/src/Skyline/SkylineProduct.h +++ b/unsupported/Eigen/src/Skyline/SkylineProduct.h @@ -65,9 +65,9 @@ struct internal::traits > { CoeffReadCost = Dynamic }; - typedef typename internal::meta_if >, - MatrixBase > >::ret Base; + MatrixBase > >::type Base; }; namespace internal { diff --git a/unsupported/Eigen/src/SparseExtra/CholmodSupport.h b/unsupported/Eigen/src/SparseExtra/CholmodSupport.h index aee4ae00a..a5333bb70 100644 --- a/unsupported/Eigen/src/SparseExtra/CholmodSupport.h +++ b/unsupported/Eigen/src/SparseExtra/CholmodSupport.h @@ -30,22 +30,22 @@ namespace internal { template void cholmod_configure_matrix(CholmodType& mat) { - if (is_same_type::ret) + if (is_same::value) { mat.xtype = CHOLMOD_REAL; mat.dtype = CHOLMOD_SINGLE; } - else if (is_same_type::ret) + else if (is_same::value) { mat.xtype = CHOLMOD_REAL; mat.dtype = CHOLMOD_DOUBLE; } - else if (is_same_type >::ret) + else if (is_same >::value) { mat.xtype = CHOLMOD_COMPLEX; mat.dtype = CHOLMOD_SINGLE; } - else if (is_same_type >::ret) + else if (is_same >::value) { mat.xtype = CHOLMOD_COMPLEX; mat.dtype = CHOLMOD_DOUBLE; diff --git a/unsupported/Eigen/src/SparseExtra/SuperLUSupport.h b/unsupported/Eigen/src/SparseExtra/SuperLUSupport.h index 31a0ee509..a3e2de82e 100644 --- a/unsupported/Eigen/src/SparseExtra/SuperLUSupport.h +++ b/unsupported/Eigen/src/SparseExtra/SuperLUSupport.h @@ -134,13 +134,13 @@ struct SluMatrix : SuperMatrix template void setScalarType() { - if (internal::is_same_type::ret) + if (internal::is_same::value) Dtype = SLU_S; - else if (internal::is_same_type::ret) + else if (internal::is_same::value) Dtype = SLU_D; - else if (internal::is_same_type >::ret) + else if (internal::is_same >::value) Dtype = SLU_C; - else if (internal::is_same_type >::ret) + else if (internal::is_same >::value) Dtype = SLU_Z; else { diff --git a/unsupported/test/polynomialsolver.cpp b/unsupported/test/polynomialsolver.cpp index 9ba59ba2a..dd55f8b36 100644 --- a/unsupported/test/polynomialsolver.cpp +++ b/unsupported/test/polynomialsolver.cpp @@ -74,7 +74,7 @@ bool aux_evalSolver( const POLYNOMIAL& pols, SOLVER& psolve ) } #ifdef HAS_GSL - if (internal::is_same_type< Scalar, double>::ret) + if (internal::is_same< Scalar, double>::value) { typedef GslTraits Gsl; RootsType gslRoots(deg); diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp index 84dfbdda6..a004995f6 100644 --- a/unsupported/test/sparse_extra.cpp +++ b/unsupported/test/sparse_extra.cpp @@ -87,7 +87,7 @@ template void sparse_extra(const SparseMatrixType& re for (int i=0; i<(int)zeroCoords.size(); ++i) { VERIFY_IS_MUCH_SMALLER_THAN( m.coeff(zeroCoords[i].x(),zeroCoords[i].y()), eps ); - if(internal::is_same_type >::ret) + if(internal::is_same >::value) VERIFY_RAISES_ASSERT( m.coeffRef(zeroCoords[0].x(),zeroCoords[0].y()) = 5 ); } VERIFY_IS_APPROX(m, refMat);