From 421cbf08660fdf9458ea64ca6ceb197e75c6e698 Mon Sep 17 00:00:00 2001 From: Erik Schultheis Date: Wed, 16 Mar 2022 16:43:40 +0000 Subject: [PATCH] Replace Eigen type metaprogramming with corresponding std types and make use of alias templates --- Eigen/src/Cholesky/LLT.h | 2 +- Eigen/src/Core/ArithmeticSequence.h | 2 +- Eigen/src/Core/Array.h | 4 +- Eigen/src/Core/ArrayWrapper.h | 30 +++++----- Eigen/src/Core/AssignEvaluator.h | 10 ++-- Eigen/src/Core/Assign_MKL.h | 4 +- Eigen/src/Core/BandMatrix.h | 4 +- Eigen/src/Core/Block.h | 8 +-- Eigen/src/Core/CoreEvaluators.h | 6 +- Eigen/src/Core/CwiseBinaryOp.h | 20 +++---- Eigen/src/Core/CwiseTernaryOp.h | 36 ++++++------ Eigen/src/Core/CwiseUnaryOp.h | 8 +-- Eigen/src/Core/CwiseUnaryView.h | 8 +-- Eigen/src/Core/DenseBase.h | 38 ++++++------- Eigen/src/Core/DenseCoeffsBase.h | 10 ++-- Eigen/src/Core/Diagonal.h | 14 ++--- Eigen/src/Core/ForceAlignedAccess.h | 4 +- Eigen/src/Core/GeneralProduct.h | 12 ++-- Eigen/src/Core/GenericPacketMath.h | 16 +++--- Eigen/src/Core/IO.h | 10 ++-- Eigen/src/Core/IndexedView.h | 8 +-- Eigen/src/Core/Inverse.h | 4 +- Eigen/src/Core/MapBase.h | 18 +++--- Eigen/src/Core/MathFunctions.h | 26 ++++----- Eigen/src/Core/MatrixBase.h | 12 ++-- Eigen/src/Core/NumTraits.h | 6 +- Eigen/src/Core/PartialReduxEvaluator.h | 4 +- Eigen/src/Core/PermutationMatrix.h | 2 +- Eigen/src/Core/PlainObjectBase.h | 46 ++++++++-------- Eigen/src/Core/Product.h | 8 +-- Eigen/src/Core/ProductEvaluators.h | 32 +++++------ Eigen/src/Core/Ref.h | 10 ++-- Eigen/src/Core/Replicate.h | 8 +-- Eigen/src/Core/Reshaped.h | 8 +-- Eigen/src/Core/Reverse.h | 6 +- Eigen/src/Core/SelfAdjointView.h | 28 +++++----- Eigen/src/Core/SolveTriangular.h | 10 ++-- Eigen/src/Core/SolverBase.h | 16 +++--- Eigen/src/Core/StableNorm.h | 10 ++-- Eigen/src/Core/StlIterators.h | 48 ++++++++-------- Eigen/src/Core/Transpose.h | 18 +++--- Eigen/src/Core/TriangularMatrix.h | 18 +++--- Eigen/src/Core/VectorwiseOp.h | 2 +- Eigen/src/Core/Visitor.h | 4 +- Eigen/src/Core/arch/AltiVec/PacketMath.h | 8 +-- Eigen/src/Core/arch/GPU/Tuple.h | 12 ++-- .../Core/products/GeneralBlockPanelKernel.h | 54 +++++++++--------- Eigen/src/Core/products/GeneralMatrixMatrix.h | 24 ++++---- .../products/GeneralMatrixMatrixTriangular.h | 24 ++++---- Eigen/src/Core/products/GeneralMatrixVector.h | 6 +- .../Core/products/SelfadjointMatrixMatrix.h | 4 +- .../Core/products/SelfadjointMatrixVector.h | 8 +-- Eigen/src/Core/products/SelfadjointProduct.h | 10 ++-- .../Core/products/SelfadjointRank2Update.h | 17 +++--- .../Core/products/TriangularMatrixMatrix.h | 10 ++-- .../Core/products/TriangularMatrixVector.h | 10 ++-- .../Core/products/TriangularSolverVector.h | 17 +++--- Eigen/src/Core/util/BlasUtil.h | 8 +-- Eigen/src/Core/util/ForwardDeclarations.h | 2 +- Eigen/src/Core/util/IndexedViewHelper.h | 6 +- Eigen/src/Core/util/IntegralConstant.h | 2 +- Eigen/src/Core/util/Meta.h | 55 ++++++------------- Eigen/src/Core/util/Serializer.h | 4 +- Eigen/src/Core/util/XprHelper.h | 50 ++++++++--------- .../src/Eigenvalues/HessenbergDecomposition.h | 2 +- Eigen/src/Eigenvalues/Tridiagonalization.h | 16 +++--- Eigen/src/Geometry/Homogeneous.h | 18 +++--- Eigen/src/Geometry/OrthoMethods.h | 4 +- Eigen/src/Geometry/Quaternion.h | 8 +-- Eigen/src/Geometry/Transform.h | 10 ++-- Eigen/src/Geometry/Translation.h | 2 +- Eigen/src/Householder/HouseholderSequence.h | 36 ++++++------ .../ConjugateGradient.h | 10 ++-- .../IterativeSolverBase.h | 6 +- Eigen/src/Jacobi/Jacobi.h | 2 +- Eigen/src/LU/Determinant.h | 2 +- Eigen/src/LU/InverseImpl.h | 8 +-- Eigen/src/LU/arch/InverseSize4.h | 8 +-- Eigen/src/QR/ColPivHouseholderQR.h | 2 +- .../src/QR/CompleteOrthogonalDecomposition.h | 4 +- Eigen/src/QR/HouseholderQR.h | 2 +- Eigen/src/SVD/UpperBidiagonalization.h | 4 +- .../ConservativeSparseSparseProduct.h | 14 ++--- Eigen/src/SparseCore/SparseAssign.h | 8 +-- Eigen/src/SparseCore/SparseBlock.h | 10 ++-- Eigen/src/SparseCore/SparseDenseProduct.h | 36 ++++++------ Eigen/src/SparseCore/SparseFuzzy.h | 4 +- Eigen/src/SparseCore/SparseMap.h | 12 ++-- Eigen/src/SparseCore/SparseMatrix.h | 4 +- Eigen/src/SparseCore/SparseMatrixBase.h | 10 ++-- Eigen/src/SparseCore/SparsePermutation.h | 6 +- Eigen/src/SparseCore/SparseProduct.h | 16 +++--- Eigen/src/SparseCore/SparseRef.h | 4 +- Eigen/src/SparseCore/SparseSelfAdjointView.h | 8 +-- Eigen/src/SparseCore/SparseSolverBase.h | 4 +- .../SparseSparseProductWithPruning.h | 10 ++-- Eigen/src/SparseCore/SparseTriangularView.h | 4 +- Eigen/src/SparseCore/SparseView.h | 6 +- Eigen/src/SparseCore/TriangularSolver.h | 10 ++-- Eigen/src/SparseQR/SparseQR.h | 2 +- Eigen/src/StlSupport/details.h | 4 +- Eigen/src/plugins/BlockMethods.h | 8 +-- Eigen/src/plugins/CommonCwiseUnaryOps.h | 28 +++++----- Eigen/src/plugins/IndexedViewMethods.h | 34 ++++++------ blas/BandTriangularSolver.h | 16 ++---- blas/common.h | 2 +- doc/examples/make_circulant.cpp.evaluator | 2 +- test/basicstuff.cpp | 6 +- test/block.cpp | 14 ++--- test/geo_quaternion.cpp | 2 +- test/gpu_test_helper.h | 12 ++-- test/indexed_view.cpp | 4 +- test/inverse.cpp | 4 +- test/main.h | 6 +- test/mapped_matrix.cpp | 2 +- test/meta.cpp | 45 +++++---------- test/nesting_ops.cpp | 2 +- test/packetmath.cpp | 6 +- test/product.h | 4 +- test/product_small.cpp | 8 +-- test/random_without_cast_overflow.h | 52 +++++++++--------- test/ref.cpp | 2 +- test/reshape.cpp | 2 +- test/sparse_block.cpp | 4 +- test/sparse_ref.cpp | 2 +- test/swap.cpp | 4 +- unsupported/Eigen/CXX11/src/Tensor/Tensor.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorArgMax.h | 13 ++--- .../Eigen/CXX11/src/Tensor/TensorAssign.h | 16 +++--- .../Eigen/CXX11/src/Tensor/TensorBase.h | 22 ++++---- .../Eigen/CXX11/src/Tensor/TensorBlock.h | 18 +++--- .../CXX11/src/Tensor/TensorBroadcasting.h | 24 ++++---- .../Eigen/CXX11/src/Tensor/TensorChipping.h | 24 ++++---- .../CXX11/src/Tensor/TensorConcatenation.h | 16 +++--- .../CXX11/src/Tensor/TensorContraction.h | 50 ++++++++--------- .../CXX11/src/Tensor/TensorContractionGpu.h | 16 ++---- .../src/Tensor/TensorContractionMapper.h | 4 +- .../CXX11/src/Tensor/TensorContractionSycl.h | 47 ++++++++-------- .../src/Tensor/TensorContractionThreadPool.h | 18 +++--- .../Eigen/CXX11/src/Tensor/TensorConversion.h | 12 ++-- .../CXX11/src/Tensor/TensorConvolution.h | 16 +++--- .../CXX11/src/Tensor/TensorConvolutionSycl.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorCustomOp.h | 26 ++++----- .../Eigen/CXX11/src/Tensor/TensorDeviceSycl.h | 6 +- .../Eigen/CXX11/src/Tensor/TensorDimensions.h | 4 +- .../Eigen/CXX11/src/Tensor/TensorEvalTo.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorEvaluator.h | 30 +++++----- .../Eigen/CXX11/src/Tensor/TensorExecutor.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorExpr.h | 40 +++++++------- .../Eigen/CXX11/src/Tensor/TensorFFT.h | 14 ++--- .../Eigen/CXX11/src/Tensor/TensorFixedSize.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorForcedEval.h | 18 +++--- .../Eigen/CXX11/src/Tensor/TensorGenerator.h | 8 +-- unsupported/Eigen/CXX11/src/Tensor/TensorIO.h | 18 +++--- .../Eigen/CXX11/src/Tensor/TensorImagePatch.h | 12 ++-- .../Eigen/CXX11/src/Tensor/TensorInflation.h | 8 +-- .../Eigen/CXX11/src/Tensor/TensorIntDiv.h | 6 +- .../Eigen/CXX11/src/Tensor/TensorLayoutSwap.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorMacros.h | 4 +- .../Eigen/CXX11/src/Tensor/TensorMap.h | 12 ++-- .../Eigen/CXX11/src/Tensor/TensorMorphing.h | 42 +++++++------- .../Eigen/CXX11/src/Tensor/TensorPadding.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorPatch.h | 7 +-- .../Eigen/CXX11/src/Tensor/TensorReduction.h | 16 +++--- .../CXX11/src/Tensor/TensorReductionGpu.h | 8 +-- .../CXX11/src/Tensor/TensorReductionSycl.h | 11 ++-- .../Eigen/CXX11/src/Tensor/TensorRef.h | 14 ++--- .../Eigen/CXX11/src/Tensor/TensorReverse.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorScan.h | 6 +- .../Eigen/CXX11/src/Tensor/TensorScanSycl.h | 8 +-- .../Eigen/CXX11/src/Tensor/TensorShuffling.h | 18 +++--- .../Eigen/CXX11/src/Tensor/TensorStriding.h | 10 ++-- .../Eigen/CXX11/src/Tensor/TensorTrace.h | 8 +-- .../Eigen/CXX11/src/Tensor/TensorUInt128.h | 2 +- .../CXX11/src/Tensor/TensorVolumePatch.h | 12 ++-- .../Eigen/CXX11/src/TensorSymmetry/Symmetry.h | 4 +- .../TensorSymmetry/util/TemplateGroupTheory.h | 4 +- .../Eigen/src/AutoDiff/AutoDiffScalar.h | 48 ++++++++-------- .../Eigen/src/EulerAngles/EulerSystem.h | 2 +- .../Eigen/src/IterativeSolvers/DGMRES.h | 2 +- .../Eigen/src/IterativeSolvers/MINRES.h | 6 +- .../KroneckerProduct/KroneckerTensorProduct.h | 12 ++-- .../src/MatrixFunctions/MatrixFunction.h | 2 +- .../src/MatrixFunctions/MatrixLogarithm.h | 2 +- .../src/MatrixFunctions/MatrixSquareRoot.h | 2 +- .../Eigen/src/Polynomials/PolynomialSolver.h | 8 +-- .../Eigen/src/Skyline/SkylineProduct.h | 26 ++++----- .../Eigen/src/SparseExtra/BlockSparseMatrix.h | 4 +- unsupported/test/cxx11_tensor_casts.cpp | 2 +- unsupported/test/cxx11_tensor_fft.cpp | 4 +- unsupported/test/matrix_power.cpp | 4 +- 191 files changed, 1147 insertions(+), 1221 deletions(-) diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index ee590ebe7..1443eac17 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -242,7 +242,7 @@ static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; typedef typename MatrixType::ColXpr ColXpr; - typedef typename internal::remove_all::type ColXprCleaned; + typedef internal::remove_all_t ColXprCleaned; typedef typename ColXprCleaned::SegmentReturnType ColXprSegment; typedef Matrix TempVectorType; typedef typename TempVectorType::SegmentReturnType TempVecSegment; diff --git a/Eigen/src/Core/ArithmeticSequence.h b/Eigen/src/Core/ArithmeticSequence.h index 112ca98e0..81005c5a1 100644 --- a/Eigen/src/Core/ArithmeticSequence.h +++ b/Eigen/src/Core/ArithmeticSequence.h @@ -200,7 +200,7 @@ namespace internal { // Convert a symbolic span into a usable one (i.e., remove last/end "keywords") template struct make_size_type { - typedef typename internal::conditional::value, Index, T>::type type; + typedef std::conditional_t::value, Index, T> type; }; template diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index b65285282..7be8971ba 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -274,8 +274,8 @@ class Array template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const EigenBase &other, - typename internal::enable_if::value, - PrivateType>::type = PrivateType()) + std::enable_if_t::value, + PrivateType> = PrivateType()) : Base(other.derived()) { } diff --git a/Eigen/src/Core/ArrayWrapper.h b/Eigen/src/Core/ArrayWrapper.h index 8a34ca56a..e65b8fb17 100644 --- a/Eigen/src/Core/ArrayWrapper.h +++ b/Eigen/src/Core/ArrayWrapper.h @@ -28,12 +28,12 @@ namespace Eigen { namespace internal { template struct traits > - : public traits::type > + : public traits > { typedef ArrayXpr XprKind; // Let's remove NestByRefBit enum { - Flags0 = traits::type >::Flags, + Flags0 = traits >::Flags, LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag }; @@ -47,13 +47,13 @@ class ArrayWrapper : public ArrayBase > typedef ArrayBase Base; EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper) EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; - typedef typename internal::conditional< + typedef std::conditional_t< internal::is_lvalue::value, Scalar, const Scalar - >::type ScalarWithConstIfNotLvalue; + > ScalarWithConstIfNotLvalue; typedef typename internal::ref_selector::non_const_type NestedExpressionType; @@ -93,7 +93,7 @@ class ArrayWrapper : public ArrayBase > inline void evalTo(Dest& dst) const { dst = m_expression; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_expression; @@ -126,12 +126,12 @@ class ArrayWrapper : public ArrayBase > namespace internal { template struct traits > - : public traits::type > + : public traits > { typedef MatrixXpr XprKind; // Let's remove NestByRefBit enum { - Flags0 = traits::type >::Flags, + Flags0 = traits >::Flags, LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag }; @@ -145,13 +145,13 @@ class MatrixWrapper : public MatrixBase > typedef MatrixBase > Base; EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper) EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; typedef typename internal::ref_selector::non_const_type NestedExpressionType; @@ -187,7 +187,7 @@ class MatrixWrapper : public MatrixBase > } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_expression; diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index 2c0038768..f9dc7a17f 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -113,7 +113,7 @@ public: || int(Traversal) == SliceVectorizedTraversal }; - typedef typename conditional::type PacketType; + typedef std::conditional_t PacketType; private: enum { @@ -846,7 +846,7 @@ void call_assignment(const Dst& dst, const Src& src) // Deal with "assume-aliasing" template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE -void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if< evaluator_assume_aliasing::value, void*>::type = 0) +void call_assignment(Dst& dst, const Src& src, const Func& func, std::enable_if_t< evaluator_assume_aliasing::value, void*> = 0) { typename plain_matrix_type::type tmp(src); call_assignment_no_alias(dst, tmp, func); @@ -854,7 +854,7 @@ void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE -void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if::value, void*>::type = 0) +void call_assignment(Dst& dst, const Src& src, const Func& func, std::enable_if_t::value, void*> = 0) { call_assignment_no_alias(dst, src, func); } @@ -879,8 +879,8 @@ void call_assignment_no_alias(Dst& dst, const Src& src, const Func& func) ) && int(Dst::SizeAtCompileTime) != 1 }; - typedef typename internal::conditional, Dst>::type ActualDstTypeCleaned; - typedef typename internal::conditional, Dst&>::type ActualDstType; + typedef std::conditional_t, Dst> ActualDstTypeCleaned; + typedef std::conditional_t, Dst&> ActualDstType; ActualDstType actualDst(dst); // TODO check whether this is the right place to perform these checks: diff --git a/Eigen/src/Core/Assign_MKL.h b/Eigen/src/Core/Assign_MKL.h index c2afebd25..f9b86c8eb 100755 --- a/Eigen/src/Core/Assign_MKL.h +++ b/Eigen/src/Core/Assign_MKL.h @@ -84,7 +84,7 @@ class vml_assign_traits #define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ template< typename DstXprType, typename SrcXprNested> \ struct Assignment, SrcXprNested>, assign_op, \ - Dense2Dense, typename enable_if::EnableVml>::type> { \ + Dense2Dense, std::enable_if_t::EnableVml>> { \ typedef CwiseUnaryOp, SrcXprNested> SrcXprType; \ static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ resize_if_allowed(dst, src, func); \ @@ -144,7 +144,7 @@ EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(ceil, Ceil, _) template< typename DstXprType, typename SrcXprNested, typename Plain> \ struct Assignment, SrcXprNested, \ const CwiseNullaryOp,Plain> >, assign_op, \ - Dense2Dense, typename enable_if::EnableVml>::type> { \ + Dense2Dense, std::enable_if_t::EnableVml>> { \ typedef CwiseBinaryOp, SrcXprNested, \ const CwiseNullaryOp,Plain> > SrcXprType; \ static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h index 913a96791..c2d943c15 100644 --- a/Eigen/src/Core/BandMatrix.h +++ b/Eigen/src/Core/BandMatrix.h @@ -102,9 +102,9 @@ class BandMatrixBase : public EigenBase : min_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime - ActualIndex)) }; typedef Block BuildType; - typedef typename internal::conditional,BuildType >, - BuildType>::type Type; + BuildType> 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 afbea8667..19c4b6893 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -23,7 +23,7 @@ struct traits > : traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename ref_selector::type XprTypeNested; - typedef typename remove_reference::type XprTypeNested_; + typedef std::remove_reference_t XprTypeNested_; enum{ MatrixRows = traits::RowsAtCompileTime, MatrixCols = traits::ColsAtCompileTime, @@ -112,7 +112,7 @@ template class EIGEN_GENERIC_PUBLIC_INTERFACE(Block) EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; /** Column or Row constructor */ @@ -297,7 +297,7 @@ template::type& nestedExpression() const + const internal::remove_all_t& nestedExpression() const { return m_xpr; } @@ -380,7 +380,7 @@ class BlockImpl_dense } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const typename internal::remove_all::type& nestedExpression() const EIGEN_NOEXCEPT + const internal::remove_all_t& nestedExpression() const EIGEN_NOEXCEPT { return m_xpr; } diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 5e9271d41..53f3dd4ac 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -500,7 +500,7 @@ struct evaluator > : evaluator_base > { typedef CwiseNullaryOp XprType; - typedef typename internal::remove_all::type PlainObjectTypeCleaned; + typedef internal::remove_all_t PlainObjectTypeCleaned; enum { CoeffReadCost = internal::functor_traits::Cost, @@ -1298,7 +1298,7 @@ struct unary_evaluator > Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor }; typedef typename internal::nested_eval::type ArgTypeNested; - typedef typename internal::remove_all::type ArgTypeNestedCleaned; + typedef internal::remove_all_t ArgTypeNestedCleaned; enum { CoeffReadCost = evaluator::CoeffReadCost, @@ -1382,7 +1382,7 @@ template struct evaluator_wrapper_base : evaluator_base { - typedef typename remove_all::type ArgType; + typedef remove_all_t ArgType; enum { CoeffReadCost = evaluator::CoeffReadCost, Flags = evaluator::Flags, diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index ea491c658..21a061a00 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -21,7 +21,7 @@ struct traits > { // we must not inherit from traits since it has // the potential to cause problems with MSVC - typedef typename remove_all::type Ancestor; + typedef remove_all_t Ancestor; typedef typename traits::XprKind XprKind; enum { RowsAtCompileTime = traits::RowsAtCompileTime, @@ -45,8 +45,8 @@ struct traits > typename traits::StorageIndex>::type StorageIndex; typedef typename Lhs::Nested LhsNested; typedef typename Rhs::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; enum { Flags = cwise_promote_storage_order::StorageKind,typename traits::StorageKind,LhsNested_::Flags & RowMajorBit,RhsNested_::Flags & RowMajorBit>::value }; @@ -86,9 +86,9 @@ class CwiseBinaryOp : { public: - typedef typename internal::remove_all::type Functor; - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; + typedef internal::remove_all_t Functor; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; typedef typename CwiseBinaryOpImpl< BinaryOp, LhsType, RhsType, @@ -102,8 +102,8 @@ class CwiseBinaryOp : typedef typename internal::ref_selector::type LhsNested; typedef typename internal::ref_selector::type RhsNested; - typedef typename internal::remove_reference::type LhsNested_; - typedef typename internal::remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; #if EIGEN_COMP_MSVC //Required for Visual Studio or the Copy constructor will probably not get inlined! @@ -121,12 +121,12 @@ class CwiseBinaryOp : EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { // return the fixed size type if available to enable compile time optimizations - return internal::traits::type>::RowsAtCompileTime==Dynamic ? m_rhs.rows() : m_lhs.rows(); + return internal::traits>::RowsAtCompileTime==Dynamic ? m_rhs.rows() : m_lhs.rows(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { // return the fixed size type if available to enable compile time optimizations - return internal::traits::type>::ColsAtCompileTime==Dynamic ? m_rhs.cols() : m_lhs.cols(); + return internal::traits>::ColsAtCompileTime==Dynamic ? m_rhs.cols() : m_lhs.cols(); } /** \returns the left hand side nested expression */ diff --git a/Eigen/src/Core/CwiseTernaryOp.h b/Eigen/src/Core/CwiseTernaryOp.h index 393279bc5..8d24a483a 100644 --- a/Eigen/src/Core/CwiseTernaryOp.h +++ b/Eigen/src/Core/CwiseTernaryOp.h @@ -21,7 +21,7 @@ template struct traits > { // we must not inherit from traits since it has // the potential to cause problems with MSVC - typedef typename remove_all::type Ancestor; + typedef remove_all_t Ancestor; typedef typename traits::XprKind XprKind; enum { RowsAtCompileTime = traits::RowsAtCompileTime, @@ -43,9 +43,9 @@ struct traits > { typedef typename Arg1::Nested Arg1Nested; typedef typename Arg2::Nested Arg2Nested; typedef typename Arg3::Nested Arg3Nested; - typedef typename remove_reference::type Arg1Nested_; - typedef typename remove_reference::type Arg2Nested_; - typedef typename remove_reference::type Arg3Nested_; + typedef std::remove_reference_t Arg1Nested_; + typedef std::remove_reference_t Arg2Nested_; + typedef std::remove_reference_t Arg3Nested_; enum { Flags = Arg1Nested_::Flags & RowMajorBit }; }; } // end namespace internal @@ -89,9 +89,9 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl< internal::no_assignment_operator { public: - typedef typename internal::remove_all::type Arg1; - typedef typename internal::remove_all::type Arg2; - typedef typename internal::remove_all::type Arg3; + typedef internal::remove_all_t Arg1; + typedef internal::remove_all_t Arg2; + typedef internal::remove_all_t Arg3; // require the sizes to match EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg2) @@ -115,9 +115,9 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl< typedef typename internal::ref_selector::type Arg1Nested; typedef typename internal::ref_selector::type Arg2Nested; typedef typename internal::ref_selector::type Arg3Nested; - typedef typename internal::remove_reference::type Arg1Nested_; - typedef typename internal::remove_reference::type Arg2Nested_; - typedef typename internal::remove_reference::type Arg3Nested_; + typedef std::remove_reference_t Arg1Nested_; + typedef std::remove_reference_t Arg2Nested_; + typedef std::remove_reference_t Arg3Nested_; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CwiseTernaryOp(const Arg1& a1, const Arg2& a2, @@ -132,14 +132,14 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl< EIGEN_STRONG_INLINE Index rows() const { // return the fixed size type if available to enable compile time // optimizations - if (internal::traits::type>:: + if (internal::traits>:: RowsAtCompileTime == Dynamic && - internal::traits::type>:: + internal::traits>:: RowsAtCompileTime == Dynamic) return m_arg3.rows(); - else if (internal::traits::type>:: + else if (internal::traits>:: RowsAtCompileTime == Dynamic && - internal::traits::type>:: + internal::traits>:: RowsAtCompileTime == Dynamic) return m_arg2.rows(); else @@ -149,14 +149,14 @@ class CwiseTernaryOp : public CwiseTernaryOpImpl< EIGEN_STRONG_INLINE Index cols() const { // return the fixed size type if available to enable compile time // optimizations - if (internal::traits::type>:: + if (internal::traits>:: ColsAtCompileTime == Dynamic && - internal::traits::type>:: + internal::traits>:: ColsAtCompileTime == Dynamic) return m_arg3.cols(); - else if (internal::traits::type>:: + else if (internal::traits>:: ColsAtCompileTime == Dynamic && - internal::traits::type>:: + internal::traits>:: ColsAtCompileTime == Dynamic) return m_arg2.cols(); else diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index d9985c096..ff7d0b948 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -24,7 +24,7 @@ struct traits > UnaryOp(const typename XprType::Scalar&) >::type Scalar; typedef typename XprType::Nested XprTypeNested; - typedef typename remove_reference::type XprTypeNested_; + typedef std::remove_reference_t XprTypeNested_; enum { Flags = XprTypeNested_::Flags & RowMajorBit }; @@ -61,7 +61,7 @@ class CwiseUnaryOp : public CwiseUnaryOpImpl::StorageKind>::Base Base; EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp) typedef typename internal::ref_selector::type XprTypeNested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp()) @@ -78,12 +78,12 @@ class CwiseUnaryOp : public CwiseUnaryOpImpl::type& + const internal::remove_all_t& nestedExpression() const { return m_xpr; } /** \returns the nested expression */ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::remove_all::type& + internal::remove_all_t& nestedExpression() { return m_xpr; } protected: diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h index fabb3f824..b4539a6b2 100644 --- a/Eigen/src/Core/CwiseUnaryView.h +++ b/Eigen/src/Core/CwiseUnaryView.h @@ -23,7 +23,7 @@ struct traits > ViewOp(const typename traits::Scalar&) >::type Scalar; typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename remove_all::type MatrixTypeNested_; + typedef remove_all_t MatrixTypeNested_; enum { FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, Flags = traits::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions @@ -69,7 +69,7 @@ class CwiseUnaryView : public CwiseUnaryViewImpl::StorageKind>::Base Base; EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView) typedef typename internal::ref_selector::non_const_type MatrixTypeNested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; explicit EIGEN_DEVICE_FUNC inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp()) : m_matrix(mat), m_functor(func) {} @@ -85,11 +85,11 @@ class CwiseUnaryView : public CwiseUnaryViewImpl::type& + EIGEN_DEVICE_FUNC const internal::remove_all_t& nestedExpression() const { return m_matrix; } /** \returns the nested expression */ - EIGEN_DEVICE_FUNC typename internal::remove_reference::type& + EIGEN_DEVICE_FUNC std::remove_reference_t& nestedExpression() { return m_matrix; } protected: diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index d62c851de..3a8487b9b 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -201,8 +201,8 @@ template class DenseBase * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed * that the return type of eval() is either PlainObject or const PlainObject&. */ - typedef typename internal::conditional::XprKind,MatrixXpr >::value, - PlainMatrix, PlainArray>::type PlainObject; + typedef std::conditional_t::XprKind,MatrixXpr >::value, + PlainMatrix, PlainArray> PlainObject; /** \returns the outer size. * @@ -314,7 +314,7 @@ template class DenseBase typedef Transpose TransposeReturnType; EIGEN_DEVICE_FUNC TransposeReturnType transpose(); - typedef typename internal::add_const >::type ConstTransposeReturnType; + typedef const Transpose ConstTransposeReturnType; EIGEN_DEVICE_FUNC ConstTransposeReturnType transpose() const; EIGEN_DEVICE_FUNC @@ -385,7 +385,7 @@ template class DenseBase EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const Scalar& other); - typedef typename internal::add_const_on_value_type::type>::type EvalReturnType; + typedef internal::add_const_on_value_type_t::type> EvalReturnType; /** \returns the matrix or vector obtained by evaluating this expression. * * Notice that in the case of a plain matrix or vector (not an expression) this function just returns @@ -429,9 +429,9 @@ template class DenseBase EIGEN_DEVICE_FUNC inline const ForceAlignedAccess forceAlignedAccess() const; EIGEN_DEVICE_FUNC inline ForceAlignedAccess forceAlignedAccess(); template EIGEN_DEVICE_FUNC - inline const typename internal::conditional,Derived&>::type forceAlignedAccessIf() const; + inline const std::conditional_t,Derived&> forceAlignedAccessIf() const; template EIGEN_DEVICE_FUNC - inline typename internal::conditional,Derived&>::type forceAlignedAccessIf(); + inline std::conditional_t,Derived&> forceAlignedAccessIf(); EIGEN_DEVICE_FUNC Scalar sum() const; EIGEN_DEVICE_FUNC Scalar mean() const; @@ -611,27 +611,21 @@ template class DenseBase /** This is the const version of iterator (aka read-only) */ typedef random_access_iterator_type const_iterator; #else - typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit, - internal::pointer_based_stl_iterator, - internal::generic_randaccess_stl_iterator - >::type iterator_type; + typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit, + internal::pointer_based_stl_iterator, + internal::generic_randaccess_stl_iterator + > iterator_type; - typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit, - internal::pointer_based_stl_iterator, - internal::generic_randaccess_stl_iterator - >::type const_iterator_type; + typedef std::conditional_t< (Flags&DirectAccessBit)==DirectAccessBit, + internal::pointer_based_stl_iterator, + internal::generic_randaccess_stl_iterator + > const_iterator_type; // Stl-style iterators are supported only for vectors. - typedef typename internal::conditional< IsVectorAtCompileTime, - iterator_type, - void - >::type iterator; + typedef std::conditional_t iterator; - typedef typename internal::conditional< IsVectorAtCompileTime, - const_iterator_type, - void - >::type const_iterator; + typedef std::conditional_t const_iterator; #endif inline iterator begin(); diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h index 46d8730cb..7f0bcf471 100644 --- a/Eigen/src/Core/DenseCoeffsBase.h +++ b/Eigen/src/Core/DenseCoeffsBase.h @@ -17,7 +17,7 @@ namespace Eigen { namespace internal { template struct add_const_on_value_type_if_arithmetic { - typedef typename conditional::value, T, typename add_const_on_value_type::type>::type type; + typedef std::conditional_t::value, T, add_const_on_value_type_t> type; }; } @@ -48,10 +48,10 @@ class DenseCoeffsBase : public EigenBase // - The is_arithmetic check is required since "const int", "const double", etc. will cause warnings on some systems // while the declaration of "const T", where T is a non arithmetic type does not. Always returning "const Scalar&" is // not possible, since the underlying expressions might not offer a valid address the reference could be referring to. - typedef typename internal::conditional::Flags&LvalueBit), - const Scalar&, - typename internal::conditional::value, Scalar, const Scalar>::type - >::type CoeffReturnType; + typedef std::conditional_t::Flags&LvalueBit), + const Scalar&, + std::conditional_t::value, Scalar, const Scalar> + > CoeffReturnType; typedef typename internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits::type diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 2bf452795..e74fe59c0 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -40,7 +40,7 @@ struct traits > : traits { typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNested_; + typedef std::remove_reference_t MatrixTypeNested_; typedef typename MatrixType::StorageKind StorageKind; enum { RowsAtCompileTime = (int(DiagIndex) == DynamicIndex || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic @@ -97,11 +97,11 @@ template class Diagonal EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return 0; } - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.coeffRef(rowOffset(), colOffset())); } @@ -147,7 +147,7 @@ template class Diagonal } EIGEN_DEVICE_FUNC - inline const typename internal::remove_all::type& + inline const internal::remove_all_t& nestedExpression() const { return m_matrix; diff --git a/Eigen/src/Core/ForceAlignedAccess.h b/Eigen/src/Core/ForceAlignedAccess.h index 7c4657348..b00785e3d 100644 --- a/Eigen/src/Core/ForceAlignedAccess.h +++ b/Eigen/src/Core/ForceAlignedAccess.h @@ -130,7 +130,7 @@ MatrixBase::forceAlignedAccess() */ template template -inline typename internal::add_const_on_value_type,Derived&>::type>::type +inline add_const_on_value_type_t,Derived&>> MatrixBase::forceAlignedAccessIf() const { return derived(); // FIXME This should not work but apparently is never used @@ -141,7 +141,7 @@ MatrixBase::forceAlignedAccessIf() const */ template template -inline typename internal::conditional,Derived&>::type +inline std::conditional_t,Derived&> MatrixBase::forceAlignedAccessIf() { return derived(); // FIXME This should not work but apparently is never used diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index 783a3b6c4..661a3c4dd 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -52,8 +52,8 @@ template struct product_size_category template struct product_type { - typedef typename remove_all::type Lhs_; - typedef typename remove_all::type Rhs_; + typedef remove_all_t Lhs_; + typedef remove_all_t Rhs_; enum { MaxRows = traits::MaxRowsAtCompileTime, Rows = traits::RowsAtCompileTime, @@ -233,7 +233,7 @@ template<> struct gemv_dense_selector ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); // make sure Dest is a compile-time vector type (bug 1166) - typedef typename conditional::type ActualDest; + typedef std::conditional_t ActualDest; enum { // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 @@ -316,10 +316,10 @@ template<> struct gemv_dense_selector typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type ActualRhsTypeCleaned; + typedef internal::remove_all_t ActualRhsTypeCleaned; - typename add_const::type actualLhs = LhsBlasTraits::extract(lhs); - typename add_const::type actualRhs = RhsBlasTraits::extract(rhs); + std::add_const_t actualLhs = LhsBlasTraits::extract(lhs); + std::add_const_t actualRhs = RhsBlasTraits::extract(rhs); ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h index f60724ac0..670af354a 100644 --- a/Eigen/src/Core/GenericPacketMath.h +++ b/Eigen/src/Core/GenericPacketMath.h @@ -262,7 +262,7 @@ struct ptrue_impl { // have another option, since the scalar type requires initialization. template struct ptrue_impl::value && NumTraits::RequireInitialization>::type > { + std::enable_if_t::value && NumTraits::RequireInitialization> > { static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/){ return T(1); } @@ -288,7 +288,7 @@ struct pzero_impl { // for zero may not consist of all-zero bits. template struct pzero_impl::value>::type> { + std::enable_if_t::value>> { static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/) { return T(0); } @@ -401,8 +401,8 @@ struct bitwise_helper : public bytewise_bitwise_helper {}; // For integers or non-trivial scalars, use binary operators. template struct bitwise_helper::value && (NumTraits::IsInteger || NumTraits::RequireInitialization)>::type + typename std::enable_if_t< + is_scalar::value && (NumTraits::IsInteger || NumTraits::RequireInitialization)> > : public operator_bitwise_helper {}; /** \internal \returns the bitwise and of \a a and \a b */ @@ -444,7 +444,7 @@ struct pselect_impl { // For scalars, use ternary select. template struct pselect_impl::value>::type > { + std::enable_if_t::value> > { static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) { return numext::equal_strict(mask, Packet(0)) ? b : a; } @@ -610,7 +610,7 @@ ploadu(const typename unpacket_traits::type* from) { return *from; } * cases. Generic case should not be called. */ template EIGEN_DEVICE_FUNC inline -typename enable_if::masked_load_available, Packet>::type +std::enable_if_t::masked_load_available, Packet> ploadu(const typename unpacket_traits::type* from, typename unpacket_traits::mask_t umask); /** \internal \returns a packet with constant coefficients \a a, e.g.: (a,a,a,a) */ @@ -709,7 +709,7 @@ template EIGEN_DEVICE_FUNC inline void pstoreu */ template EIGEN_DEVICE_FUNC inline -typename enable_if::masked_store_available, void>::type +std::enable_if_t::masked_store_available, void> pstoreu(Scalar* to, const Packet& from, typename unpacket_traits::mask_t umask); template EIGEN_DEVICE_FUNC inline Packet pgather(const Scalar* from, Index /*stride*/) @@ -845,7 +845,7 @@ pfirst(const Packet& a) * For packet-size smaller or equal to 4, this boils down to a noop. */ template -EIGEN_DEVICE_FUNC inline typename conditional<(unpacket_traits::size%8)==0,typename unpacket_traits::half,Packet>::type +EIGEN_DEVICE_FUNC inline std::conditional_t<(unpacket_traits::size%8)==0,typename unpacket_traits::half,Packet> predux_half_dowto4(const Packet& a) { return a; } diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index efc2c4386..897d7b09a 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -133,7 +133,6 @@ template std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt) { using internal::is_same; - using internal::conditional; if(_m.size() == 0) { @@ -143,22 +142,21 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& typename Derived::Nested m = _m; typedef typename Derived::Scalar Scalar; - typedef typename - conditional< + typedef std::conditional_t< is_same::value || is_same::value || is_same::value || is_same::value, int, - typename conditional< + std::conditional_t< is_same >::value || is_same >::value || is_same >::value || is_same >::value, std::complex, const Scalar& - >::type - >::type PrintType; + > + > PrintType; Index width = 0; diff --git a/Eigen/src/Core/IndexedView.h b/Eigen/src/Core/IndexedView.h index e7ca88beb..c0907bf47 100644 --- a/Eigen/src/Core/IndexedView.h +++ b/Eigen/src/Core/IndexedView.h @@ -42,7 +42,7 @@ struct traits > InnerSize = XprTypeIsRowMajor ? ColsAtCompileTime : RowsAtCompileTime, IsBlockAlike = InnerIncr==1 && OuterIncr==1, - IsInnerPannel = HasSameStorageOrderAsXprType && is_same,typename conditional::type>::value, + IsInnerPannel = HasSameStorageOrderAsXprType && is_same,std::conditional_t>::value, InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==DynamicIndex || XprInnerStride==Dynamic || InnerIncr==UndefinedIncr ? Dynamic : XprInnerStride * InnerIncr, OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==DynamicIndex || XprOuterstride==Dynamic || OuterIncr==UndefinedIncr ? Dynamic : XprOuterstride * OuterIncr, @@ -116,7 +116,7 @@ public: EIGEN_INHERIT_ASSIGNMENT_OPERATORS(IndexedView) typedef typename internal::ref_selector::non_const_type MatrixTypeNested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; template IndexedView(XprType& xpr, const T0& rowIndices, const T1& colIndices) @@ -130,11 +130,11 @@ public: Index cols() const { return internal::index_list_size(m_colIndices); } /** \returns the nested expression */ - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_xpr; } /** \returns the nested expression */ - typename internal::remove_reference::type& + std::remove_reference_t& nestedExpression() { return m_xpr; } /** \returns a const reference to the object storing/generating the row indices */ diff --git a/Eigen/src/Core/Inverse.h b/Eigen/src/Core/Inverse.h index 9ab5a7942..9c70733b1 100644 --- a/Eigen/src/Core/Inverse.h +++ b/Eigen/src/Core/Inverse.h @@ -48,9 +48,9 @@ public: typedef typename XprType::StorageIndex StorageIndex; typedef typename XprType::Scalar Scalar; typedef typename internal::ref_selector::type XprTypeNested; - typedef typename internal::remove_all::type XprTypeNestedCleaned; + typedef internal::remove_all_t XprTypeNestedCleaned; typedef typename internal::ref_selector::type Nested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; explicit EIGEN_DEVICE_FUNC Inverse(const XprType &xpr) : m_xpr(xpr) diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 89192c39a..bf8c16397 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -53,11 +53,11 @@ template class MapBase typedef typename internal::traits::Scalar Scalar; typedef typename internal::packet_traits::type PacketScalar; typedef typename NumTraits::Real RealScalar; - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - Scalar *, - const Scalar *>::type - PointerType; + typedef std::conditional_t< + bool(internal::is_lvalue::value), + Scalar *, + const Scalar *> + PointerType; using Base::derived; // using Base::RowsAtCompileTime; @@ -191,7 +191,7 @@ template class MapBase template EIGEN_DEVICE_FUNC - void checkSanity(typename internal::enable_if<(internal::traits::Alignment>0),void*>::type = 0) const + void checkSanity(std::enable_if_t<(internal::traits::Alignment>0),void*> = 0) const { #if EIGEN_MAX_ALIGN_BYTES>0 // innerStride() is not set yet when this function is called, so we optimistically assume the lowest plausible value: @@ -204,7 +204,7 @@ template class MapBase template EIGEN_DEVICE_FUNC - void checkSanity(typename internal::enable_if::Alignment==0,void*>::type = 0) const + void checkSanity(std::enable_if_t::Alignment==0,void*> = 0) const {} PointerType m_data; @@ -247,11 +247,11 @@ template class MapBase using Base::rowStride; using Base::colStride; - typedef typename internal::conditional< + typedef std::conditional_t< internal::is_lvalue::value, Scalar, const Scalar - >::type ScalarWithConstIfNotLvalue; + > ScalarWithConstIfNotLvalue; EIGEN_DEVICE_FUNC inline const Scalar* data() const { return this->m_data; } diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 55e3159e8..59cc831fc 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -434,9 +434,9 @@ struct cast_impl // generating warnings on clang. Here we explicitly cast the real component. template struct cast_impl::IsComplex && NumTraits::IsComplex - >::type> + >> { EIGEN_DEVICE_FUNC static inline NewType run(const OldType& x) @@ -891,7 +891,7 @@ struct random_default_impl // ScalarX is the widest of ScalarU and unsigned int. // We'll deal only with ScalarX and unsigned int below thus avoiding signed // types and arithmetic and signed overflows (which are undefined behavior). - typedef typename conditional<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned>::type ScalarX; + typedef std::conditional_t<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned> ScalarX; // The following difference doesn't overflow, provided our integer types are two's // complement and have the same number of padding bits in signed and unsigned variants. // This is the case in most modern implementations of C++. @@ -962,22 +962,22 @@ inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> isnan_impl(const T&) { return false; } template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> isinf_impl(const T&) { return false; } template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> isfinite_impl(const T&) { return true; } template EIGEN_DEVICE_FUNC -typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +std::enable_if_t<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool> isfinite_impl(const T& x) { #if defined(EIGEN_GPU_COMPILE_PHASE) @@ -992,7 +992,7 @@ isfinite_impl(const T& x) template EIGEN_DEVICE_FUNC -typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +std::enable_if_t<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool> isinf_impl(const T& x) { #if defined(EIGEN_GPU_COMPILE_PHASE) @@ -1007,7 +1007,7 @@ isinf_impl(const T& x) template EIGEN_DEVICE_FUNC -typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +std::enable_if_t<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool> isnan_impl(const T& x) { #if defined(EIGEN_GPU_COMPILE_PHASE) @@ -1232,7 +1232,7 @@ inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x) template EIGEN_DEVICE_FUNC -inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) +inline internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) > real_ref(const Scalar& x) { return internal::real_ref_impl::run(x); } @@ -1260,7 +1260,7 @@ inline EIGEN_MATHFUNC_RETVAL(arg, Scalar) arg(const Scalar& x) template EIGEN_DEVICE_FUNC -inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) +inline internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) > imag_ref(const Scalar& x) { return internal::imag_ref_impl::run(x); } @@ -1503,7 +1503,7 @@ double log(const double &x) { return ::log(x); } template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE -typename internal::enable_if::IsSigned || NumTraits::IsComplex,typename NumTraits::Real>::type +std::enable_if_t::IsSigned || NumTraits::IsComplex,typename NumTraits::Real> abs(const T &x) { EIGEN_USING_STD(abs); return abs(x); @@ -1511,7 +1511,7 @@ abs(const T &x) { template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE -typename internal::enable_if::IsSigned || NumTraits::IsComplex),typename NumTraits::Real>::type +std::enable_if_t::IsSigned || NumTraits::IsComplex),typename NumTraits::Real> abs(const T &x) { return x; } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 20c9138fc..c50d43896 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -109,10 +109,10 @@ template class MatrixBase /** \internal Represents a matrix with all coefficients equal to one another*/ typedef CwiseNullaryOp,PlainObject> ConstantReturnType; /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::conditional::IsComplex, - CwiseUnaryOp, ConstTransposeReturnType>, - ConstTransposeReturnType - >::type AdjointReturnType; + typedef std::conditional_t::IsComplex, + CwiseUnaryOp, ConstTransposeReturnType>, + ConstTransposeReturnType + > AdjointReturnType; /** \internal Return type of eigenvalues() */ typedef Matrix, internal::traits::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; /** \internal the return type of identity */ @@ -208,7 +208,7 @@ template class MatrixBase EIGEN_DEVICE_FUNC DiagonalReturnType diagonal(); - typedef typename internal::add_const >::type ConstDiagonalReturnType; + typedef const Diagonal ConstDiagonalReturnType; EIGEN_DEVICE_FUNC ConstDiagonalReturnType diagonal() const; @@ -224,7 +224,7 @@ template class MatrixBase typename ConstDiagonalIndexReturnType::Type diagonal() const; typedef Diagonal DiagonalDynamicIndexReturnType; - typedef typename internal::add_const >::type ConstDiagonalDynamicIndexReturnType; + typedef const Diagonal ConstDiagonalDynamicIndexReturnType; EIGEN_DEVICE_FUNC DiagonalDynamicIndexReturnType diagonal(Index index); diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index e484bb6b5..74edd2c27 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -164,11 +164,7 @@ template struct GenericNumTraits }; typedef T Real; - typedef typename internal::conditional< - IsInteger, - typename internal::conditional::type, - T - >::type NonInteger; + typedef std::conditional_t, T> NonInteger; typedef T Nested; typedef T Literal; diff --git a/Eigen/src/Core/PartialReduxEvaluator.h b/Eigen/src/Core/PartialReduxEvaluator.h index b6f31f992..693fc355a 100644 --- a/Eigen/src/Core/PartialReduxEvaluator.h +++ b/Eigen/src/Core/PartialReduxEvaluator.h @@ -141,8 +141,8 @@ struct evaluator > { typedef PartialReduxExpr XprType; typedef typename internal::nested_eval::type ArgTypeNested; - typedef typename internal::add_const_on_value_type::type ConstArgTypeNested; - typedef typename internal::remove_all::type ArgTypeNestedCleaned; + typedef add_const_on_value_type_t ConstArgTypeNested; + typedef internal::remove_all_t ArgTypeNestedCleaned; typedef typename ArgType::Scalar InputScalar; typedef typename XprType::Scalar Scalar; enum { diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index 1b4195a79..73a73006b 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -500,7 +500,7 @@ class PermutationWrapper : public PermutationBase::type& + const internal::remove_all_t& indices() const { return m_indices; } protected: diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index fb7cd0baf..48e372f20 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -798,7 +798,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE void _init2(Index rows, Index cols, typename internal::enable_if::type* = 0) + EIGEN_STRONG_INLINE void _init2(Index rows, Index cols, std::enable_if_t* = 0) { const bool t0_is_integer_alike = internal::is_valid_index_type::value; const bool t1_is_integer_alike = internal::is_valid_index_type::value; @@ -810,7 +810,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1, typename internal::enable_if::type* = 0) + EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1, std::enable_if_t* = 0) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) m_storage.data()[0] = Scalar(val0); @@ -820,10 +820,10 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2(const Index& val0, const Index& val1, - typename internal::enable_if< (!internal::is_same::value) - && (internal::is_same::value) - && (internal::is_same::value) - && Base::SizeAtCompileTime==2,T1>::type* = 0) + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==2,T1>* = 0) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) m_storage.data()[0] = Scalar(val0); @@ -834,8 +834,8 @@ class PlainObjectBase : public internal::dense_xpr_base::type // then the argument is meant to be the size of the object. template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE void _init1(Index size, typename internal::enable_if< (Base::SizeAtCompileTime!=1 || !internal::is_convertible::value) - && ((!internal::is_same::XprKind,ArrayXpr>::value || Base::SizeAtCompileTime==Dynamic)),T>::type* = 0) + EIGEN_STRONG_INLINE void _init1(Index size, std::enable_if_t< (Base::SizeAtCompileTime!=1 || !internal::is_convertible::value) + && ((!internal::is_same::XprKind,ArrayXpr>::value || Base::SizeAtCompileTime==Dynamic)),T>* = 0) { // NOTE MSVC 2008 complains if we directly put bool(NumTraits::IsInteger) as the EIGEN_STATIC_ASSERT argument. const bool is_integer_alike = internal::is_valid_index_type::value; @@ -848,7 +848,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type // We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar type can be implicitly converted) template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE void _init1(const Scalar& val0, typename internal::enable_if::value,T>::type* = 0) + EIGEN_STRONG_INLINE void _init1(const Scalar& val0, std::enable_if_t::value,T>* = 0) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) m_storage.data()[0] = val0; @@ -858,10 +858,10 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Index& val0, - typename internal::enable_if< (!internal::is_same::value) - && (internal::is_same::value) - && Base::SizeAtCompileTime==1 - && internal::is_convertible::value,T*>::type* = 0) + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==1 + && internal::is_convertible::value,T*>* = 0) { EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) m_storage.data()[0] = Scalar(val0); @@ -914,10 +914,10 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Scalar& val0, - typename internal::enable_if< Base::SizeAtCompileTime!=Dynamic - && Base::SizeAtCompileTime!=1 - && internal::is_convertible::value - && internal::is_same::XprKind,ArrayXpr>::value,T>::type* = 0) + std::enable_if_t< Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T>* = 0) { Base::setConstant(val0); } @@ -926,12 +926,12 @@ class PlainObjectBase : public internal::dense_xpr_base::type template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Index& val0, - typename internal::enable_if< (!internal::is_same::value) - && (internal::is_same::value) - && Base::SizeAtCompileTime!=Dynamic - && Base::SizeAtCompileTime!=1 - && internal::is_convertible::value - && internal::is_same::XprKind,ArrayXpr>::value,T*>::type* = 0) + std::enable_if_t< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T*>* = 0) { Base::setConstant(val0); } diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 3b788b3d1..85842d1a5 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -21,8 +21,8 @@ namespace internal { template struct traits > { - typedef typename remove_all::type LhsCleaned; - typedef typename remove_all::type RhsCleaned; + typedef remove_all_t LhsCleaned; + typedef remove_all_t RhsCleaned; typedef traits LhsTraits; typedef traits RhsTraits; @@ -89,8 +89,8 @@ class Product : public ProductImpl::type LhsNested; typedef typename internal::ref_selector::type RhsNested; - typedef typename internal::remove_all::type LhsNestedCleaned; - typedef typename internal::remove_all::type RhsNestedCleaned; + typedef internal::remove_all_t LhsNestedCleaned; + typedef internal::remove_all_t RhsNestedCleaned; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index 4027255a1..05ffa25f4 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -115,8 +115,8 @@ struct product_evaluator, ProductTag, LhsShape, RhsSh // if so, then we must take care at removing the call to nested_eval in the specializations (e.g., in permutation_matrix_product, transposition_matrix_product, etc.) // typedef typename internal::nested_eval::type LhsNested; // typedef typename internal::nested_eval::type RhsNested; -// typedef typename internal::remove_all::type LhsNestedCleaned; -// typedef typename internal::remove_all::type RhsNestedCleaned; +// typedef internal::remove_all_t LhsNestedCleaned; +// typedef internal::remove_all_t RhsNestedCleaned; // // const LhsNested lhs(xpr.lhs()); // const RhsNested rhs(xpr.rhs()); @@ -136,7 +136,7 @@ protected: // Dense = Product template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> struct Assignment, internal::assign_op, Dense2Dense, - typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> { typedef Product SrcXprType; static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE @@ -154,7 +154,7 @@ struct Assignment, internal::assign_op struct Assignment, internal::add_assign_op, Dense2Dense, - typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> { typedef Product SrcXprType; static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE @@ -169,7 +169,7 @@ struct Assignment, internal::add_assign_op< // Dense -= Product template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> struct Assignment, internal::sub_assign_op, Dense2Dense, - typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> + std::enable_if_t<(Options==DefaultProduct || Options==AliasFreeProduct)>> { typedef Product SrcXprType; static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE @@ -298,7 +298,7 @@ void EIGEN_DEVICE_FUNC outer_product_selector_run(Dst& dst, const Lhs &lhs, cons template struct generic_product_impl { - template struct is_row_major : internal::conditional<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type>::type {}; + template struct is_row_major : std::conditional_t<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type> {}; typedef typename Product::Scalar Scalar; // TODO it would be nice to be able to exploit our *_assign_op functors for that purpose @@ -372,7 +372,7 @@ struct generic_product_impl typedef typename nested_eval::type RhsNested; typedef typename Product::Scalar Scalar; enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight }; - typedef typename internal::remove_all::type>::type MatrixType; + typedef internal::remove_all_t> MatrixType; template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) @@ -450,7 +450,7 @@ struct generic_product_impl blas_traits::extract(rhs).template conjugateIf(), func, actualAlpha, - typename conditional::type()); + std::conditional_t()); } protected: @@ -528,8 +528,8 @@ struct product_evaluator, ProductTag, DenseShape, typedef typename internal::nested_eval::type LhsNested; typedef typename internal::nested_eval::type RhsNested; - typedef typename internal::remove_all::type LhsNestedCleaned; - typedef typename internal::remove_all::type RhsNestedCleaned; + typedef internal::remove_all_t LhsNestedCleaned; + typedef internal::remove_all_t RhsNestedCleaned; typedef evaluator LhsEtorType; typedef evaluator RhsEtorType; @@ -642,8 +642,8 @@ struct product_evaluator, ProductTag, DenseShape, } protected: - typename internal::add_const_on_value_type::type m_lhs; - typename internal::add_const_on_value_type::type m_rhs; + add_const_on_value_type_t m_lhs; + add_const_on_value_type_t m_rhs; LhsEtorType m_lhsImpl; RhsEtorType m_rhsImpl; @@ -934,7 +934,7 @@ struct product_evaluator, ProductTag, DiagonalSha // FIXME: NVCC used to complain about the template keyword, but we have to check whether this is still the case. // See also similar calls below. return this->template packet_impl(row,col, row, - typename internal::conditional::type()); + std::conditional_t()); } template @@ -976,7 +976,7 @@ struct product_evaluator, ProductTag, DenseShape, EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const { return this->template packet_impl(row,col, col, - typename internal::conditional::type()); + std::conditional_t()); } template @@ -1003,7 +1003,7 @@ template struct permutation_matrix_product { typedef typename nested_eval::type MatrixType; - typedef typename remove_all::type MatrixTypeCleaned; + typedef remove_all_t MatrixTypeCleaned; template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Dest& dst, const PermutationType& perm, const ExpressionType& xpr) @@ -1111,7 +1111,7 @@ template::type MatrixType; - typedef typename remove_all::type MatrixTypeCleaned; + typedef remove_all_t MatrixTypeCleaned; template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Dest& dst, const TranspositionType& tr, const ExpressionType& xpr) diff --git a/Eigen/src/Core/Ref.h b/Eigen/src/Core/Ref.h index c48650eb4..81de5f9d9 100644 --- a/Eigen/src/Core/Ref.h +++ b/Eigen/src/Core/Ref.h @@ -48,7 +48,7 @@ struct traits > ScalarTypeMatch = internal::is_same::value, MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch && ScalarTypeMatch }; - typedef typename internal::conditional::type type; + typedef std::conditional_t type; }; }; @@ -287,7 +287,7 @@ template class Ref typedef internal::traits Traits; template EIGEN_DEVICE_FUNC inline Ref(const PlainObjectBase& expr, - typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0); + std::enable_if_t::MatchAtCompileTime),Derived>* = 0); public: typedef RefBase Base; @@ -297,7 +297,7 @@ template class Ref #ifndef EIGEN_PARSED_BY_DOXYGEN template EIGEN_DEVICE_FUNC inline Ref(PlainObjectBase& expr, - typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0) + std::enable_if_t::MatchAtCompileTime),Derived>* = 0) { EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); // Construction must pass since we will not create temporary storage in the non-const case. @@ -307,7 +307,7 @@ template class Ref } template EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, - typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0) + std::enable_if_t::MatchAtCompileTime),Derived>* = 0) #else /** Implicit constructor from any dense expression */ template @@ -339,7 +339,7 @@ template class Ref< template EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, - typename internal::enable_if::ScalarTypeMatch),Derived>::type* = 0) + std::enable_if_t::ScalarTypeMatch),Derived>* = 0) { // std::cout << match_helper::HasDirectAccess << "," << match_helper::OuterStrideMatch << "," << match_helper::InnerStrideMatch << "\n"; // std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n"; diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h index 6b5f9fed3..4f91bbe4c 100644 --- a/Eigen/src/Core/Replicate.h +++ b/Eigen/src/Core/Replicate.h @@ -23,7 +23,7 @@ struct traits > typedef typename traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNested_; + typedef std::remove_reference_t MatrixTypeNested_; enum { RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic ? Dynamic @@ -69,14 +69,14 @@ template class Replicate typedef typename internal::dense_xpr_base::type Base; EIGEN_DENSE_PUBLIC_INTERFACE(Replicate) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; template EIGEN_DEVICE_FUNC inline explicit Replicate(const OriginalMatrixType& matrix) : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) { - EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), + EIGEN_STATIC_ASSERT((internal::is_same,OriginalMatrixType>::value), THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic); } @@ -86,7 +86,7 @@ template class Replicate inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor) : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) { - EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), + EIGEN_STATIC_ASSERT((internal::is_same,OriginalMatrixType>::value), THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) } diff --git a/Eigen/src/Core/Reshaped.h b/Eigen/src/Core/Reshaped.h index baa550e54..53889fe91 100644 --- a/Eigen/src/Core/Reshaped.h +++ b/Eigen/src/Core/Reshaped.h @@ -157,7 +157,7 @@ class ReshapedImpl_dense EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ReshapedImpl_dense) typedef typename internal::ref_selector::non_const_type MatrixTypeNested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; class InnerIterator; @@ -187,12 +187,12 @@ class ReshapedImpl_dense /** \returns the nested expression */ EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_xpr; } /** \returns the nested expression */ EIGEN_DEVICE_FUNC - typename internal::remove_reference::type& + std::remove_reference_t& nestedExpression() { return m_xpr; } protected: @@ -232,7 +232,7 @@ class ReshapedImpl_dense {} EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& nestedExpression() const + const internal::remove_all_t& nestedExpression() const { return m_xpr; } diff --git a/Eigen/src/Core/Reverse.h b/Eigen/src/Core/Reverse.h index 6c66922b1..97e1d68e9 100644 --- a/Eigen/src/Core/Reverse.h +++ b/Eigen/src/Core/Reverse.h @@ -26,7 +26,7 @@ struct traits > typedef typename traits::StorageKind StorageKind; typedef typename traits::XprKind XprKind; typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNested_; + typedef std::remove_reference_t MatrixTypeNested_; enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, @@ -69,7 +69,7 @@ template class Reverse typedef typename internal::dense_xpr_base::type Base; EIGEN_DENSE_PUBLIC_INTERFACE(Reverse) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; using Base::IsRowMajor; protected: @@ -101,7 +101,7 @@ template class Reverse return -m_matrix.innerStride(); } - EIGEN_DEVICE_FUNC const typename internal::remove_all::type& + EIGEN_DEVICE_FUNC const internal::remove_all_t& nestedExpression() const { return m_matrix; diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index 7096058bf..7a930dbd2 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -35,7 +35,7 @@ template struct traits > : traits { typedef typename ref_selector::non_const_type MatrixTypeNested; - typedef typename remove_all::type MatrixTypeNestedCleaned; + typedef remove_all_t MatrixTypeNestedCleaned; typedef MatrixType ExpressionType; typedef typename MatrixType::PlainObject FullMatrixType; enum { @@ -63,8 +63,8 @@ template class SelfAdjointView /** \brief The type of coefficients in this matrix */ typedef typename internal::traits::Scalar Scalar; typedef typename MatrixType::StorageIndex StorageIndex; - typedef typename internal::remove_all::type MatrixConjugateReturnType; - typedef SelfAdjointView::type, UpLo> ConstSelfAdjointView; + typedef internal::remove_all_t MatrixConjugateReturnType; + typedef SelfAdjointView, UpLo> ConstSelfAdjointView; enum { Mode = internal::traits::Mode, @@ -180,16 +180,16 @@ template class SelfAdjointView */ template EIGEN_DEVICE_FUNC - typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), - TriangularView, - TriangularView >::type + std::conditional_t<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), + TriangularView, + TriangularView > triangularView() const { - typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), MatrixType&, typename MatrixType::ConstTransposeReturnType>::type tmp1(m_matrix); - typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), MatrixType&, typename MatrixType::AdjointReturnType>::type tmp2(tmp1); - return typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), - TriangularView, - TriangularView >::type(tmp2); + std::conditional_t<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), MatrixType&, typename MatrixType::ConstTransposeReturnType> tmp1(m_matrix); + std::conditional_t<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), MatrixType&, typename MatrixType::AdjointReturnType> tmp2(tmp1); + return std::conditional_t<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), + TriangularView, + TriangularView >(tmp2); } typedef SelfAdjointView ConjugateReturnType; @@ -203,10 +203,10 @@ template class SelfAdjointView */ template EIGEN_DEVICE_FUNC - inline typename internal::conditional::type + inline std::conditional_t conjugateIf() const { - typedef typename internal::conditional::type ReturnType; + typedef std::conditional_t ReturnType; return ReturnType(m_matrix.template conjugateIf()); } @@ -220,7 +220,7 @@ template class SelfAdjointView /** \sa MatrixBase::transpose() */ template EIGEN_DEVICE_FUNC - inline TransposeReturnType transpose(typename internal::enable_if::value, Dummy*>::type = nullptr) + inline TransposeReturnType transpose(std::enable_if_t::value, Dummy*> = nullptr) { typename MatrixType::TransposeReturnType tmp(m_matrix); return TransposeReturnType(tmp); diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 518a6c601..71d6f8539 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -89,7 +89,7 @@ struct triangular_solver_selector static EIGEN_DEVICE_FUNC void run(const Lhs& lhs, Rhs& rhs) { - typename internal::add_const_on_value_type::type actualLhs = LhsProductTraits::extract(lhs); + add_const_on_value_type_t actualLhs = LhsProductTraits::extract(lhs); const Index size = lhs.rows(); const Index othersize = Side==OnTheLeft? rhs.cols() : rhs.rows(); @@ -176,11 +176,11 @@ EIGEN_DEVICE_FUNC void TriangularViewImpl::solveInPlace(c return; enum { copy = (internal::traits::Flags & RowMajorBit) && OtherDerived::IsVectorAtCompileTime && OtherDerived::SizeAtCompileTime!=1}; - typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; + typedef std::conditional_t::type, OtherDerived&> OtherCopy; OtherCopy otherCopy(other); - internal::triangular_solver_selector::type, + internal::triangular_solver_selector, Side, Mode>::run(derived().nestedExpression(), otherCopy); if (copy) @@ -208,7 +208,7 @@ struct traits > template struct triangular_solve_retval : public ReturnByValue > { - typedef typename remove_all::type RhsNestedCleaned; + typedef remove_all_t RhsNestedCleaned; typedef ReturnByValue Base; triangular_solve_retval(const TriangularType& tri, const Rhs& rhs) diff --git a/Eigen/src/Core/SolverBase.h b/Eigen/src/Core/SolverBase.h index 2f238ac3a..a8e91180d 100644 --- a/Eigen/src/Core/SolverBase.h +++ b/Eigen/src/Core/SolverBase.h @@ -30,7 +30,7 @@ struct solve_assertion > template static void run(const type& transpose, const Rhs& b) { - internal::solve_assertion::type>::template run(transpose.nestedExpression(), b); + internal::solve_assertion>::template run(transpose.nestedExpression(), b); } }; @@ -42,7 +42,7 @@ struct solve_assertion template static void run(const type& adjoint, const Rhs& b) { - internal::solve_assertion >::type>::template run(adjoint.nestedExpression(), b); + internal::solve_assertion >>::template run(adjoint.nestedExpression(), b); } }; } // end namespace internal @@ -107,12 +107,12 @@ class SolverBase : public EigenBase inline const Solve solve(const MatrixBase& b) const { - internal::solve_assertion::type>::template run(derived(), b); + internal::solve_assertion>::template run(derived(), b); return Solve(derived(), b.derived()); } /** \internal the return type of transpose() */ - typedef typename internal::add_const >::type ConstTransposeReturnType; + typedef std::add_const_t > ConstTransposeReturnType; /** \returns an expression of the transposed of the factored matrix. * * A typical usage is to solve for the transposed problem A^T x = b: @@ -126,10 +126,10 @@ class SolverBase : public EigenBase } /** \internal the return type of adjoint() */ - typedef typename internal::conditional::IsComplex, - CwiseUnaryOp, ConstTransposeReturnType>, - ConstTransposeReturnType - >::type AdjointReturnType; + typedef std::conditional_t::IsComplex, + CwiseUnaryOp, ConstTransposeReturnType>, + ConstTransposeReturnType + > AdjointReturnType; /** \returns an expression of the adjoint of the factored matrix * * A typical usage is to solve for the adjoint problem A' x = b: diff --git a/Eigen/src/Core/StableNorm.h b/Eigen/src/Core/StableNorm.h index c006c2572..a3bc918aa 100644 --- a/Eigen/src/Core/StableNorm.h +++ b/Eigen/src/Core/StableNorm.h @@ -59,7 +59,7 @@ void stable_norm_impl_inner_step(const VectorType &vec, RealScalar& ssq, RealSca const Index blockSize = 4096; typedef typename internal::nested_eval::type VectorTypeCopy; - typedef typename internal::remove_all::type VectorTypeCopyClean; + typedef internal::remove_all_t VectorTypeCopyClean; const VectorTypeCopy copy(vec); enum { @@ -68,8 +68,8 @@ void stable_norm_impl_inner_step(const VectorType &vec, RealScalar& ssq, RealSca ) && (blockSize*sizeof(Scalar)*20) // if we cannot allocate on the stack, then let's not bother about this optimization }; - typedef typename internal::conditional, internal::evaluator::Alignment>, - typename VectorTypeCopyClean::ConstSegmentReturnType>::type SegmentWrapper; + typedef std::conditional_t, internal::evaluator::Alignment>, + typename VectorTypeCopyClean::ConstSegmentReturnType> SegmentWrapper; Index n = vec.size(); Index bi = internal::first_default_aligned(copy); @@ -81,7 +81,7 @@ void stable_norm_impl_inner_step(const VectorType &vec, RealScalar& ssq, RealSca template typename VectorType::RealScalar -stable_norm_impl(const VectorType &vec, typename enable_if::type* = 0 ) +stable_norm_impl(const VectorType &vec, std::enable_if_t* = 0 ) { using std::sqrt; using std::abs; @@ -103,7 +103,7 @@ stable_norm_impl(const VectorType &vec, typename enable_if typename MatrixType::RealScalar -stable_norm_impl(const MatrixType &mat, typename enable_if::type* = 0 ) +stable_norm_impl(const MatrixType &mat, std::enable_if_t* = 0 ) { using std::sqrt; diff --git a/Eigen/src/Core/StlIterators.h b/Eigen/src/Core/StlIterators.h index d9529c06c..d5d3971f6 100644 --- a/Eigen/src/Core/StlIterators.h +++ b/Eigen/src/Core/StlIterators.h @@ -27,7 +27,7 @@ protected: typedef typename traits::XprType XprType; typedef indexed_based_stl_iterator_base non_const_iterator; typedef indexed_based_stl_iterator_base const_iterator; - typedef typename internal::conditional::value,non_const_iterator,const_iterator>::type other_iterator; + typedef std::conditional_t::value,non_const_iterator,const_iterator> other_iterator; // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: friend class indexed_based_stl_iterator_base; friend class indexed_based_stl_iterator_base; @@ -106,7 +106,7 @@ protected: typedef typename traits::XprType XprType; typedef indexed_based_stl_reverse_iterator_base non_const_iterator; typedef indexed_based_stl_reverse_iterator_base const_iterator; - typedef typename internal::conditional::value,non_const_iterator,const_iterator>::type other_iterator; + typedef std::conditional_t::value,non_const_iterator,const_iterator> other_iterator; // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: friend class indexed_based_stl_reverse_iterator_base; friend class indexed_based_stl_reverse_iterator_base; @@ -181,18 +181,18 @@ template class pointer_based_stl_iterator { enum { is_lvalue = internal::is_lvalue::value }; - typedef pointer_based_stl_iterator::type> non_const_iterator; - typedef pointer_based_stl_iterator::type> const_iterator; - typedef typename internal::conditional::value,non_const_iterator,const_iterator>::type other_iterator; + typedef pointer_based_stl_iterator> non_const_iterator; + typedef pointer_based_stl_iterator> const_iterator; + typedef std::conditional_t::value,non_const_iterator,const_iterator> other_iterator; // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: - friend class pointer_based_stl_iterator::type>; - friend class pointer_based_stl_iterator::type>; + friend class pointer_based_stl_iterator>; + friend class pointer_based_stl_iterator>; public: typedef Index difference_type; typedef typename XprType::Scalar value_type; typedef std::random_access_iterator_tag iterator_category; - typedef typename internal::conditional::type pointer; - typedef typename internal::conditional::type reference; + typedef std::conditional_t pointer; + typedef std::conditional_t reference; pointer_based_stl_iterator() EIGEN_NO_THROW : m_ptr(0) {} @@ -262,8 +262,8 @@ template struct indexed_based_stl_iterator_traits > { typedef XprType_ XprType; - typedef generic_randaccess_stl_iterator::type> non_const_iterator; - typedef generic_randaccess_stl_iterator::type> const_iterator; + typedef generic_randaccess_stl_iterator> non_const_iterator; + typedef generic_randaccess_stl_iterator> const_iterator; }; template @@ -285,13 +285,13 @@ protected: // TODO currently const Transpose/Reshape expressions never returns const references, // so lets return by value too. - //typedef typename internal::conditional::type read_only_ref_t; + //typedef std::conditional_t read_only_ref_t; typedef const value_type read_only_ref_t; public: - typedef typename internal::conditional::type pointer; - typedef typename internal::conditional::type reference; + typedef std::conditional_t pointer; + typedef std::conditional_t reference; generic_randaccess_stl_iterator() : Base() {} generic_randaccess_stl_iterator(XprType& xpr, Index index) : Base(xpr,index) {} @@ -307,8 +307,8 @@ template struct indexed_based_stl_iterator_traits > { typedef XprType_ XprType; - typedef subvector_stl_iterator::type, Direction> non_const_iterator; - typedef subvector_stl_iterator::type, Direction> const_iterator; + typedef subvector_stl_iterator, Direction> non_const_iterator; + typedef subvector_stl_iterator, Direction> const_iterator; }; template @@ -322,12 +322,12 @@ protected: using Base::m_index; using Base::mp_xpr; - typedef typename internal::conditional::type SubVectorType; - typedef typename internal::conditional::type ConstSubVectorType; + typedef std::conditional_t SubVectorType; + typedef std::conditional_t ConstSubVectorType; public: - typedef typename internal::conditional::type reference; + typedef std::conditional_t reference; typedef typename reference::PlainObject value_type; private: @@ -355,8 +355,8 @@ template struct indexed_based_stl_iterator_traits > { typedef XprType_ XprType; - typedef subvector_stl_reverse_iterator::type, Direction> non_const_iterator; - typedef subvector_stl_reverse_iterator::type, Direction> const_iterator; + typedef subvector_stl_reverse_iterator, Direction> non_const_iterator; + typedef subvector_stl_reverse_iterator, Direction> const_iterator; }; template @@ -370,12 +370,12 @@ protected: using Base::m_index; using Base::mp_xpr; - typedef typename internal::conditional::type SubVectorType; - typedef typename internal::conditional::type ConstSubVectorType; + typedef std::conditional_t SubVectorType; + typedef std::conditional_t ConstSubVectorType; public: - typedef typename internal::conditional::type reference; + typedef std::conditional_t reference; typedef typename reference::PlainObject value_type; private: diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index d302766cd..e47119c44 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -20,7 +20,7 @@ template struct traits > : public traits { typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNestedPlain; + typedef std::remove_reference_t MatrixTypeNestedPlain; enum { RowsAtCompileTime = MatrixType::ColsAtCompileTime, ColsAtCompileTime = MatrixType::RowsAtCompileTime, @@ -60,7 +60,7 @@ template class Transpose typedef typename TransposeImpl::StorageKind>::Base Base; EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Transpose(MatrixType& matrix) : m_matrix(matrix) {} @@ -74,12 +74,12 @@ template class Transpose /** \returns the nested expression */ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_matrix; } /** \returns the nested expression */ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::remove_reference::type& + std::remove_reference_t& nestedExpression() { return m_matrix; } /** \internal */ @@ -132,11 +132,11 @@ template class TransposeImpl EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index outerStride() const { return derived().nestedExpression().outerStride(); } - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; + typedef std::conditional_t< + internal::is_lvalue::value, + Scalar, + const Scalar + > ScalarWithConstIfNotLvalue; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarWithConstIfNotLvalue* data() { return derived().nestedExpression().data(); } diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 28f515fa4..a583f248d 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -172,8 +172,8 @@ template struct traits > : traits { typedef typename ref_selector::non_const_type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNestedNonRef; - typedef typename remove_all::type MatrixTypeNestedCleaned; + typedef std::remove_reference_t MatrixTypeNestedNonRef; + typedef remove_all_t MatrixTypeNestedCleaned; typedef typename MatrixType::PlainObject FullMatrixType; typedef MatrixType ExpressionType; enum { @@ -199,8 +199,8 @@ template class TriangularView typedef typename internal::traits::MatrixTypeNested MatrixTypeNested; typedef typename internal::traits::MatrixTypeNestedNonRef MatrixTypeNestedNonRef; - typedef typename internal::remove_all::type MatrixConjugateReturnType; - typedef TriangularView::type, Mode_> ConstTriangularView; + typedef internal::remove_all_t MatrixConjugateReturnType; + typedef TriangularView, Mode_> ConstTriangularView; public: @@ -249,10 +249,10 @@ template class TriangularView */ template EIGEN_DEVICE_FUNC - inline typename internal::conditional::type + inline std::conditional_t conjugateIf() const { - typedef typename internal::conditional::type ReturnType; + typedef std::conditional_t ReturnType; return ReturnType(m_matrix.template conjugateIf()); } @@ -266,7 +266,7 @@ template class TriangularView /** \sa MatrixBase::transpose() */ template EIGEN_DEVICE_FUNC - inline TransposeReturnType transpose(typename internal::enable_if::value, Dummy*>::type = nullptr) + inline TransposeReturnType transpose(std::enable_if_t::value, Dummy*> = nullptr) { typename MatrixType::TransposeReturnType tmp(m_matrix); return TransposeReturnType(tmp); @@ -731,10 +731,10 @@ struct evaluator_traits > template struct unary_evaluator, IndexBased> - : evaluator::type> + : evaluator> { typedef TriangularView XprType; - typedef evaluator::type> Base; + typedef evaluator> Base; EIGEN_DEVICE_FUNC unary_evaluator(const XprType &xpr) : Base(xpr.nestedExpression()) {} }; diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index 5d4c11f90..cf8b27fd9 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -193,7 +193,7 @@ template class VectorwiseOp typedef typename ExpressionType::RealScalar RealScalar; typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 typedef typename internal::ref_selector::non_const_type ExpressionTypeNested; - typedef typename internal::remove_all::type ExpressionTypeNestedCleaned; + typedef internal::remove_all_t ExpressionTypeNestedCleaned; template class Functor, typename ReturnScalar=Scalar> struct ReturnType diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index cb5524517..b384bb3d0 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -122,8 +122,8 @@ public: explicit visitor_evaluator(const XprType &xpr) : m_evaluator(xpr), m_xpr(xpr) { } typedef typename XprType::Scalar Scalar; - typedef typename internal::remove_const::type CoeffReturnType; - typedef typename internal::remove_const::type PacketReturnType; + typedef std::remove_const_t CoeffReturnType; + typedef std::remove_const_t PacketReturnType; EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); } EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); } diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index efb0242ba..3117f5659 100755 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -2573,7 +2573,7 @@ template struct plogical_shift_left_impl; template -struct plogical_shift_left_impl= 0)>::type> { +struct plogical_shift_left_impl= 0)>> { static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) { static const unsigned n = static_cast(N); const Packet4ui shift = {n, n, n, n}; @@ -2587,7 +2587,7 @@ struct plogical_shift_left_impl= 0)>::typ }; template -struct plogical_shift_left_impl= 32)>::type> { +struct plogical_shift_left_impl= 32)>> { static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) { static const unsigned m = static_cast(N - 32); const Packet4ui shift = {m, m, m, m}; @@ -2605,7 +2605,7 @@ template struct plogical_shift_right_impl; template -struct plogical_shift_right_impl= 0)>::type> { +struct plogical_shift_right_impl= 0)>> { static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) { static const unsigned n = static_cast(N); const Packet4ui shift = {n, n, n, n}; @@ -2619,7 +2619,7 @@ struct plogical_shift_right_impl= 0)>::ty }; template -struct plogical_shift_right_impl= 32)>::type> { +struct plogical_shift_right_impl= 32)>> { static EIGEN_STRONG_INLINE Packet2l run(const Packet2l& a) { static const unsigned m = static_cast(N - 32); const Packet4ui shift = {m, m, m, m}; diff --git a/Eigen/src/Core/arch/GPU/Tuple.h b/Eigen/src/Core/arch/GPU/Tuple.h index 97c54e5b0..e223ca1d2 100644 --- a/Eigen/src/Core/arch/GPU/Tuple.h +++ b/Eigen/src/Core/arch/GPU/Tuple.h @@ -31,22 +31,22 @@ class TupleImpl { EIGEN_MAKE_ALIGNED_OPERATOR_NEW // Default constructor, enable if all types are default-constructible. - template::value && reduce_all::value...>::value - >::type> + >> EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl() : head_{}, tail_{} {} // Element constructor. template 1 || std::is_convertible::value) - >::type> + >> EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl(U1&& arg1, Us&&... args) : head_(std::forward(arg1)), tail_(std::forward(args)...) {} @@ -253,9 +253,9 @@ get(TupleImpl& tuple) { * \return concatenated tuple. */ template::type>::value...>::value>::type> + is_tuple::type>::value...>::value>> EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_cat_impl::type...>::ReturnType tuple_cat(Tuples&&... tuples) { diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 076b95f67..b1a127754 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -356,7 +356,7 @@ struct RhsPanelHelper { private: static const int remaining_registers = EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS - registers_taken; public: - typedef typename conditional=4, RhsPacketx4, RhsPacket>::type type; + typedef std::conditional_t=4, RhsPacketx4, RhsPacket> type; }; template @@ -459,9 +459,9 @@ public: }; - typedef typename conditional::type LhsPacket; - typedef typename conditional::type RhsPacket; - typedef typename conditional::type ResPacket; + typedef std::conditional_t LhsPacket; + typedef std::conditional_t RhsPacket; + typedef std::conditional_t ResPacket; typedef LhsPacket LhsPacket4Packing; typedef QuadPacket RhsPacketx4; @@ -578,9 +578,9 @@ public: RhsProgress = 1 }; - typedef typename conditional::type LhsPacket; - typedef typename conditional::type RhsPacket; - typedef typename conditional::type ResPacket; + typedef std::conditional_t LhsPacket; + typedef std::conditional_t RhsPacket; + typedef std::conditional_t ResPacket; typedef LhsPacket LhsPacket4Packing; typedef QuadPacket RhsPacketx4; @@ -614,7 +614,7 @@ public: EIGEN_STRONG_INLINE void loadRhsQuad(const RhsScalar* b, RhsPacket& dest) const { - loadRhsQuad_impl(b,dest, typename conditional::type()); + loadRhsQuad_impl(b,dest, std::conditional_t()); } EIGEN_STRONG_INLINE void loadRhsQuad_impl(const RhsScalar* b, RhsPacket& dest, const true_type&) const @@ -645,7 +645,7 @@ public: template EIGEN_STRONG_INLINE void madd(const LhsPacketType& a, const RhsPacketType& b, AccPacketType& c, RhsPacketType& tmp, const LaneIdType&) const { - madd_impl(a, b, c, tmp, typename conditional::type()); + madd_impl(a, b, c, tmp, std::conditional_t()); } template @@ -703,7 +703,7 @@ DoublePacket padd(const DoublePacket &a, const DoublePacket const DoublePacket& predux_half_dowto4(const DoublePacket &a, - typename enable_if::size<=8>::type* = 0) + std::enable_if_t::size<=8>* = 0) { return a; } @@ -711,7 +711,7 @@ predux_half_dowto4(const DoublePacket &a, template DoublePacket::half> predux_half_dowto4(const DoublePacket &a, - typename enable_if::size==16>::type* = 0) + std::enable_if_t::size==16>* = 0) { // yes, that's pretty hackish :( DoublePacket::half> res; @@ -725,7 +725,7 @@ predux_half_dowto4(const DoublePacket &a, // same here, "quad" actually means "8" in terms of real coefficients template void loadQuadToDoublePacket(const Scalar* b, DoublePacket& dest, - typename enable_if::size<=8>::type* = 0) + std::enable_if_t::size<=8>* = 0) { dest.first = pset1(numext::real(*b)); dest.second = pset1(numext::imag(*b)); @@ -733,7 +733,7 @@ void loadQuadToDoublePacket(const Scalar* b, DoublePacket& dest, template void loadQuadToDoublePacket(const Scalar* b, DoublePacket& dest, - typename enable_if::size==16>::type* = 0) + std::enable_if_t::size==16>* = 0) { // yes, that's pretty hackish too :( typedef typename NumTraits::Real RealScalar; @@ -791,11 +791,11 @@ public: typedef DoublePacket DoublePacketType; - typedef typename conditional::type LhsPacket4Packing; - typedef typename conditional::type LhsPacket; - typedef typename conditional::type RhsPacket; - typedef typename conditional::type ResPacket; - typedef typename conditional::type AccPacket; + typedef std::conditional_t LhsPacket4Packing; + typedef std::conditional_t LhsPacket; + typedef std::conditional_t RhsPacket; + typedef std::conditional_t ResPacket; + typedef std::conditional_t AccPacket; // this actually holds 8 packets! typedef QuadPacket RhsPacketx4; @@ -868,7 +868,7 @@ public: template EIGEN_STRONG_INLINE - typename enable_if::value>::type + std::enable_if_t::value> madd(const LhsPacketType& a, const RhsPacketType& b, DoublePacket& c, TmpType& /*tmp*/, const LaneIdType&) const { c.first = padd(pmul(a,b.first), c.first); @@ -960,9 +960,9 @@ public: RhsProgress = 1 }; - typedef typename conditional::type LhsPacket; - typedef typename conditional::type RhsPacket; - typedef typename conditional::type ResPacket; + typedef std::conditional_t LhsPacket; + typedef std::conditional_t RhsPacket; + typedef std::conditional_t ResPacket; typedef LhsPacket LhsPacket4Packing; typedef QuadPacket RhsPacketx4; typedef ResPacket AccPacket; @@ -1011,7 +1011,7 @@ public: template EIGEN_STRONG_INLINE void madd(const LhsPacketType& a, const RhsPacketType& b, AccPacketType& c, RhsPacketType& tmp, const LaneIdType&) const { - madd_impl(a, b, c, tmp, typename conditional::type()); + madd_impl(a, b, c, tmp, std::conditional_t()); } template @@ -1976,10 +1976,10 @@ void gebp_kernel=8,typename unpacket_traits::half,SResPacket>::type SResPacketHalf; - typedef typename conditional=8,typename unpacket_traits::half,SLhsPacket>::type SLhsPacketHalf; - typedef typename conditional=8,typename unpacket_traits::half,SRhsPacket>::type SRhsPacketHalf; - typedef typename conditional=8,typename unpacket_traits::half,SAccPacket>::type SAccPacketHalf; + typedef std::conditional_t=8,typename unpacket_traits::half,SResPacket> SResPacketHalf; + typedef std::conditional_t=8,typename unpacket_traits::half,SLhsPacket> SLhsPacketHalf; + typedef std::conditional_t=8,typename unpacket_traits::half,SRhsPacket> SRhsPacketHalf; + typedef std::conditional_t=8,typename unpacket_traits::half,SAccPacket> SAccPacketHalf; SResPacketHalf R = res.template gatherPacket(i, j2); SResPacketHalf alphav = pset1(alpha); diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index df64232f5..5262428b6 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -277,16 +277,16 @@ class level3_blocking template class gemm_blocking_space : public level3_blocking< - typename conditional::type, - typename conditional::type> + std::conditional_t, + std::conditional_t> { enum { Transpose = StorageOrder==RowMajor, ActualRows = Transpose ? MaxCols : MaxRows, ActualCols = Transpose ? MaxRows : MaxCols }; - typedef typename conditional::type LhsScalar; - typedef typename conditional::type RhsScalar; + typedef std::conditional_t LhsScalar; + typedef std::conditional_t RhsScalar; typedef gebp_traits Traits; enum { SizeA = ActualRows * MaxDepth, @@ -328,14 +328,14 @@ class gemm_blocking_space class gemm_blocking_space : public level3_blocking< - typename conditional::type, - typename conditional::type> + std::conditional_t, + std::conditional_t> { enum { Transpose = StorageOrder==RowMajor }; - typedef typename conditional::type LhsScalar; - typedef typename conditional::type RhsScalar; + typedef std::conditional_t LhsScalar; + typedef std::conditional_t RhsScalar; typedef gebp_traits Traits; Index m_sizeA; @@ -415,11 +415,11 @@ struct generic_product_impl typedef internal::blas_traits LhsBlasTraits; typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; - typedef typename internal::remove_all::type ActualLhsTypeCleaned; + typedef internal::remove_all_t ActualLhsTypeCleaned; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type ActualRhsTypeCleaned; + typedef internal::remove_all_t ActualRhsTypeCleaned; enum { MaxDepthAtCompileTime = min_size_prefer_fixed(Lhs::MaxColsAtCompileTime, Rhs::MaxRowsAtCompileTime) @@ -485,8 +485,8 @@ struct generic_product_impl ::scaleAndAddTo(dst_vec, a_lhs.row(0), a_rhs, alpha); } - typename internal::add_const_on_value_type::type lhs = LhsBlasTraits::extract(a_lhs); - typename internal::add_const_on_value_type::type rhs = RhsBlasTraits::extract(a_rhs); + add_const_on_value_type_t lhs = LhsBlasTraits::extract(a_lhs); + add_const_on_value_type_t rhs = RhsBlasTraits::extract(a_rhs); Scalar actualAlpha = combine_scalar_factors(alpha, a_lhs, a_rhs); diff --git a/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h b/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h index 9728f30b9..716f2ca78 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h @@ -210,17 +210,17 @@ struct general_product_to_triangular_selector { typedef typename MatrixType::Scalar Scalar; - typedef typename internal::remove_all::type Lhs; + typedef internal::remove_all_t Lhs; typedef internal::blas_traits LhsBlasTraits; typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs; - typedef typename internal::remove_all::type ActualLhs_; - typename internal::add_const_on_value_type::type actualLhs = LhsBlasTraits::extract(prod.lhs()); + typedef internal::remove_all_t ActualLhs_; + internal::add_const_on_value_type_t actualLhs = LhsBlasTraits::extract(prod.lhs()); - typedef typename internal::remove_all::type Rhs; + typedef internal::remove_all_t Rhs; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs; - typedef typename internal::remove_all::type ActualRhs_; - typename internal::add_const_on_value_type::type actualRhs = RhsBlasTraits::extract(prod.rhs()); + typedef internal::remove_all_t ActualRhs_; + internal::add_const_on_value_type_t actualRhs = RhsBlasTraits::extract(prod.rhs()); Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs().derived()) * RhsBlasTraits::extractScalarFactor(prod.rhs().derived()); @@ -256,17 +256,17 @@ struct general_product_to_triangular_selector { static void run(MatrixType& mat, const ProductType& prod, const typename MatrixType::Scalar& alpha, bool beta) { - typedef typename internal::remove_all::type Lhs; + typedef internal::remove_all_t Lhs; typedef internal::blas_traits LhsBlasTraits; typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs; - typedef typename internal::remove_all::type ActualLhs_; - typename internal::add_const_on_value_type::type actualLhs = LhsBlasTraits::extract(prod.lhs()); + typedef internal::remove_all_t ActualLhs_; + internal::add_const_on_value_type_t actualLhs = LhsBlasTraits::extract(prod.lhs()); - typedef typename internal::remove_all::type Rhs; + typedef internal::remove_all_t Rhs; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs; - typedef typename internal::remove_all::type ActualRhs_; - typename internal::add_const_on_value_type::type actualRhs = RhsBlasTraits::extract(prod.rhs()); + typedef internal::remove_all_t ActualRhs_; + internal::add_const_on_value_type_t actualRhs = RhsBlasTraits::extract(prod.rhs()); typename ProductType::Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs().derived()) * RhsBlasTraits::extractScalarFactor(prod.rhs().derived()); diff --git a/Eigen/src/Core/products/GeneralMatrixVector.h b/Eigen/src/Core/products/GeneralMatrixVector.h index e7dd61d64..7307994ce 100644 --- a/Eigen/src/Core/products/GeneralMatrixVector.h +++ b/Eigen/src/Core/products/GeneralMatrixVector.h @@ -58,9 +58,9 @@ public: ResPacketSize = Vectorizable ? unpacket_traits::size : 1 }; - typedef typename conditional::type LhsPacket; - typedef typename conditional::type RhsPacket; - typedef typename conditional::type ResPacket; + typedef std::conditional_t LhsPacket; + typedef std::conditional_t RhsPacket; + typedef std::conditional_t ResPacket; }; diff --git a/Eigen/src/Core/products/SelfadjointMatrixMatrix.h b/Eigen/src/Core/products/SelfadjointMatrixMatrix.h index f6fdbcad8..c7bb44596 100644 --- a/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +++ b/Eigen/src/Core/products/SelfadjointMatrixMatrix.h @@ -511,8 +511,8 @@ struct selfadjoint_product_impl { eigen_assert(dst.rows()==a_lhs.rows() && dst.cols()==a_rhs.cols()); - typename internal::add_const_on_value_type::type lhs = LhsBlasTraits::extract(a_lhs); - typename internal::add_const_on_value_type::type rhs = RhsBlasTraits::extract(a_rhs); + add_const_on_value_type_t lhs = LhsBlasTraits::extract(a_lhs); + add_const_on_value_type_t rhs = RhsBlasTraits::extract(a_rhs); Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(a_lhs) * RhsBlasTraits::extractScalarFactor(a_rhs); diff --git a/Eigen/src/Core/products/SelfadjointMatrixVector.h b/Eigen/src/Core/products/SelfadjointMatrixVector.h index 086638e61..a62b6b5b5 100644 --- a/Eigen/src/Core/products/SelfadjointMatrixVector.h +++ b/Eigen/src/Core/products/SelfadjointMatrixVector.h @@ -169,11 +169,11 @@ struct selfadjoint_product_impl typedef internal::blas_traits LhsBlasTraits; typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; - typedef typename internal::remove_all::type ActualLhsTypeCleaned; + typedef internal::remove_all_t ActualLhsTypeCleaned; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type ActualRhsTypeCleaned; + typedef internal::remove_all_t ActualRhsTypeCleaned; enum { LhsUpLo = LhsMode&(Upper|Lower) }; @@ -187,8 +187,8 @@ struct selfadjoint_product_impl eigen_assert(dest.rows()==a_lhs.rows() && dest.cols()==a_rhs.cols()); - typename internal::add_const_on_value_type::type lhs = LhsBlasTraits::extract(a_lhs); - typename internal::add_const_on_value_type::type rhs = RhsBlasTraits::extract(a_rhs); + add_const_on_value_type_t lhs = LhsBlasTraits::extract(a_lhs); + add_const_on_value_type_t rhs = RhsBlasTraits::extract(a_rhs); Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(a_lhs) * RhsBlasTraits::extractScalarFactor(a_rhs); diff --git a/Eigen/src/Core/products/SelfadjointProduct.h b/Eigen/src/Core/products/SelfadjointProduct.h index 026bc1924..4cbc1f714 100644 --- a/Eigen/src/Core/products/SelfadjointProduct.h +++ b/Eigen/src/Core/products/SelfadjointProduct.h @@ -28,7 +28,7 @@ struct selfadjoint_rank1_update { internal::conj_if cj; typedef Map > OtherMap; - typedef typename internal::conditional::type ConjLhsType; + typedef std::conditional_t ConjLhsType; for (Index i=0; i >(mat+stride*i+(UpLo==Lower ? i : 0), (UpLo==Lower ? size-i : (i+1))) @@ -57,8 +57,8 @@ struct selfadjoint_product_selector typedef typename MatrixType::Scalar Scalar; typedef internal::blas_traits OtherBlasTraits; typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType; - typedef typename internal::remove_all::type ActualOtherType_; - typename internal::add_const_on_value_type::type actualOther = OtherBlasTraits::extract(other.derived()); + typedef internal::remove_all_t ActualOtherType_; + internal::add_const_on_value_type_t actualOther = OtherBlasTraits::extract(other.derived()); Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived()); @@ -89,8 +89,8 @@ struct selfadjoint_product_selector typedef typename MatrixType::Scalar Scalar; typedef internal::blas_traits OtherBlasTraits; typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType; - typedef typename internal::remove_all::type ActualOtherType_; - typename internal::add_const_on_value_type::type actualOther = OtherBlasTraits::extract(other.derived()); + typedef internal::remove_all_t ActualOtherType_; + internal::add_const_on_value_type_t actualOther = OtherBlasTraits::extract(other.derived()); Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived()); diff --git a/Eigen/src/Core/products/SelfadjointRank2Update.h b/Eigen/src/Core/products/SelfadjointRank2Update.h index 44c3381d9..fb199ad75 100644 --- a/Eigen/src/Core/products/SelfadjointRank2Update.h +++ b/Eigen/src/Core/products/SelfadjointRank2Update.h @@ -52,9 +52,8 @@ struct selfadjoint_rank2_update_selector } }; -template struct conj_expr_if - : conditional::Scalar>,T> > {}; +template +using conj_expr_if = std::conditional::Scalar>,T>>; } // end namespace internal @@ -65,13 +64,13 @@ EIGEN_DEVICE_FUNC SelfAdjointView& SelfAdjointView UBlasTraits; typedef typename UBlasTraits::DirectLinearAccessType ActualUType; - typedef typename internal::remove_all::type ActualUType_; - typename internal::add_const_on_value_type::type actualU = UBlasTraits::extract(u.derived()); + typedef internal::remove_all_t ActualUType_; + internal::add_const_on_value_type_t actualU = UBlasTraits::extract(u.derived()); typedef internal::blas_traits VBlasTraits; typedef typename VBlasTraits::DirectLinearAccessType ActualVType; - typedef typename internal::remove_all::type ActualVType_; - typename internal::add_const_on_value_type::type actualV = VBlasTraits::extract(v.derived()); + typedef internal::remove_all_t ActualVType_; + internal::add_const_on_value_type_t actualV = VBlasTraits::extract(v.derived()); // If MatrixType is row major, then we use the routine for lower triangular in the upper triangular case and // vice versa, and take the complex conjugate of all coefficients and vector entries. @@ -82,8 +81,8 @@ EIGEN_DEVICE_FUNC SelfAdjointView& SelfAdjointView::type>::type UType; - typedef typename internal::remove_all::type>::type VType; + typedef internal::remove_all_t::type> UType; + typedef internal::remove_all_t::type> VType; internal::selfadjoint_rank2_update_selector ::run(_expression().const_cast_derived().data(),_expression().outerStride(),UType(actualU),VType(actualV),actualAlpha); diff --git a/Eigen/src/Core/products/TriangularMatrixMatrix.h b/Eigen/src/Core/products/TriangularMatrixMatrix.h index 26bee63c5..770107a0b 100644 --- a/Eigen/src/Core/products/TriangularMatrixMatrix.h +++ b/Eigen/src/Core/products/TriangularMatrixMatrix.h @@ -414,13 +414,13 @@ struct triangular_product_impl typedef internal::blas_traits LhsBlasTraits; typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; - typedef typename internal::remove_all::type ActualLhsTypeCleaned; + typedef internal::remove_all_t ActualLhsTypeCleaned; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type ActualRhsTypeCleaned; - - typename internal::add_const_on_value_type::type lhs = LhsBlasTraits::extract(a_lhs); - typename internal::add_const_on_value_type::type rhs = RhsBlasTraits::extract(a_rhs); + typedef internal::remove_all_t ActualRhsTypeCleaned; + + internal::add_const_on_value_type_t lhs = LhsBlasTraits::extract(a_lhs); + internal::add_const_on_value_type_t rhs = RhsBlasTraits::extract(a_rhs); LhsScalar lhs_alpha = LhsBlasTraits::extractScalarFactor(a_lhs); RhsScalar rhs_alpha = RhsBlasTraits::extractScalarFactor(a_rhs); diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index 72b3c13a0..df15e814d 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -219,8 +219,8 @@ template struct trmv_selector typedef Map, plain_enum_min(AlignedMax,internal::packet_traits::size)> MappedDest; - typename internal::add_const_on_value_type::type actualLhs = LhsBlasTraits::extract(lhs); - typename internal::add_const_on_value_type::type actualRhs = RhsBlasTraits::extract(rhs); + add_const_on_value_type_t actualLhs = LhsBlasTraits::extract(lhs); + add_const_on_value_type_t actualRhs = RhsBlasTraits::extract(rhs); LhsScalar lhs_alpha = LhsBlasTraits::extractScalarFactor(lhs); RhsScalar rhs_alpha = RhsBlasTraits::extractScalarFactor(rhs); @@ -298,10 +298,10 @@ template struct trmv_selector typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; typedef internal::blas_traits RhsBlasTraits; typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type ActualRhsTypeCleaned; + typedef internal::remove_all_t ActualRhsTypeCleaned; - typename add_const::type actualLhs = LhsBlasTraits::extract(lhs); - typename add_const::type actualRhs = RhsBlasTraits::extract(rhs); + std::add_const_t actualLhs = LhsBlasTraits::extract(lhs); + std::add_const_t actualRhs = RhsBlasTraits::extract(rhs); LhsScalar lhs_alpha = LhsBlasTraits::extractScalarFactor(lhs); RhsScalar rhs_alpha = RhsBlasTraits::extractScalarFactor(rhs); diff --git a/Eigen/src/Core/products/TriangularSolverVector.h b/Eigen/src/Core/products/TriangularSolverVector.h index c1c9e4c84..57ade287e 100644 --- a/Eigen/src/Core/products/TriangularSolverVector.h +++ b/Eigen/src/Core/products/TriangularSolverVector.h @@ -43,11 +43,10 @@ struct triangular_solve_vector LhsMapper; typedef const_blas_data_mapper RhsMapper; - typename internal::conditional< - Conjugate, - const CwiseUnaryOp,LhsMap>, - const LhsMap&> - ::type cjLhs(lhs); + std::conditional_t< + Conjugate, + const CwiseUnaryOp,LhsMap>, + const LhsMap&> cjLhs(lhs); static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; for(Index pi=IsLower ? 0 : size; IsLower ? pi0; @@ -99,10 +98,10 @@ struct triangular_solve_vector(lhsStride)); typedef const_blas_data_mapper LhsMapper; typedef const_blas_data_mapper RhsMapper; - typename internal::conditional,LhsMap>, - const LhsMap& - >::type cjLhs(lhs); + std::conditional_t,LhsMap>, + const LhsMap& + > cjLhs(lhs); static const Index PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; for(Index pi=IsLower ? 0 : size; diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h index 8b35bcc29..ea6b87699 100755 --- a/Eigen/src/Core/util/BlasUtil.h +++ b/Eigen/src/Core/util/BlasUtil.h @@ -428,10 +428,10 @@ template struct blas_traits ) ? 1 : 0, HasScalarFactor = false }; - typedef typename conditional::type DirectLinearAccessType; + > DirectLinearAccessType; static inline EIGEN_DEVICE_FUNC ExtractType extract(const XprType& x) { return x; } static inline EIGEN_DEVICE_FUNC const Scalar extractScalarFactor(const XprType&) { return Scalar(1); } }; @@ -514,10 +514,10 @@ struct blas_traits > typedef Transpose XprType; typedef Transpose ExtractType; // const to get rid of a compile error; anyway blas traits are only used on the RHS typedef Transpose ExtractType_; - typedef typename conditional::type DirectLinearAccessType; + > DirectLinearAccessType; enum { IsTransposed = Base::IsTransposed ? 0 : 1 }; diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index aa4b6424b..a69696121 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -106,7 +106,7 @@ template class OuterStride; template > class Map; template class RefBase; template,OuterStride<> >::type > class Ref; + typename StrideType = typename std::conditional_t,OuterStride<> > > class Ref; template> class CwiseUnaryView; template class TriangularBase; diff --git a/Eigen/src/Core/util/IndexedViewHelper.h b/Eigen/src/Core/util/IndexedViewHelper.h index 3e5fc09f6..19fa45d7f 100644 --- a/Eigen/src/Core/util/IndexedViewHelper.h +++ b/Eigen/src/Core/util/IndexedViewHelper.h @@ -99,7 +99,7 @@ template<> struct get_compile_time_incr { // Turn a single index into something that looks like an array (i.e., that exposes a .size(), and operator[](int) methods) template -struct IndexedViewCompatibleType::value>::type> { +struct IndexedViewCompatibleType::value>> { // Here we could simply use Array, but maybe it's less work for the compiler to use // a simpler wrapper as SingleRange //typedef Eigen::Array type; @@ -107,13 +107,13 @@ struct IndexedViewCompatibleType -struct IndexedViewCompatibleType::value>::type> { +struct IndexedViewCompatibleType::value>> { typedef SingleRange type; }; template -typename enable_if::value,SingleRange>::type +std::enable_if_t::value,SingleRange> makeIndexedViewCompatible(const T& id, Index size, SpecializedType) { return eval_expr_given_size(id,size); } diff --git a/Eigen/src/Core/util/IntegralConstant.h b/Eigen/src/Core/util/IntegralConstant.h index da9cccbf5..ea275bd98 100644 --- a/Eigen/src/Core/util/IntegralConstant.h +++ b/Eigen/src/Core/util/IntegralConstant.h @@ -169,7 +169,7 @@ template EIGEN_DEVICE_FUNC Index get_runtime_value(const T &x) { ret template struct cleanup_index_type { typedef T type; }; // Convert any integral type (e.g., short, int, unsigned int, etc.) to Eigen::Index -template struct cleanup_index_type::value>::type> { typedef Index type; }; +template struct cleanup_index_type::value>> { typedef Index type; }; // If VariableAndFixedInt does not match DynamicKey, then we turn it to a pure compile-time value: template struct cleanup_index_type, DynamicKey> { typedef FixedInt type; }; diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index f58212fca..d5fd14014 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -90,24 +90,6 @@ struct bool_constant : true_type {}; template<> struct bool_constant : false_type {}; -template -struct conditional { typedef Then type; }; - -template -struct conditional { typedef Else type; }; - -template struct remove_reference { typedef T type; }; -template struct remove_reference { 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 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[Size]; }; - template struct remove_all { typedef T type; }; template struct remove_all { typedef typename remove_all::type type; }; template struct remove_all { typedef typename remove_all::type type; }; @@ -115,6 +97,9 @@ template struct remove_all { typedef typename remove_all< template struct remove_all { typedef typename remove_all::type type; }; template struct remove_all { typedef typename remove_all::type type; }; +template +using remove_all_t = typename remove_all::type; + template struct is_arithmetic { enum { value = false }; }; template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; @@ -134,7 +119,7 @@ template struct is_same { enum { value = 0 }; }; template struct is_same { enum { value = 1 }; }; template< class T > -struct is_void : is_same::type> {}; +struct is_void : is_same> {}; template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; @@ -142,9 +127,6 @@ using std::is_integral; using std::make_unsigned; -template struct add_const { typedef const T type; }; -template struct add_const { typedef T& type; }; - template struct is_const { enum { value = 0 }; }; template struct is_const { enum { value = 1 }; }; @@ -154,16 +136,11 @@ template struct add_const_on_value_type { typedef T const template struct add_const_on_value_type { typedef T const* const type; }; template struct add_const_on_value_type { typedef T const* const type; }; +template +using add_const_on_value_type_t = typename add_const_on_value_type::type; + using std::is_convertible; -/** \internal Allows to enable/disable an overload - * according to a compile time condition. - */ -template struct enable_if; - -template struct enable_if -{ typedef T type; }; - /** \internal * A base class do disable default copy ctor and copy assignment operator. */ @@ -194,7 +171,7 @@ template struct array_size { enum { value = Dynamic }; }; -template struct array_size::type> { +template struct array_size> { enum { value = T::SizeAtCompileTime }; }; @@ -256,24 +233,24 @@ template struct result_of; template struct result_of { typedef typename std::invoke_result::type type1; - typedef typename remove_all::type type; + typedef remove_all_t type; }; template struct invoke_result { typedef typename std::invoke_result::type type1; - typedef typename remove_all::type type; + typedef remove_all_t type; }; #else template struct result_of { typedef typename std::result_of::type type1; - typedef typename remove_all::type type; + typedef remove_all_t type; }; template struct invoke_result { typedef typename result_of::type type1; - typedef typename remove_all::type type; + typedef remove_all_t type; }; #endif @@ -305,7 +282,7 @@ template const T* return_ptr(); template struct has_nullary_operator { - template static meta_yes testFunctor(C const *,typename enable_if<(sizeof(return_ptr()->operator()())>0)>::type * = 0); + template static meta_yes testFunctor(C const *,std::enable_if_t<(sizeof(return_ptr()->operator()())>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; @@ -314,7 +291,7 @@ struct has_nullary_operator template struct has_unary_operator { - template static meta_yes testFunctor(C const *,typename enable_if<(sizeof(return_ptr()->operator()(IndexType(0)))>0)>::type * = 0); + template static meta_yes testFunctor(C const *,std::enable_if_t<(sizeof(return_ptr()->operator()(IndexType(0)))>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; @@ -323,7 +300,7 @@ struct has_unary_operator template struct has_binary_operator { - template static meta_yes testFunctor(C const *,typename enable_if<(sizeof(return_ptr()->operator()(IndexType(0),IndexType(0)))>0)>::type * = 0); + template static meta_yes testFunctor(C const *,std::enable_if_t<(sizeof(return_ptr()->operator()(IndexType(0),IndexType(0)))>0)> * = 0); static meta_no testFunctor(...); enum { value = sizeof(testFunctor(static_cast(0))) == sizeof(meta_yes) }; @@ -381,7 +358,7 @@ template struct scalar_product_traits // FIXME quick workaround around current limitation of result_of // template // struct result_of(ArgType0,ArgType1)> { -// typedef typename scalar_product_traits::type, typename remove_all::type>::ReturnType type; +// typedef typename scalar_product_traits, remove_all_t>::ReturnType type; // }; /** \internal Obtains a POD type suitable to use as storage for an object of a size diff --git a/Eigen/src/Core/util/Serializer.h b/Eigen/src/Core/util/Serializer.h index b77c5de57..cbfc04acb 100644 --- a/Eigen/src/Core/util/Serializer.h +++ b/Eigen/src/Core/util/Serializer.h @@ -28,9 +28,9 @@ class Serializer; // Specialization for POD types. template -class Serializer::value - && std::is_standard_layout::value>::type > { + && std::is_standard_layout::value>> { public: /** diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 73bad6c79..137ff2139 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -113,7 +113,7 @@ class no_assignment_operator template struct promote_index_type { - typedef typename conditional<(sizeof(I1)::type type; + typedef std::conditional_t<(sizeof(I1) type; }; /** \internal If the template parameter Value is Dynamic, this class is just a wrapper around a T variable that @@ -409,28 +409,28 @@ template struct plain_matrix_type_row_major template struct ref_selector { - typedef typename conditional< + typedef std::conditional_t< bool(traits::Flags & NestByRefBit), T const&, const T - >::type type; + > type; - typedef typename conditional< + typedef std::conditional_t< bool(traits::Flags & NestByRefBit), T &, T - >::type non_const_type; + > non_const_type; }; /** \internal Adds the const qualifier on the value-type of T2 if and only if T1 is a const type */ template struct transfer_constness { - typedef typename conditional< + typedef std::conditional_t< bool(internal::is_const::value), - typename internal::add_const_on_value_type::type, + add_const_on_value_type_t, T2 - >::type type; + > type; }; @@ -463,7 +463,7 @@ template Evaluate = (int(evaluator::Flags) & EvalBeforeNestingBit) || (int(CostEval) < int(CostNoEval)) }; - typedef typename conditional::type>::type type; + typedef std::conditional_t::type> type; }; template @@ -503,10 +503,10 @@ struct generic_xpr_base template struct cast_return_type { typedef typename XprType::Scalar CurrentScalarType; - typedef typename remove_all::type CastType_; + typedef remove_all_t CastType_; typedef typename CastType_::Scalar NewScalarType; - typedef typename conditional::value, - const XprType&,CastType>::type type; + typedef std::conditional_t::value, + const XprType&,CastType> type; }; template struct promote_storage_type; @@ -597,11 +597,11 @@ struct plain_row_type typedef Array ArrayRowType; - typedef typename conditional< + typedef std::conditional_t< is_same< typename traits::XprKind, MatrixXpr >::value, MatrixRowType, ArrayRowType - >::type type; + > type; }; template @@ -612,11 +612,11 @@ struct plain_col_type typedef Array ArrayColType; - typedef typename conditional< + typedef std::conditional_t< is_same< typename traits::XprKind, MatrixXpr >::value, MatrixColType, ArrayColType - >::type type; + > type; }; template @@ -629,11 +629,11 @@ struct plain_diag_type typedef Matrix MatrixDiagType; typedef Array ArrayDiagType; - typedef typename conditional< + typedef std::conditional_t< is_same< typename traits::XprKind, MatrixXpr >::value, MatrixDiagType, ArrayDiagType - >::type type; + > type; }; template @@ -647,7 +647,7 @@ struct plain_constant_type typedef Matrix::RowsAtCompileTime, traits::ColsAtCompileTime, Options, traits::MaxRowsAtCompileTime,traits::MaxColsAtCompileTime> matrix_type; - typedef CwiseNullaryOp, const typename conditional::XprKind, MatrixXpr >::value, matrix_type, array_type>::type > type; + typedef CwiseNullaryOp, const std::conditional_t::XprKind, MatrixXpr >::value, matrix_type, array_type> > type; }; template @@ -687,14 +687,14 @@ struct possibly_same_dense { template EIGEN_DEVICE_FUNC -bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if::value>::type * = 0) +bool is_same_dense(const T1 &mat1, const T2 &mat2, std::enable_if_t::value> * = 0) { return (mat1.data()==mat2.data()) && (mat1.innerStride()==mat2.innerStride()) && (mat1.outerStride()==mat2.outerStride()); } template EIGEN_DEVICE_FUNC -bool is_same_dense(const T1 &, const T2 &, typename enable_if::value>::type * = 0) +bool is_same_dense(const T1 &, const T2 &, std::enable_if_t::value> * = 0) { return false; } @@ -716,9 +716,9 @@ struct scalar_div_cost, Vectorized> { template -struct scalar_div_cost::type> { enum { value = 24 }; }; +struct scalar_div_cost> { enum { value = 24 }; }; template -struct scalar_div_cost::type> { enum { value = 21 }; }; +struct scalar_div_cost> { enum { value = 21 }; }; #ifdef EIGEN_DEBUG_ASSIGN @@ -807,12 +807,12 @@ struct ScalarBinaryOpTraits }; template -struct ScalarBinaryOpTraits::IsComplex,T>::type>::Real, BinaryOp> +struct ScalarBinaryOpTraits::IsComplex,T>>::Real, BinaryOp> { typedef T ReturnType; }; template -struct ScalarBinaryOpTraits::IsComplex,T>::type>::Real, T, BinaryOp> +struct ScalarBinaryOpTraits::IsComplex,T>>::Real, T, BinaryOp> { typedef T ReturnType; }; diff --git a/Eigen/src/Eigenvalues/HessenbergDecomposition.h b/Eigen/src/Eigenvalues/HessenbergDecomposition.h index 387c13aa5..fafab990e 100644 --- a/Eigen/src/Eigenvalues/HessenbergDecomposition.h +++ b/Eigen/src/Eigenvalues/HessenbergDecomposition.h @@ -84,7 +84,7 @@ template class HessenbergDecomposition typedef Matrix CoeffVectorType; /** \brief Return type of matrixQ() */ - typedef HouseholderSequence::type> HouseholderSequenceType; + typedef HouseholderSequence> HouseholderSequenceType; typedef internal::HessenbergDecompositionMatrixHReturnType MatrixHReturnType; diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h index be95093e8..9b002fe7b 100644 --- a/Eigen/src/Eigenvalues/Tridiagonalization.h +++ b/Eigen/src/Eigenvalues/Tridiagonalization.h @@ -85,21 +85,21 @@ template class Tridiagonalization typedef Matrix CoeffVectorType; typedef typename internal::plain_col_type::type DiagonalType; typedef Matrix SubDiagonalType; - typedef typename internal::remove_all::type MatrixTypeRealView; + typedef internal::remove_all_t MatrixTypeRealView; typedef internal::TridiagonalizationMatrixTReturnType MatrixTReturnType; - typedef typename internal::conditional::IsComplex, - typename internal::add_const_on_value_type::RealReturnType>::type, + typedef std::conditional_t::IsComplex, + internal::add_const_on_value_type_t::RealReturnType>, const Diagonal - >::type DiagonalReturnType; + > DiagonalReturnType; - typedef typename internal::conditional::IsComplex, - typename internal::add_const_on_value_type::RealReturnType>::type, + typedef std::conditional_t::IsComplex, + internal::add_const_on_value_type_t::RealReturnType>, const Diagonal - >::type SubDiagonalReturnType; + > SubDiagonalReturnType; /** \brief Return type of matrixQ() */ - typedef HouseholderSequence::type> HouseholderSequenceType; + typedef HouseholderSequence> HouseholderSequenceType; /** \brief Default constructor. * diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 215e5bbe2..538cf83e6 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -37,7 +37,7 @@ struct traits > { typedef typename traits::StorageKind StorageKind; typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNested_; + typedef std::remove_reference_t MatrixTypeNested_; enum { RowsPlusOne = (MatrixType::RowsAtCompileTime != Dynamic) ? int(MatrixType::RowsAtCompileTime) + 1 : Dynamic, @@ -227,7 +227,7 @@ template struct take_matrix_for_product > { typedef Transform TransformType; - typedef typename internal::add_const::type type; + typedef std::add_const_t type; EIGEN_DEVICE_FUNC static type run (const TransformType& x) { return x.affine(); } }; @@ -243,8 +243,8 @@ template struct traits,Lhs> > { typedef typename take_matrix_for_product::type LhsMatrixType; - typedef typename remove_all::type MatrixTypeCleaned; - typedef typename remove_all::type LhsMatrixTypeCleaned; + typedef remove_all_t MatrixTypeCleaned; + typedef remove_all_t LhsMatrixTypeCleaned; typedef typename make_proper_matrix_type< typename traits::Scalar, LhsMatrixTypeCleaned::RowsAtCompileTime, @@ -259,8 +259,8 @@ struct homogeneous_left_product_impl,Lhs> : public ReturnByValue,Lhs> > { typedef typename traits::LhsMatrixType LhsMatrixType; - typedef typename remove_all::type LhsMatrixTypeCleaned; - typedef typename remove_all::type LhsMatrixTypeNested; + typedef remove_all_t LhsMatrixTypeCleaned; + typedef remove_all_t LhsMatrixTypeNested; EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs) : m_lhs(take_matrix_for_product::run(lhs)), m_rhs(rhs) @@ -301,7 +301,7 @@ template struct homogeneous_right_product_impl,Rhs> : public ReturnByValue,Rhs> > { - typedef typename remove_all::type RhsNested; + typedef remove_all_t RhsNested; EIGEN_DEVICE_FUNC homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {} @@ -404,7 +404,7 @@ struct homogeneous_right_product_refactoring_helper Rows = Lhs::RowsAtCompileTime }; typedef typename Rhs::template ConstNRowsBlockXpr::Type LinearBlockConst; - typedef typename remove_const::type LinearBlock; + typedef std::remove_const_t LinearBlock; typedef typename Rhs::ConstRowXpr ConstantColumn; typedef Replicate ConstantBlock; typedef Product LinearProduct; @@ -457,7 +457,7 @@ struct homogeneous_left_product_refactoring_helper Cols = Rhs::ColsAtCompileTime }; typedef typename Lhs::template ConstNColsBlockXpr::Type LinearBlockConst; - typedef typename remove_const::type LinearBlock; + typedef std::remove_const_t LinearBlock; typedef typename Lhs::ConstColXpr ConstantColumn; typedef Replicate ConstantBlock; typedef Product LinearProduct; diff --git a/Eigen/src/Geometry/OrthoMethods.h b/Eigen/src/Geometry/OrthoMethods.h index 1b657b500..dc6a762f5 100644 --- a/Eigen/src/Geometry/OrthoMethods.h +++ b/Eigen/src/Geometry/OrthoMethods.h @@ -93,8 +93,8 @@ MatrixBase::cross3(const MatrixBase& other) const OtherDerivedNested rhs(other.derived()); return internal::cross3_impl::type, - typename internal::remove_all::type>::run(lhs,rhs); + internal::remove_all_t, + internal::remove_all_t>::run(lhs,rhs); } /** \geometry_module \ingroup Geometry_Module diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 52e8a81f0..0aca4c471 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -46,8 +46,8 @@ class QuaternionBase : public RotationBase typedef typename NumTraits::Real RealScalar; typedef typename internal::traits::Coefficients Coefficients; typedef typename Coefficients::CoeffReturnType CoeffReturnType; - typedef typename internal::conditional::Flags&LvalueBit), - Scalar&, CoeffReturnType>::type NonConstCoeffReturnType; + typedef std::conditional_t::Flags&LvalueBit), + Scalar&, CoeffReturnType> NonConstCoeffReturnType; enum { @@ -200,14 +200,14 @@ class QuaternionBase : public RotationBase template EIGEN_DEVICE_FUNC inline - typename internal::enable_if::value,const Derived&>::type cast() const + std::enable_if_t::value,const Derived&> cast() const { return derived(); } template EIGEN_DEVICE_FUNC inline - typename internal::enable_if::value,Quaternion >::type cast() const + std::enable_if_t::value,Quaternion > cast() const { return Quaternion(coeffs().template cast()); } diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index e147d8070..fd0ae7e6c 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -229,13 +229,13 @@ public: /** type of read reference to the linear part of the transformation */ typedef const Block ConstLinearPart; /** type of read/write reference to the affine part of the transformation */ - typedef typename internal::conditional >::type AffinePart; + Block > AffinePart; /** type of read reference to the affine part of the transformation */ - typedef typename internal::conditional >::type ConstAffinePart; + const Block > ConstAffinePart; /** type of a vector */ typedef Matrix VectorType; /** type of a read/write reference to the translation part of the rotation */ @@ -600,7 +600,7 @@ public: template EIGEN_DEVICE_FUNC inline Transform operator*(const RotationBase& r) const; - typedef typename internal::conditional::type RotationReturnType; + typedef std::conditional_t RotationReturnType; EIGEN_DEVICE_FUNC RotationReturnType rotation() const; template diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h index 7ad5afad4..dd0adbad6 100644 --- a/Eigen/src/Geometry/Translation.h +++ b/Eigen/src/Geometry/Translation.h @@ -133,7 +133,7 @@ public: /** Applies translation to vector */ template - inline typename internal::enable_if::type + inline std::enable_if_t operator* (const MatrixBase& vec) const { return m_coeffs + vec.derived(); } diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h index d35d319a6..08a8a6577 100644 --- a/Eigen/src/Householder/HouseholderSequence.h +++ b/Eigen/src/Householder/HouseholderSequence.h @@ -133,34 +133,34 @@ template class HouseholderS typedef typename internal::traits::Scalar Scalar; typedef HouseholderSequence< - typename internal::conditional::IsComplex, - typename internal::remove_all::type, - VectorsType>::type, - typename internal::conditional::IsComplex, - typename internal::remove_all::type, - CoeffsType>::type, + std::conditional_t::IsComplex, + internal::remove_all_t, + VectorsType>, + std::conditional_t::IsComplex, + internal::remove_all_t, + CoeffsType>, Side > ConjugateReturnType; typedef HouseholderSequence< VectorsType, - typename internal::conditional::IsComplex, - typename internal::remove_all::type, - CoeffsType>::type, + std::conditional_t::IsComplex, + internal::remove_all_t, + CoeffsType>, Side > AdjointReturnType; typedef HouseholderSequence< - typename internal::conditional::IsComplex, - typename internal::remove_all::type, - VectorsType>::type, + std::conditional_t::IsComplex, + internal::remove_all_t, + VectorsType>, CoeffsType, Side > TransposeReturnType; typedef HouseholderSequence< - typename internal::add_const::type, - typename internal::add_const::type, + std::add_const_t, + std::add_const_t, Side > ConstHouseholderSequence; @@ -257,10 +257,10 @@ template class HouseholderS */ template EIGEN_DEVICE_FUNC - inline typename internal::conditional::type + inline std::conditional_t conjugateIf() const { - typedef typename internal::conditional::type ReturnType; + typedef std::conditional_t ReturnType; return ReturnType(m_vectors.template conjugateIf(), m_coeffs.template conjugateIf()); } @@ -384,12 +384,12 @@ template class HouseholderS Index bs = end-k; Index start = k + m_shift; - typedef Block::type,Dynamic,Dynamic> SubVectorsType; + typedef Block,Dynamic,Dynamic> SubVectorsType; SubVectorsType sub_vecs1(m_vectors.const_cast_derived(), Side==OnTheRight ? k : start, Side==OnTheRight ? start : k, Side==OnTheRight ? bs : m_vectors.rows()-start, Side==OnTheRight ? m_vectors.cols()-start : bs); - typename internal::conditional, SubVectorsType&>::type sub_vecs(sub_vecs1); + std::conditional_t, SubVectorsType&> sub_vecs(sub_vecs1); Index dstStart = dst.rows()-rows()+m_shift+k; Index dstRows = rows()-m_shift-k; diff --git a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h index ce2b68823..b60f34dbf 100644 --- a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +++ b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h @@ -207,12 +207,12 @@ public: && (!MatrixType::IsRowMajor) && (!NumTraits::IsComplex) }; - typedef typename internal::conditional, ActualMatrixType const&>::type RowMajorWrapper; + typedef std::conditional_t, ActualMatrixType const&> RowMajorWrapper; EIGEN_STATIC_ASSERT(internal::check_implication(MatrixWrapper::MatrixFree,UpLo==(Lower|Upper)),MATRIX_FREE_CONJUGATE_GRADIENT_IS_COMPATIBLE_WITH_UPPER_UNION_LOWER_MODE_ONLY); - typedef typename internal::conditional::Type - >::type SelfAdjointWrapper; + typedef std::conditional_t::Type + > SelfAdjointWrapper; m_iterations = Base::maxIterations(); m_error = Base::m_tolerance; diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 8e294fc42..49829d018 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -42,7 +42,7 @@ public: template struct is_ref_compatible { - enum { value = is_ref_compatible_impl::type>::value }; + enum { value = is_ref_compatible_impl>::value }; }; template::value> @@ -369,7 +369,7 @@ public: } template - typename internal::enable_if::type + std::enable_if_t _solve_with_guess_impl(const Rhs& b, MatrixBase &aDest) const { eigen_assert(rows()==b.rows()); @@ -394,7 +394,7 @@ public: } template - typename internal::enable_if::type + std::enable_if_t _solve_with_guess_impl(const Rhs& b, MatrixBase &dest) const { derived()._solve_vector_with_guess_impl(b,dest.derived()); diff --git a/Eigen/src/Jacobi/Jacobi.h b/Eigen/src/Jacobi/Jacobi.h index d515a1f3f..852a38533 100644 --- a/Eigen/src/Jacobi/Jacobi.h +++ b/Eigen/src/Jacobi/Jacobi.h @@ -163,7 +163,7 @@ template EIGEN_DEVICE_FUNC void JacobiRotation::makeGivens(const Scalar& p, const Scalar& q, Scalar* r) { - makeGivens(p, q, r, typename internal::conditional::IsComplex, internal::true_type, internal::false_type>::type()); + makeGivens(p, q, r, std::conditional_t::IsComplex, internal::true_type, internal::false_type>()); } diff --git a/Eigen/src/LU/Determinant.h b/Eigen/src/LU/Determinant.h index cb5a6b9fc..80e695d12 100644 --- a/Eigen/src/LU/Determinant.h +++ b/Eigen/src/LU/Determinant.h @@ -111,7 +111,7 @@ inline typename internal::traits::Scalar MatrixBase::determina { eigen_assert(rows() == cols()); typedef typename internal::nested_eval::type Nested; - return internal::determinant_impl::type>::run(derived()); + return internal::determinant_impl>::run(derived()); } } // end namespace Eigen diff --git a/Eigen/src/LU/InverseImpl.h b/Eigen/src/LU/InverseImpl.h index 050737b1c..bcfe7031e 100644 --- a/Eigen/src/LU/InverseImpl.h +++ b/Eigen/src/LU/InverseImpl.h @@ -317,7 +317,7 @@ struct Assignment, internal::assign_op::type ActualXprType; - typedef typename internal::remove_all::type ActualXprTypeCleanded; + typedef internal::remove_all_t ActualXprTypeCleanded; ActualXprType actual_xpr(src.nestedExpression()); @@ -387,11 +387,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::conditional< + typedef std::conditional_t< RowsAtCompileTime == 2, - typename internal::remove_all::type>::type, + internal::remove_all_t::type>, PlainObject - >::type MatrixType; + > MatrixType; internal::compute_inverse_and_det_with_check::run (derived(), absDeterminantThreshold, inverse, determinant, invertible); } diff --git a/Eigen/src/LU/arch/InverseSize4.h b/Eigen/src/LU/arch/InverseSize4.h index 69f5e79e5..225a2fa82 100644 --- a/Eigen/src/LU/arch/InverseSize4.h +++ b/Eigen/src/LU/arch/InverseSize4.h @@ -50,7 +50,7 @@ struct compute_inverse_size4::Alignment, StorageOrdersMatch = (MatrixType::Flags & RowMajorBit) == (ResultType::Flags & RowMajorBit) }; - typedef typename conditional<(MatrixType::Flags & LinearAccessBit), MatrixType const &, typename MatrixType::PlainObject>::type ActualMatrixType; + typedef std::conditional_t<(MatrixType::Flags & LinearAccessBit), MatrixType const &, typename MatrixType::PlainObject> ActualMatrixType; static void run(const MatrixType &mat, ResultType &result) { @@ -175,9 +175,9 @@ struct compute_inverse_size4::Alignment, StorageOrdersMatch = (MatrixType::Flags & RowMajorBit) == (ResultType::Flags & RowMajorBit) }; - typedef typename conditional<(MatrixType::Flags & LinearAccessBit), - MatrixType const &, - typename MatrixType::PlainObject>::type + typedef std::conditional_t<(MatrixType::Flags & LinearAccessBit), + MatrixType const &, + typename MatrixType::PlainObject> ActualMatrixType; static void run(const MatrixType &mat, ResultType &result) diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h index dd5db97e1..fec53213a 100644 --- a/Eigen/src/QR/ColPivHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -69,7 +69,7 @@ template class ColPivHouseholderQR typedef typename internal::plain_row_type::type IntRowVectorType; typedef typename internal::plain_row_type::type RowVectorType; typedef typename internal::plain_row_type::type RealRowVectorType; - typedef HouseholderSequence::type> HouseholderSequenceType; + typedef HouseholderSequence> HouseholderSequenceType; typedef typename MatrixType::PlainObject PlainObject; private: diff --git a/Eigen/src/QR/CompleteOrthogonalDecomposition.h b/Eigen/src/QR/CompleteOrthogonalDecomposition.h index bfd46a5ee..bfaaa93ef 100644 --- a/Eigen/src/QR/CompleteOrthogonalDecomposition.h +++ b/Eigen/src/QR/CompleteOrthogonalDecomposition.h @@ -73,8 +73,8 @@ template class CompleteOrthogonalDecomposition typedef typename internal::plain_row_type::type RealRowVectorType; typedef HouseholderSequence< - MatrixType, typename internal::remove_all< - typename HCoeffsType::ConjugateReturnType>::type> + MatrixType, internal::remove_all_t< + typename HCoeffsType::ConjugateReturnType>> HouseholderSequenceType; typedef typename MatrixType::PlainObject PlainObject; diff --git a/Eigen/src/QR/HouseholderQR.h b/Eigen/src/QR/HouseholderQR.h index c55cac3d8..3a25c2840 100644 --- a/Eigen/src/QR/HouseholderQR.h +++ b/Eigen/src/QR/HouseholderQR.h @@ -72,7 +72,7 @@ template class HouseholderQR typedef Matrix MatrixQType; typedef typename internal::plain_diag_type::type HCoeffsType; typedef typename internal::plain_row_type::type RowVectorType; - typedef HouseholderSequence::type> HouseholderSequenceType; + typedef HouseholderSequence> HouseholderSequenceType; /** * \brief Default Constructor. diff --git a/Eigen/src/SVD/UpperBidiagonalization.h b/Eigen/src/SVD/UpperBidiagonalization.h index d4e72e5e4..e32a3cfe3 100644 --- a/Eigen/src/SVD/UpperBidiagonalization.h +++ b/Eigen/src/SVD/UpperBidiagonalization.h @@ -39,10 +39,10 @@ template class UpperBidiagonalization typedef Matrix SuperDiagVectorType; typedef HouseholderSequence< const MatrixType, - const typename internal::remove_all::ConjugateReturnType>::type + const internal::remove_all_t::ConjugateReturnType> > HouseholderUSequenceType; typedef HouseholderSequence< - const typename internal::remove_all::type, + const internal::remove_all_t, Diagonal, OnTheRight > HouseholderVSequenceType; diff --git a/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h b/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h index 6bd0fa1ec..f8524931f 100644 --- a/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +++ b/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h @@ -19,9 +19,9 @@ namespace internal { template static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res, bool sortedInsertion = false) { - typedef typename remove_all::type::Scalar LhsScalar; - typedef typename remove_all::type::Scalar RhsScalar; - typedef typename remove_all::type::Scalar ResScalar; + typedef typename remove_all_t::Scalar LhsScalar; + typedef typename remove_all_t::Scalar RhsScalar; + typedef typename remove_all_t::Scalar ResScalar; // make sure to call innerSize/outerSize since we fake the storage order. Index rows = lhs.innerSize(); @@ -140,7 +140,7 @@ struct conservative_sparse_sparse_product_selector; template struct conservative_sparse_sparse_product_selector { - typedef typename remove_all::type LhsCleaned; + typedef remove_all_t LhsCleaned; typedef typename LhsCleaned::Scalar Scalar; static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) @@ -214,7 +214,7 @@ struct conservative_sparse_sparse_product_selector struct conservative_sparse_sparse_product_selector { - typedef typename traits::type>::Scalar Scalar; + typedef typename traits>::Scalar Scalar; static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) { @@ -276,8 +276,8 @@ namespace internal { template static void sparse_sparse_to_dense_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res) { - typedef typename remove_all::type::Scalar LhsScalar; - typedef typename remove_all::type::Scalar RhsScalar; + typedef typename remove_all_t::Scalar LhsScalar; + typedef typename remove_all_t::Scalar RhsScalar; Index cols = rhs.outerSize(); eigen_assert(lhs.outerSize() == rhs.innerSize()); diff --git a/Eigen/src/SparseCore/SparseAssign.h b/Eigen/src/SparseCore/SparseAssign.h index bcd783ca4..63d69ad43 100644 --- a/Eigen/src/SparseCore/SparseAssign.h +++ b/Eigen/src/SparseCore/SparseAssign.h @@ -174,7 +174,7 @@ struct assignment_from_dense_op_sparse // Specialization for dense1 = sparse + dense2; -> dense1 = dense2; dense1 += sparse; template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::Shape,DenseShape>::value>::type + std::enable_if_t::Shape,DenseShape>::value> run(DstXprType &dst, const CwiseBinaryOp, const Lhs, const Rhs> &src, const internal::assign_op& /*func*/) { @@ -190,7 +190,7 @@ struct assignment_from_dense_op_sparse // Specialization for dense1 = sparse - dense2; -> dense1 = -dense2; dense1 += sparse; template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::Shape,DenseShape>::value>::type + std::enable_if_t::Shape,DenseShape>::value> run(DstXprType &dst, const CwiseBinaryOp, const Lhs, const Rhs> &src, const internal::assign_op& /*func*/) { @@ -208,8 +208,8 @@ struct assignment_from_dense_op_sparse template< typename DstXprType, typename Lhs, typename Rhs, typename Scalar> \ struct Assignment, const Lhs, const Rhs>, internal::ASSIGN_OP, \ Sparse2Dense, \ - typename internal::enable_if< internal::is_same::Shape,DenseShape>::value \ - || internal::is_same::Shape,DenseShape>::value>::type> \ + std::enable_if_t< internal::is_same::Shape,DenseShape>::value \ + || internal::is_same::Shape,DenseShape>::value>> \ : assignment_from_dense_op_sparse, internal::ASSIGN_OP2 > \ {} diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index 7e6dd0172..b3fc85919 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -19,7 +19,7 @@ template class BlockImpl : public SparseMatrixBase > { - typedef typename internal::remove_all::type MatrixTypeNested_; + typedef internal::remove_all_t MatrixTypeNested_; typedef Block BlockType; public: enum { IsRowMajor = internal::traits::IsRowMajor }; @@ -98,7 +98,7 @@ template class sparse_matrix_block_impl : public SparseCompressedBase > { - typedef typename internal::remove_all::type MatrixTypeNested_; + typedef internal::remove_all_t MatrixTypeNested_; typedef Block BlockType; typedef SparseCompressedBase > Base; using Base::convert_index; @@ -121,7 +121,7 @@ public: template inline BlockType& operator=(const SparseMatrixBase& other) { - typedef typename internal::remove_all::type NestedMatrixType_; + typedef internal::remove_all_t NestedMatrixType_; NestedMatrixType_& matrix = m_matrix; // This assignment is slow if this vector set is not empty // and/or it is not at the end of the nonzeros of the underlying matrix. @@ -342,7 +342,7 @@ public: enum { IsRowMajor = internal::traits::IsRowMajor }; EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) - typedef typename internal::remove_all::type MatrixTypeNested_; + typedef internal::remove_all_t MatrixTypeNested_; /** Column or Row constructor */ @@ -436,7 +436,7 @@ struct unary_evaluator, IteratorBa Flags = XprType::Flags }; - typedef typename internal::conditional::type InnerIterator; + typedef std::conditional_t InnerIterator; explicit unary_evaluator(const XprType& op) : m_argImpl(op.nestedExpression()), m_block(op) diff --git a/Eigen/src/SparseCore/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h index 6309a2025..9c0c53100 100644 --- a/Eigen/src/SparseCore/SparseDenseProduct.h +++ b/Eigen/src/SparseCore/SparseDenseProduct.h @@ -28,9 +28,9 @@ struct sparse_time_dense_product_impl; template struct sparse_time_dense_product_impl { - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; + typedef internal::remove_all_t Res; typedef typename evaluator::InnerIterator LhsInnerIterator; typedef evaluator LhsEval; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) @@ -95,9 +95,9 @@ struct sparse_time_dense_product_impl struct sparse_time_dense_product_impl { - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; + typedef internal::remove_all_t Res; typedef evaluator LhsEval; typedef typename LhsEval::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const AlphaType& alpha) @@ -119,9 +119,9 @@ struct sparse_time_dense_product_impl struct sparse_time_dense_product_impl { - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; + typedef internal::remove_all_t Res; typedef evaluator LhsEval; typedef typename LhsEval::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) @@ -159,9 +159,9 @@ struct sparse_time_dense_product_impl struct sparse_time_dense_product_impl { - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; + typedef internal::remove_all_t Lhs; + typedef internal::remove_all_t Rhs; + typedef internal::remove_all_t Res; typedef typename evaluator::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) { @@ -236,16 +236,16 @@ template struct sparse_dense_outer_product_evaluator { protected: - typedef typename conditional::type Lhs1; - typedef typename conditional::type ActualRhs; + typedef std::conditional_t Lhs1; + typedef std::conditional_t ActualRhs; typedef Product ProdXprType; // if the actual left-hand side is a dense vector, // then build a sparse-view so that we can seamlessly iterate over it. - typedef typename conditional::StorageKind,Sparse>::value, - Lhs1, SparseView >::type ActualLhs; - typedef typename conditional::StorageKind,Sparse>::value, - Lhs1 const&, SparseView >::type LhsArg; + typedef std::conditional_t::StorageKind,Sparse>::value, + Lhs1, SparseView > ActualLhs; + typedef std::conditional_t::StorageKind,Sparse>::value, + Lhs1 const&, SparseView > LhsArg; typedef evaluator LhsEval; typedef evaluator RhsEval; diff --git a/Eigen/src/SparseCore/SparseFuzzy.h b/Eigen/src/SparseCore/SparseFuzzy.h index 4b3911b96..dcfdde99e 100644 --- a/Eigen/src/SparseCore/SparseFuzzy.h +++ b/Eigen/src/SparseCore/SparseFuzzy.h @@ -19,9 +19,9 @@ template bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const { const typename internal::nested_eval::type actualA(derived()); - typename internal::conditional::type, - const PlainObject>::type actualB(other.derived()); + const PlainObject> actualB(other.derived()); return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); } diff --git a/Eigen/src/SparseCore/SparseMap.h b/Eigen/src/SparseCore/SparseMap.h index a73bd8d8d..a74baecc1 100644 --- a/Eigen/src/SparseCore/SparseMap.h +++ b/Eigen/src/SparseCore/SparseMap.h @@ -60,12 +60,12 @@ class SparseMapBase using Base::operator=; protected: - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - Scalar *, const Scalar *>::type ScalarPointer; - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - StorageIndex *, const StorageIndex *>::type IndexPointer; + typedef std::conditional_t< + bool(internal::is_lvalue::value), + Scalar *, const Scalar *> ScalarPointer; + typedef std::conditional_t< + bool(internal::is_lvalue::value), + StorageIndex *, const StorageIndex *> IndexPointer; Index m_outerSize; Index m_innerSize; diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index f681bc20b..5e0c178c5 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -67,7 +67,7 @@ struct traits, DiagIndex { typedef SparseMatrix MatrixType; typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type MatrixTypeNested_; + typedef std::remove_reference_t MatrixTypeNested_; typedef Scalar_ Scalar; typedef Dense StorageKind; @@ -1179,7 +1179,7 @@ EIGEN_DONT_INLINE SparseMatrix& SparseMatrix::type >::type OtherCopy; - typedef typename internal::remove_all::type OtherCopy_; + typedef internal::remove_all_t OtherCopy_; typedef internal::evaluator OtherCopyEval; OtherCopy otherCopy(other.derived()); OtherCopyEval otherCopyEval(otherCopy); diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index 8c8b66a9e..8222d263f 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h @@ -110,12 +110,12 @@ template class SparseMatrixBase }; /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::conditional::IsComplex, + typedef std::conditional_t::IsComplex, CwiseUnaryOp, Eigen::Transpose >, Transpose - >::type AdjointReturnType; + > AdjointReturnType; typedef Transpose TransposeReturnType; - typedef typename internal::add_const >::type ConstTransposeReturnType; + typedef std::add_const_t > ConstTransposeReturnType; // FIXME storage order do not match evaluator storage order typedef SparseMatrix PlainObject; @@ -131,7 +131,7 @@ template class SparseMatrixBase /** \internal the return type of coeff() */ - typedef typename internal::conditional::type CoeffReturnType; + typedef std::conditional_t CoeffReturnType; /** \internal Represents a matrix with all coefficients equal to one another*/ typedef CwiseNullaryOp,Matrix > ConstantReturnType; @@ -220,7 +220,7 @@ template class SparseMatrixBase friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m) { typedef typename Derived::Nested Nested; - typedef typename internal::remove_all::type NestedCleaned; + typedef internal::remove_all_t NestedCleaned; if (Flags&RowMajorBit) { diff --git a/Eigen/src/SparseCore/SparsePermutation.h b/Eigen/src/SparseCore/SparsePermutation.h index 17421b430..af9a1fea6 100644 --- a/Eigen/src/SparseCore/SparsePermutation.h +++ b/Eigen/src/SparseCore/SparsePermutation.h @@ -22,7 +22,7 @@ template struct permutation_matrix_product { typedef typename nested_eval::type MatrixType; - typedef typename remove_all::type MatrixTypeCleaned; + typedef remove_all_t MatrixTypeCleaned; typedef typename MatrixTypeCleaned::Scalar Scalar; typedef typename MatrixTypeCleaned::StorageIndex StorageIndex; @@ -32,9 +32,9 @@ struct permutation_matrix_product MoveOuter = SrcStorageOrder==RowMajor ? Side==OnTheLeft : Side==OnTheRight }; - typedef typename internal::conditional, - SparseMatrix >::type ReturnType; + SparseMatrix > ReturnType; template static inline void run(Dest& dst, const PermutationType& perm, const ExpressionType& xpr) diff --git a/Eigen/src/SparseCore/SparseProduct.h b/Eigen/src/SparseCore/SparseProduct.h index 4ac51746a..85a8a1032 100644 --- a/Eigen/src/SparseCore/SparseProduct.h +++ b/Eigen/src/SparseCore/SparseProduct.h @@ -47,19 +47,19 @@ struct generic_product_impl // dense += sparse * sparse template - static void addTo(Dest& dst, const ActualLhs& lhs, const Rhs& rhs, typename enable_if::Shape,DenseShape>::value,int*>::type* = 0) + static void addTo(Dest& dst, const ActualLhs& lhs, const Rhs& rhs, std::enable_if_t::Shape,DenseShape>::value,int*>* = 0) { typedef typename nested_eval::type LhsNested; typedef typename nested_eval::type RhsNested; LhsNested lhsNested(lhs); RhsNested rhsNested(rhs); - internal::sparse_sparse_to_dense_product_selector::type, - typename remove_all::type, Dest>::run(lhsNested,rhsNested,dst); + internal::sparse_sparse_to_dense_product_selector, + remove_all_t, Dest>::run(lhsNested,rhsNested,dst); } // dense -= sparse * sparse template - static void subTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, typename enable_if::Shape,DenseShape>::value,int*>::type* = 0) + static void subTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, std::enable_if_t::Shape,DenseShape>::value,int*>* = 0) { addTo(dst, -lhs, rhs); } @@ -74,8 +74,8 @@ protected: typedef typename nested_eval::type RhsNested; LhsNested lhsNested(lhs); RhsNested rhsNested(rhs); - internal::conservative_sparse_sparse_product_selector::type, - typename remove_all::type, Dest>::run(lhsNested,rhsNested,dst); + internal::conservative_sparse_sparse_product_selector, + remove_all_t, Dest>::run(lhsNested,rhsNested,dst); } // dense = sparse * sparse @@ -155,8 +155,8 @@ struct unary_evaluator >, IteratorBased> LhsNested lhsNested(xpr.nestedExpression().lhs()); RhsNested rhsNested(xpr.nestedExpression().rhs()); - internal::sparse_sparse_product_with_pruning_selector::type, - typename remove_all::type, PlainObject>::run(lhsNested,rhsNested,m_result, + internal::sparse_sparse_product_with_pruning_selector, + remove_all_t, PlainObject>::run(lhsNested,rhsNested,m_result, abs(xpr.reference())*xpr.epsilon()); } diff --git a/Eigen/src/SparseCore/SparseRef.h b/Eigen/src/SparseCore/SparseRef.h index 5064908d9..9e69d93ef 100644 --- a/Eigen/src/SparseCore/SparseRef.h +++ b/Eigen/src/SparseCore/SparseRef.h @@ -37,7 +37,7 @@ struct traits, Options_, StrideT StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)), MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && StorageOrderMatch }; - typedef typename internal::conditional::type type; + typedef std::conditional_t type; }; }; @@ -65,7 +65,7 @@ struct traits, Options_, StrideT enum { MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && Derived::IsVectorAtCompileTime }; - typedef typename internal::conditional::type type; + typedef std::conditional_t type; }; }; diff --git a/Eigen/src/SparseCore/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h index a4bbc88a1..211506e9c 100644 --- a/Eigen/src/SparseCore/SparseSelfAdjointView.h +++ b/Eigen/src/SparseCore/SparseSelfAdjointView.h @@ -59,7 +59,7 @@ template class SparseSelfAdjointView typedef typename MatrixType::StorageIndex StorageIndex; typedef Matrix VectorI; typedef typename internal::ref_selector::non_const_type MatrixTypeNested; - typedef typename internal::remove_all::type MatrixTypeNested_; + typedef internal::remove_all_t MatrixTypeNested_; explicit inline SparseSelfAdjointView(MatrixType& matrix) : m_matrix(matrix) { @@ -71,7 +71,7 @@ template class SparseSelfAdjointView /** \internal \returns a reference to the nested matrix */ const MatrixTypeNested_& matrix() const { return m_matrix; } - typename internal::remove_reference::type& matrix() { return m_matrix; } + std::remove_reference_t& matrix() { return m_matrix; } /** \returns an expression of the matrix product between a sparse self-adjoint matrix \c *this and a sparse matrix \a rhs. * @@ -278,7 +278,7 @@ inline void sparse_selfadjoint_time_dense_product(const SparseLhsType& lhs, cons EIGEN_ONLY_USED_FOR_DEBUG(alpha); typedef typename internal::nested_eval::type SparseLhsTypeNested; - typedef typename internal::remove_all::type SparseLhsTypeNestedCleaned; + typedef internal::remove_all_t SparseLhsTypeNestedCleaned; typedef evaluator LhsEval; typedef typename LhsEval::InnerIterator LhsIterator; typedef typename SparseLhsType::Scalar LhsScalar; @@ -604,7 +604,7 @@ class SparseSymmetricPermutationProduct public: typedef Matrix VectorI; typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; SparseSymmetricPermutationProduct(const MatrixType& mat, const Perm& perm) : m_matrix(mat), m_perm(perm) diff --git a/Eigen/src/SparseCore/SparseSolverBase.h b/Eigen/src/SparseCore/SparseSolverBase.h index 7290bc6c6..8261fb5c6 100644 --- a/Eigen/src/SparseCore/SparseSolverBase.h +++ b/Eigen/src/SparseCore/SparseSolverBase.h @@ -21,7 +21,7 @@ namespace internal { * The rhs is decomposed into small vertical panels which are solved through dense temporaries. */ template -typename enable_if::type +std::enable_if_t solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest &dest) { EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); @@ -45,7 +45,7 @@ solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest // Overload for vector as rhs template -typename enable_if::type +std::enable_if_t solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest &dest) { typedef typename Dest::Scalar DestScalar; diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index efa0a9cf0..ee0ec1bac 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -23,9 +23,9 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r { // return sparse_sparse_product_with_pruning_impl2(lhs,rhs,res); - typedef typename remove_all::type::Scalar RhsScalar; - typedef typename remove_all::type::Scalar ResScalar; - typedef typename remove_all::type::StorageIndex StorageIndex; + typedef typename remove_all_t::Scalar RhsScalar; + typedef typename remove_all_t::Scalar ResScalar; + typedef typename remove_all_t::StorageIndex StorageIndex; // make sure to call innerSize/outerSize since we fake the storage order. Index rows = lhs.innerSize(); @@ -92,7 +92,7 @@ struct sparse_sparse_product_with_pruning_selector::type _res(res.rows(), res.cols()); + remove_all_t _res(res.rows(), res.cols()); internal::sparse_sparse_product_with_pruning_impl(lhs, rhs, _res, tolerance); res.swap(_res); } @@ -119,7 +119,7 @@ struct sparse_sparse_product_with_pruning_selector::type _res(res.rows(), res.cols()); + remove_all_t _res(res.rows(), res.cols()); internal::sparse_sparse_product_with_pruning_impl(rhs, lhs, _res, tolerance); res.swap(_res); } diff --git a/Eigen/src/SparseCore/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h index 76ff97ada..5e7cea7bd 100644 --- a/Eigen/src/SparseCore/SparseTriangularView.h +++ b/Eigen/src/SparseCore/SparseTriangularView.h @@ -46,8 +46,8 @@ template class TriangularViewImpl::type MatrixTypeNestedNonRef; - typedef typename internal::remove_all::type MatrixTypeNestedCleaned; + typedef std::remove_reference_t MatrixTypeNestedNonRef; + typedef internal::remove_all_t MatrixTypeNestedCleaned; template EIGEN_DEVICE_FUNC diff --git a/Eigen/src/SparseCore/SparseView.h b/Eigen/src/SparseCore/SparseView.h index 6666fa75a..dbb4c434a 100644 --- a/Eigen/src/SparseCore/SparseView.h +++ b/Eigen/src/SparseCore/SparseView.h @@ -47,11 +47,11 @@ template class SparseView : public SparseMatrixBase > { typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename internal::remove_all::type MatrixTypeNested_; + typedef internal::remove_all_t MatrixTypeNested_; typedef SparseMatrixBase Base; public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) - typedef typename internal::remove_all::type NestedExpression; + typedef internal::remove_all_t NestedExpression; explicit SparseView(const MatrixType& mat, const Scalar& reference = Scalar(0), const RealScalar &epsilon = NumTraits::dummy_precision()) @@ -64,7 +64,7 @@ public: inline Index outerSize() const { return m_matrix.outerSize(); } /** \returns the nested expression */ - const typename internal::remove_all::type& + const internal::remove_all_t& nestedExpression() const { return m_matrix; } Scalar reference() const { return m_reference; } diff --git a/Eigen/src/SparseCore/TriangularSolver.h b/Eigen/src/SparseCore/TriangularSolver.h index 73e2a7987..79c867c25 100644 --- a/Eigen/src/SparseCore/TriangularSolver.h +++ b/Eigen/src/SparseCore/TriangularSolver.h @@ -184,11 +184,11 @@ void TriangularViewImpl::solveInPlace(MatrixBase::Flags & RowMajorBit }; - typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; + typedef std::conditional_t::type, OtherDerived&> OtherCopy; OtherCopy otherCopy(other.derived()); - internal::sparse_solve_triangular_selector::type, Mode>::run(derived().nestedExpression(), otherCopy); + internal::sparse_solve_triangular_selector, Mode>::run(derived().nestedExpression(), otherCopy); if (copy) other = otherCopy; @@ -301,8 +301,8 @@ void TriangularViewImpl::solveInPlace(SparseMatrixBa // enum { copy = internal::traits::Flags & RowMajorBit }; -// typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; +// typedef std::conditional_t::type, OtherDerived&> OtherCopy; // OtherCopy otherCopy(other.derived()); internal::sparse_solve_triangular_sparse_selector::run(derived().nestedExpression(), other.derived()); diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index d3a904d80..f8250921b 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -323,7 +323,7 @@ void SparseQR::analyzePattern(const MatrixType& mat) { eigen_assert(mat.isCompressed() && "SparseQR requires a sparse matrix in compressed mode. Call .makeCompressed() before passing it to SparseQR"); // Copy to a column major matrix if the input is rowmajor - typename internal::conditional::type matCpy(mat); + std::conditional_t matCpy(mat); // Compute the column fill reducing ordering OrderingType ord; ord(matCpy, m_perm_c); diff --git a/Eigen/src/StlSupport/details.h b/Eigen/src/StlSupport/details.h index 2cfd13e03..1bb5f2cd7 100644 --- a/Eigen/src/StlSupport/details.h +++ b/Eigen/src/StlSupport/details.h @@ -52,11 +52,11 @@ namespace Eigen { // in std::vector::resize(size_t s,T x) won't be aligned and generate an error // even if this function is never called. Whence this little wrapper. #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) \ - typename Eigen::internal::conditional< \ + Eigen::std::conditional_t< \ Eigen::internal::is_arithmetic::value, \ T, \ Eigen::internal::workaround_msvc_stl_support \ - >::type + > namespace internal { template struct workaround_msvc_stl_support : public T diff --git a/Eigen/src/plugins/BlockMethods.h b/Eigen/src/plugins/BlockMethods.h index 63a52a6ff..68b94130b 100644 --- a/Eigen/src/plugins/BlockMethods.h +++ b/Eigen/src/plugins/BlockMethods.h @@ -1418,19 +1418,19 @@ innerVectors(Index outerStart, Index outerSize) const */ template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE -typename internal::conditional::type +std::conditional_t subVector(Index i) { - return typename internal::conditional::type(derived(),i); + return std::conditional_t(derived(),i); } /** This is the const version of subVector(Index) */ template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE -typename internal::conditional::type +std::conditional_t subVector(Index i) const { - return typename internal::conditional::type(derived(),i); + return std::conditional_t(derived(),i); } /** \returns the number of subvectors (rows or columns) in the direction \c Direction diff --git a/Eigen/src/plugins/CommonCwiseUnaryOps.h b/Eigen/src/plugins/CommonCwiseUnaryOps.h index 5418dc415..390759cd0 100644 --- a/Eigen/src/plugins/CommonCwiseUnaryOps.h +++ b/Eigen/src/plugins/CommonCwiseUnaryOps.h @@ -13,20 +13,20 @@ #ifndef EIGEN_PARSED_BY_DOXYGEN /** \internal the return type of conjugate() */ -typedef typename internal::conditional::IsComplex, - const CwiseUnaryOp, const Derived>, - const Derived& - >::type ConjugateReturnType; +typedef std::conditional_t::IsComplex, + const CwiseUnaryOp, const Derived>, + const Derived& + > ConjugateReturnType; /** \internal the return type of real() const */ -typedef typename internal::conditional::IsComplex, - const CwiseUnaryOp, const Derived>, - const Derived& - >::type RealReturnType; +typedef std::conditional_t::IsComplex, + const CwiseUnaryOp, const Derived>, + const Derived& + > RealReturnType; /** \internal the return type of real() */ -typedef typename internal::conditional::IsComplex, - CwiseUnaryView, Derived>, - Derived& - >::type NonConstRealReturnType; +typedef std::conditional_t::IsComplex, + CwiseUnaryView, Derived>, + Derived& + > NonConstRealReturnType; /** \internal the return type of imag() const */ typedef CwiseUnaryOp, const Derived> ImagReturnType; /** \internal the return type of imag() */ @@ -83,10 +83,10 @@ EIGEN_DOC_UNARY_ADDONS(conjugate,complex conjugate) /// \sa conjugate() template EIGEN_DEVICE_FUNC -inline typename internal::conditional::type +inline std::conditional_t conjugateIf() const { - typedef typename internal::conditional::type ReturnType; + typedef std::conditional_t ReturnType; return ReturnType(derived()); } diff --git a/Eigen/src/plugins/IndexedViewMethods.h b/Eigen/src/plugins/IndexedViewMethods.h index 8b97c98cc..011fcbed7 100644 --- a/Eigen/src/plugins/IndexedViewMethods.h +++ b/Eigen/src/plugins/IndexedViewMethods.h @@ -67,9 +67,9 @@ struct EIGEN_INDEXED_VIEW_METHOD_TYPE { // This is the generic version template -typename internal::enable_if::value +std::enable_if_t::value && internal::traits::type>::ReturnAsIndexedView, - typename EIGEN_INDEXED_VIEW_METHOD_TYPE::type >::type + typename EIGEN_INDEXED_VIEW_METHOD_TYPE::type> operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST { return typename EIGEN_INDEXED_VIEW_METHOD_TYPE::type @@ -79,9 +79,9 @@ operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_IND // The following overload returns a Block<> object template -typename internal::enable_if::value +std::enable_if_t::value && internal::traits::type>::ReturnAsBlock, - typename internal::traits::type>::BlockType>::type + typename internal::traits::type>::BlockType> operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST { typedef typename internal::traits::type>::BlockType BlockType; @@ -97,9 +97,9 @@ operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_IND // The following overload returns a Scalar template -typename internal::enable_if::value +std::enable_if_t::value && internal::traits::type>::ReturnAsScalar, - CoeffReturnType >::type + CoeffReturnType > operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST { return Base::operator()(internal::eval_expr_given_size(rowIndices,rows()),internal::eval_expr_given_size(colIndices,cols())); @@ -135,9 +135,9 @@ operator()(const RowIndicesT (&rowIndices)[RowIndicesN], const ColIndicesT (&col // Overloads for 1D vectors/arrays template -typename internal::enable_if< +std::enable_if_t< IsRowMajor && (!(internal::get_compile_time_incr::type>::value==1 || internal::is_valid_index_type::value)), - IndexedView::type> >::type + IndexedView::type> > operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) @@ -146,9 +146,9 @@ operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST } template -typename internal::enable_if< +std::enable_if_t< (!IsRowMajor) && (!(internal::get_compile_time_incr::type>::value==1 || internal::is_valid_index_type::value)), - IndexedView::type,IvcIndex> >::type + IndexedView::type,IvcIndex> > operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) @@ -157,9 +157,9 @@ operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST } template -typename internal::enable_if< +std::enable_if_t< (internal::get_compile_time_incr::type>::value==1) && (!internal::is_valid_index_type::value) && (!symbolic::is_symbolic::value), - VectorBlock::value> >::type + VectorBlock::value> > operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) @@ -169,15 +169,15 @@ operator()(const Indices& indices) EIGEN_INDEXED_VIEW_METHOD_CONST } template -typename internal::enable_if::value, CoeffReturnType >::type +std::enable_if_t::value, CoeffReturnType > operator()(const IndexType& id) EIGEN_INDEXED_VIEW_METHOD_CONST { return Base::operator()(internal::eval_expr_given_size(id,size())); } template -typename internal::enable_if >::type +std::enable_if_t > operator()(const IndicesT (&indices)[IndicesN]) EIGEN_INDEXED_VIEW_METHOD_CONST { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) @@ -186,8 +186,8 @@ operator()(const IndicesT (&indices)[IndicesN]) EIGEN_INDEXED_VIEW_METHOD_CONST } template -typename internal::enable_if >::type +std::enable_if_t > operator()(const IndicesT (&indices)[IndicesN]) EIGEN_INDEXED_VIEW_METHOD_CONST { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) diff --git a/blas/BandTriangularSolver.h b/blas/BandTriangularSolver.h index ce2d74daa..e8551cd33 100644 --- a/blas/BandTriangularSolver.h +++ b/blas/BandTriangularSolver.h @@ -29,11 +29,9 @@ struct band_solve_triangular_selector(lhsStride)); RhsMap other(_other,size,1); - typename internal::conditional< - ConjLhs, - const CwiseUnaryOp,LhsMap>, - const LhsMap&> - ::type cjLhs(lhs); + std::conditional_t,LhsMap>, + const LhsMap&> cjLhs(lhs); for(int col=0 ; col(lhsStride)); RhsMap other(_other,size,1); - typename internal::conditional< - ConjLhs, - const CwiseUnaryOp,LhsMap>, - const LhsMap&> - ::type cjLhs(lhs); + std::conditional_t,LhsMap>, + const LhsMap&> cjLhs(lhs); for(int col=0 ; col::type* ret = new Scalar[n]; + std::remove_const_t* ret = new Scalar[n]; if(incx<0) make_vector(ret,n) = make_vector(x,n,-incx).reverse(); else make_vector(ret,n) = make_vector(x,n, incx); return ret; diff --git a/doc/examples/make_circulant.cpp.evaluator b/doc/examples/make_circulant.cpp.evaluator index 2ba79e783..cd461b9d3 100644 --- a/doc/examples/make_circulant.cpp.evaluator +++ b/doc/examples/make_circulant.cpp.evaluator @@ -6,7 +6,7 @@ namespace Eigen { { typedef Circulant XprType; typedef typename nested_eval::type ArgTypeNested; - typedef typename remove_all::type ArgTypeNestedCleaned; + typedef remove_all_t ArgTypeNestedCleaned; typedef typename XprType::CoeffReturnType CoeffReturnType; enum { diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 14ecb7298..47dfc0469 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -11,14 +11,14 @@ #include "random_without_cast_overflow.h" template -typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void>::type +std::enable_if_t<(MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1),void> check_index(const MatrixType& m) { VERIFY_RAISES_ASSERT(m[0]); VERIFY_RAISES_ASSERT((m+m)[0]); } template -typename internal::enable_if::type +std::enable_if_t check_index(const MatrixType& /*unused*/) {} template void basicStuff(const MatrixType& m) @@ -241,7 +241,7 @@ struct casting_test_runner { }; template -struct casting_test_runner::IsComplex)>::type> +struct casting_test_runner::IsComplex)>> { static void run() { // Only a few casts from std::complex are defined. diff --git a/test/block.cpp b/test/block.cpp index a2396d1a9..f8583c330 100644 --- a/test/block.cpp +++ b/test/block.cpp @@ -10,7 +10,7 @@ #include "main.h" template -typename Eigen::internal::enable_if::IsComplex,typename MatrixType::Scalar>::type +std::enable_if_t::IsComplex,typename MatrixType::Scalar> block_real_only(const MatrixType &m1, Index r1, Index r2, Index c1, Index c2, const Scalar& s1) { // check cwise-Functions: VERIFY_IS_APPROX(m1.row(r1).cwiseMax(s1), m1.cwiseMax(s1).row(r1)); @@ -23,28 +23,28 @@ block_real_only(const MatrixType &m1, Index r1, Index r2, Index c1, Index c2, co } template -typename Eigen::internal::enable_if::IsComplex,typename MatrixType::Scalar>::type +std::enable_if_t::IsComplex,typename MatrixType::Scalar> block_real_only(const MatrixType &, Index, Index, Index, Index, const Scalar&) { return Scalar(0); } // Check at compile-time that T1==T2, and at runtime-time that a==b template -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> is_same_block(const T1& a, const T2& b) { return a.isApprox(b); } template -typename internal::enable_if<((MatrixType::Flags&RowMajorBit)==0),void>::type +std::enable_if_t<((MatrixType::Flags&RowMajorBit)==0),void> check_left_top(const MatrixType& m, Index r, Index c, Index rows, Index /*unused*/) { VERIFY_IS_EQUAL(m.leftCols(c).coeff(r+c*rows), m(r,c)); } template -typename internal::enable_if<((MatrixType::Flags&RowMajorBit)!=0),void>::type +std::enable_if_t<((MatrixType::Flags&RowMajorBit)!=0),void> check_left_top(const MatrixType& m, Index r, Index c, Index /*unused*/, Index cols) { VERIFY_IS_EQUAL(m.topRows(r).coeff(c+r*cols), m(r,c)); @@ -243,7 +243,7 @@ template void block(const MatrixType& m) template -typename internal::enable_if::type +std::enable_if_t compare_using_data_and_stride(const MatrixType& m) { Index rows = m.rows(); @@ -264,7 +264,7 @@ compare_using_data_and_stride(const MatrixType& m) } template -typename internal::enable_if::type +std::enable_if_t compare_using_data_and_stride(const MatrixType& m) { Index rows = m.rows(); diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 34404c2a4..a821cf21d 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -286,7 +286,7 @@ template void check_const_correctness(const PlainObjec // CMake can help with that. // verify that map-to-const don't have LvalueBit - typedef typename internal::add_const::type ConstPlainObjectType; + typedef std::add_const_t ConstPlainObjectType; VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(Map::Flags & LvalueBit) ); diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h index 2c5a46b18..0942466da 100644 --- a/test/gpu_test_helper.h +++ b/test/gpu_test_helper.h @@ -66,7 +66,7 @@ struct extract_output_indices_helper::value - && !std::is_const::type>::value, + && !std::is_const>::value, std::index_sequence, std::index_sequence >::type, Ts...>::type; @@ -95,8 +95,8 @@ struct void_helper { template static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC auto call(Func&& func, Args&&... args) -> - typename std::enable_if::value, - decltype(func(args...))>::type { + std::enable_if_t::value, + decltype(func(args...))> { return func(std::forward(args)...); } @@ -104,8 +104,8 @@ struct void_helper { template static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC auto call(Func&& func, Args&&... args) -> - typename std::enable_if::value, - Void>::type { + std::enable_if_t::value, + Void> { func(std::forward(args)...); return Void{}; } @@ -113,7 +113,7 @@ struct void_helper { // Restores the original return type, Void -> void, T otherwise. template static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC - typename std::enable_if::type, Void>::value, T>::type + std::enable_if_t::type, Void>::value, T> restore(T&& val) { return val; } diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 864d8b009..d14996066 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -40,7 +40,7 @@ bool match(const T& xpr, std::string ref, std::string str_xpr = "") { #define MATCH(X,R) match(X, R, #X) template -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> is_same_eq(const T1& a, const T2& b) { return (a == b).all(); @@ -59,7 +59,7 @@ bool is_same_seq(const T1& a, const T2& b) } template -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> is_same_seq_type(const T1& a, const T2& b) { return is_same_seq(a,b); diff --git a/test/inverse.cpp b/test/inverse.cpp index 9cedfa1e1..2748c3806 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -12,12 +12,12 @@ #include template -void inverse_for_fixed_size(const MatrixType&, typename internal::enable_if::type* = 0) +void inverse_for_fixed_size(const MatrixType&, std::enable_if_t* = 0) { } template -void inverse_for_fixed_size(const MatrixType& m1, typename internal::enable_if::type* = 0) +void inverse_for_fixed_size(const MatrixType& m1, std::enable_if_t* = 0) { using std::abs; diff --git a/test/main.h b/test/main.h index 87ffa8795..dd46c0047 100644 --- a/test/main.h +++ b/test/main.h @@ -408,7 +408,7 @@ bool test_is_equal(const T& actual, const U& expected, bool expect_equal=true); namespace Eigen { template -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> is_same_type(const T1&, const T2&) { return true; @@ -547,7 +547,7 @@ typename T1::RealScalar test_relative_error(const SparseMatrixBase &a, const } template -typename NumTraits::Real>::NonInteger test_relative_error(const T1 &a, const T2 &b, typename internal::enable_if::Real>::value, T1>::type* = 0) +typename NumTraits::Real>::NonInteger test_relative_error(const T1 &a, const T2 &b, std::enable_if_t::Real>::value, T1>* = 0) { typedef typename NumTraits::Real>::NonInteger RealScalar; return numext::sqrt(RealScalar(numext::abs2(a-b))/(numext::mini)(RealScalar(numext::abs2(a)),RealScalar(numext::abs2(b)))); @@ -579,7 +579,7 @@ typename NumTraits::Real get_test_precision(const T&, const } template -typename NumTraits::Real get_test_precision(const T&,typename internal::enable_if::Real>::value, T>::type* = 0) +typename NumTraits::Real get_test_precision(const T&,std::enable_if_t::Real>::value, T>* = 0) { return test_precision::Real>(); } diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp index 1b576b0e4..b5a13bff1 100644 --- a/test/mapped_matrix.cpp +++ b/test/mapped_matrix.cpp @@ -146,7 +146,7 @@ template void check_const_correctness(const PlainObjec // CMake can help with that. // verify that map-to-const don't have LvalueBit - typedef typename internal::add_const::type ConstPlainObjectType; + typedef std::add_const_t ConstPlainObjectType; VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(Map::Flags & LvalueBit) ); diff --git a/test/meta.cpp b/test/meta.cpp index d362c9f8f..cac7af103 100644 --- a/test/meta.cpp +++ b/test/meta.cpp @@ -29,47 +29,28 @@ struct MyImpl : public MyInterface { EIGEN_DECLARE_TEST(meta) { - 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 >::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)); - - // test add_const - VERIFY(( internal::is_same< internal::add_const::type, const float >::value)); - VERIFY(( internal::is_same< internal::add_const::type, float* const>::value)); - VERIFY(( internal::is_same< internal::add_const::type, float const* const>::value)); - VERIFY(( internal::is_same< internal::add_const::type, float& >::value)); - - // test remove_const - VERIFY(( internal::is_same< internal::remove_const::type, float const* >::value)); - VERIFY(( internal::is_same< internal::remove_const::type, float const* >::value)); - VERIFY(( internal::is_same< internal::remove_const::type, float* >::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 >::value)); + VERIFY(( internal::is_same >::value)); + VERIFY(( internal::is_same >::value)); // test add_const_on_value_type - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, float const& >::value)); - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, float const* >::value)); + VERIFY(( internal::is_same< internal::add_const_on_value_type_t, float const& >::value)); + VERIFY(( internal::is_same< internal::add_const_on_value_type_t, float const* >::value)); - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, const float >::value)); - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, const float >::value)); - - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, const float* const>::value)); - VERIFY(( internal::is_same< internal::add_const_on_value_type::type, const float* const>::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< internal::add_const_on_value_type_t, const float >::value)); + VERIFY(( internal::is_same< internal::add_const_on_value_type_t, const float >::value)); + VERIFY(( internal::is_same< internal::add_const_on_value_type_t, const float* const>::value)); + VERIFY(( internal::is_same< internal::add_const_on_value_type_t, const float* const>::value)); // is_convertible STATIC_CHECK(( internal::is_convertible::value )); diff --git a/test/nesting_ops.cpp b/test/nesting_ops.cpp index 4b5fc21f2..13509947a 100644 --- a/test/nesting_ops.cpp +++ b/test/nesting_ops.cpp @@ -27,7 +27,7 @@ template bool verify_eval_type(const XprType &, const ReferenceType&) { typedef typename internal::nested_eval::type EvalType; - return internal::is_same::type, typename internal::remove_all::type>::value; + return internal::is_same, internal::remove_all_t>::value; } template void run_nesting_ops_1(const MatrixType& _m) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 081e59475..2d8e70871 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -265,7 +265,7 @@ struct packetmath_pcast_ops_runner { // Only some types support cast from std::complex<>. template -struct packetmath_pcast_ops_runner::IsComplex>::type> { +struct packetmath_pcast_ops_runner::IsComplex>> { static void run() { test_cast_runner >::run(); test_cast_runner >::run(); @@ -404,11 +404,11 @@ struct eigen_optimization_barrier_test { }; template -struct eigen_optimization_barrier_test::IsComplex && !internal::is_same::value && !internal::is_same::value - >::type> { + >> { static void run() { typedef typename internal::unpacket_traits::type Scalar; Scalar s = internal::random(); diff --git a/test/product.h b/test/product.h index 0477d776e..a4d859166 100644 --- a/test/product.h +++ b/test/product.h @@ -18,13 +18,13 @@ bool areNotApprox(const MatrixBase& m1, const MatrixBase& m2 } template -typename internal::enable_if::type +std::enable_if_t check_mismatched_product(LhsType& lhs, const RhsType& rhs) { VERIFY_RAISES_ASSERT(lhs = rhs*rhs); } template -typename internal::enable_if::type +std::enable_if_t check_mismatched_product(LhsType& /*unused*/, const RhsType& /*unused*/) { } diff --git a/test/product_small.cpp b/test/product_small.cpp index 8c56ea5d3..c1d99436f 100644 --- a/test/product_small.cpp +++ b/test/product_small.cpp @@ -40,12 +40,12 @@ const TC& ref_prod(TC &C, const TA &A, const TB &B) } template -typename internal::enable_if::type + || (Cols ==1&&Rows !=1&&OC==RowMajor)),void> test_lazy_single(int rows, int cols, int depth) { Matrix A(rows,depth); A.setRandom(); @@ -80,12 +80,12 @@ void test_dynamic_bool() } template -typename internal::enable_if< ( (Rows ==1&&Depth!=1&&OA==ColMajor) +std::enable_if_t< ( (Rows ==1&&Depth!=1&&OA==ColMajor) || (Depth==1&&Rows !=1&&OA==RowMajor) || (Cols ==1&&Depth!=1&&OB==RowMajor) || (Depth==1&&Cols !=1&&OB==ColMajor) || (Rows ==1&&Cols !=1&&OC==ColMajor) - || (Cols ==1&&Rows !=1&&OC==RowMajor)),void>::type + || (Cols ==1&&Rows !=1&&OC==RowMajor)),void> test_lazy_single(int, int, int) { } diff --git a/test/random_without_cast_overflow.h b/test/random_without_cast_overflow.h index 000345110..7f1ea5ff3 100644 --- a/test/random_without_cast_overflow.h +++ b/test/random_without_cast_overflow.h @@ -23,11 +23,11 @@ struct random_without_cast_overflow { template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsInteger && NumTraits::IsInteger && - !NumTraits::IsSigned && - (std::numeric_limits::digits < std::numeric_limits::digits || - (std::numeric_limits::digits == std::numeric_limits::digits && - NumTraits::IsSigned))>::type> { + std::enable_if_t::IsInteger && NumTraits::IsInteger && + !NumTraits::IsSigned && + (std::numeric_limits::digits < std::numeric_limits::digits || + (std::numeric_limits::digits == std::numeric_limits::digits && + NumTraits::IsSigned))>> { static SrcScalar value() { SrcScalar a = internal::random(); return a < SrcScalar(0) ? -(a + 1) : a; @@ -38,9 +38,9 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if< + std::enable_if_t< NumTraits::IsInteger && NumTraits::IsInteger && !NumTraits::IsSigned && - (std::numeric_limits::digits > std::numeric_limits::digits)>::type> { + (std::numeric_limits::digits > std::numeric_limits::digits)>> { static SrcScalar value() { TgtScalar b = internal::random(); return static_cast(b < TgtScalar(0) ? -(b + 1) : b); @@ -51,9 +51,9 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if< + std::enable_if_t< NumTraits::IsInteger && NumTraits::IsInteger && NumTraits::IsSigned && - (std::numeric_limits::digits > std::numeric_limits::digits)>::type> { + (std::numeric_limits::digits > std::numeric_limits::digits)>> { static SrcScalar value() { return static_cast(internal::random()); } }; @@ -61,10 +61,10 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsInteger && NumTraits::IsInteger && - !NumTraits::IsSigned && NumTraits::IsSigned && - (std::numeric_limits::digits == - std::numeric_limits::digits)>::type> { + std::enable_if_t::IsInteger && NumTraits::IsInteger && + !NumTraits::IsSigned && NumTraits::IsSigned && + (std::numeric_limits::digits == + std::numeric_limits::digits)>> { static SrcScalar value() { return internal::random() / 2; } }; @@ -72,9 +72,9 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if< + std::enable_if_t< !NumTraits::IsInteger && !NumTraits::IsComplex && NumTraits::IsInteger && - (std::numeric_limits::digits <= std::numeric_limits::digits)>::type> { + (std::numeric_limits::digits <= std::numeric_limits::digits)>> { static SrcScalar value() { return static_cast(internal::random()); } }; @@ -82,9 +82,9 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if< + std::enable_if_t< !NumTraits::IsInteger && !NumTraits::IsComplex && NumTraits::IsInteger && - (std::numeric_limits::digits > std::numeric_limits::digits)>::type> { + (std::numeric_limits::digits > std::numeric_limits::digits)>> { static SrcScalar value() { // NOTE: internal::random() is limited by RAND_MAX, so random is always within that range. // This prevents us from simply shifting bits, which would result in only 0 or -1. @@ -99,8 +99,8 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsInteger && !NumTraits::IsInteger && - !NumTraits::IsComplex>::type> { + std::enable_if_t::IsInteger && !NumTraits::IsInteger && + !NumTraits::IsComplex>> { static SrcScalar value() { return static_cast(random_without_cast_overflow::value()); } @@ -110,10 +110,10 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsInteger && !NumTraits::IsComplex && - !NumTraits::IsInteger && !NumTraits::IsComplex && - (std::numeric_limits::digits > - std::numeric_limits::digits)>::type> { + std::enable_if_t::IsInteger && !NumTraits::IsComplex && + !NumTraits::IsInteger && !NumTraits::IsComplex && + (std::numeric_limits::digits > + std::numeric_limits::digits)>> { static SrcScalar value() { return static_cast(internal::random()); } }; @@ -121,7 +121,7 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsComplex && !NumTraits::IsComplex>::type> { + std::enable_if_t::IsComplex && !NumTraits::IsComplex>> { typedef typename NumTraits::Real SrcReal; static SrcScalar value() { return SrcScalar(random_without_cast_overflow::value(), 0); } }; @@ -130,7 +130,7 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsComplex && NumTraits::IsComplex>::type> { + std::enable_if_t::IsComplex && NumTraits::IsComplex>> { typedef typename NumTraits::Real TgtReal; static SrcScalar value() { return random_without_cast_overflow::value(); } }; @@ -139,7 +139,7 @@ struct random_without_cast_overflow< template struct random_without_cast_overflow< SrcScalar, TgtScalar, - typename internal::enable_if::IsComplex && NumTraits::IsComplex>::type> { + std::enable_if_t::IsComplex && NumTraits::IsComplex>> { typedef typename NumTraits::Real SrcReal; typedef typename NumTraits::Real TgtReal; static SrcScalar value() { diff --git a/test/ref.cpp b/test/ref.cpp index d8408001a..252bacd4b 100644 --- a/test/ref.cpp +++ b/test/ref.cpp @@ -204,7 +204,7 @@ void ref_vector_fixed_sizes() template void check_const_correctness(const PlainObjectType&) { // verify that ref-to-const don't have LvalueBit - typedef typename internal::add_const::type ConstPlainObjectType; + typedef std::add_const_t ConstPlainObjectType; VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(Ref::Flags & LvalueBit) ); diff --git a/test/reshape.cpp b/test/reshape.cpp index 23cb21594..d248f01cb 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -14,7 +14,7 @@ using Eigen::placeholders::last; using Eigen::placeholders::all; template -typename internal::enable_if::value,bool>::type +std::enable_if_t::value,bool> is_same_eq(const T1& a, const T2& b) { return (a.array() == b.array()).all(); diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp index 452926f91..2b19ac57f 100644 --- a/test/sparse_block.cpp +++ b/test/sparse_block.cpp @@ -11,14 +11,14 @@ #include "AnnoyingScalar.h" template -typename Eigen::internal::enable_if<(T::Flags&RowMajorBit)==RowMajorBit, typename T::RowXpr>::type +std::enable_if_t<(T::Flags&RowMajorBit)==RowMajorBit, typename T::RowXpr> innervec(T& A, Index i) { return A.row(i); } template -typename Eigen::internal::enable_if<(T::Flags&RowMajorBit)==0, typename T::ColXpr>::type +std::enable_if_t<(T::Flags&RowMajorBit)==0, typename T::ColXpr> innervec(T& A, Index i) { return A.col(i); diff --git a/test/sparse_ref.cpp b/test/sparse_ref.cpp index 8f33af858..098331e75 100644 --- a/test/sparse_ref.cpp +++ b/test/sparse_ref.cpp @@ -34,7 +34,7 @@ inline void on_temporary_creation() { template void check_const_correctness(const PlainObjectType&) { // verify that ref-to-const don't have LvalueBit - typedef typename internal::add_const::type ConstPlainObjectType; + typedef std::add_const_t ConstPlainObjectType; VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(internal::traits >::Flags & LvalueBit) ); VERIFY( !(Ref::Flags & LvalueBit) ); diff --git a/test/swap.cpp b/test/swap.cpp index 438835f3c..e8d6881ab 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -22,7 +22,7 @@ struct other_matrix_type -typename internal::enable_if<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void>::type +std::enable_if_t<(MatrixType::RowsAtCompileTime==1 || MatrixType::RowsAtCompileTime==Dynamic), void> check_row_swap(MatrixType& m1) { if (m1.rows() != 1) { @@ -34,7 +34,7 @@ check_row_swap(MatrixType& m1) { } template -typename internal::enable_if::type +std::enable_if_t check_row_swap(MatrixType& /* unused */) { } diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index b57b14c8d..b19a20e90 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -77,11 +77,11 @@ class Tensor : public TensorBase0) && !(Options_&DontAlign), - Layout = Options_ & RowMajor ? RowMajor : ColMajor, CoordAccess = true, RawAccess = true }; + static constexpr int Layout = Options_ & RowMajor ? RowMajor : ColMajor; static const int Options = Options_; static const int NumIndices = NumIndices_; typedef DSizes Dimensions; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h index 3e1e539ac..180d19635 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h @@ -31,7 +31,7 @@ struct traits > : public traits typedef typename XprTraits::Index Index; typedef Pair Scalar; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; }; @@ -66,7 +66,7 @@ class TensorIndexPairOp : public TensorBase, ReadOnly : m_xpr(expr) {} EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -92,10 +92,10 @@ struct TensorEvaluator, Device> PacketAccess = /*TensorEvaluator::PacketAccess*/ false, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; + static constexpr int Layout = TensorEvaluator::Layout; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockNotImplemented TensorBlock; @@ -154,7 +154,7 @@ struct traits > : public traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions - array_size::value; static const int Layout = XprTraits::Layout; }; @@ -192,7 +192,7 @@ class TensorPairReducerOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_DEVICE_FUNC @@ -233,11 +233,10 @@ struct TensorEvaluator, Devic PacketAccess = /*TensorEvaluator::PacketAccess*/ false, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator >, Device>::Layout, CoordAccess = false, // to be implemented RawAccess = false }; - + static constexpr int Layout = TensorEvaluator>, Device>::Layout; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockNotImplemented TensorBlock; //===--------------------------------------------------------------------===// diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h index 36cc4dfbb..fc5df834a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h @@ -32,8 +32,8 @@ struct traits > typename traits::Index>::type Index; typedef typename LhsXprType::Nested LhsNested; typedef typename RhsXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; static const std::size_t NumDimensions = internal::traits::NumDimensions; static const int Layout = internal::traits::Layout; typedef typename traits::PointerType PointerType; @@ -77,16 +77,16 @@ class TensorAssignOp : public TensorBase /** \returns the nested expressions */ EIGEN_DEVICE_FUNC - typename internal::remove_all::type& - lhsExpression() const { return *((typename internal::remove_all::type*)&m_lhs_xpr); } + internal::remove_all_t& + lhsExpression() const { return *((internal::remove_all_t*)&m_lhs_xpr); } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& rhsExpression() const { return m_rhs_xpr; } protected: - typename internal::remove_all::type& m_lhs_xpr; - const typename internal::remove_all::type& m_rhs_xpr; + internal::remove_all_t& m_lhs_xpr; + const internal::remove_all_t& m_rhs_xpr; }; @@ -104,6 +104,7 @@ struct TensorEvaluator, Device> static const int PacketSize = PacketType::size; static const int NumDims = XprType::NumDims; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = int(TensorEvaluator::IsAligned) & @@ -114,7 +115,6 @@ struct TensorEvaluator, Device> int(TensorEvaluator::BlockAccess), PreferBlockAccess = int(TensorEvaluator::PreferBlockAccess) | int(TensorEvaluator::PreferBlockAccess), - Layout = TensorEvaluator::Layout, RawAccess = TensorEvaluator::RawAccess }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 945e9fc3d..4c13401f6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -34,7 +34,7 @@ class TensorBase typedef internal::traits DerivedTraits; typedef typename DerivedTraits::Scalar Scalar; typedef typename DerivedTraits::Index Index; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; static const int NumDimensions = DerivedTraits::NumDimensions; // Generic nullary operation support. @@ -318,9 +318,9 @@ class TensorBase } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const typename internal::conditional::IsComplex, - TensorCwiseUnaryOp, const Derived>, - Derived>::type + EIGEN_STRONG_INLINE const std::conditional_t::IsComplex, + TensorCwiseUnaryOp, const Derived>, + Derived> conjugate() const { return choose(Cond::IsComplex>(), unaryExpr(internal::scalar_conjugate_op()), derived()); } @@ -419,9 +419,9 @@ class TensorBase template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const typename internal::conditional::value, - Derived, - TensorConversionOp >::type + EIGEN_STRONG_INLINE const std::conditional_t::value, + Derived, + TensorConversionOp > cast() const { return choose(Cond::value>(), derived(), TensorConversionOp(derived())); } @@ -717,26 +717,26 @@ class TensorBase } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const TensorReductionOp::value, Derived, TensorConversionOp >::type > + const TensorReductionOp::value, Derived, TensorConversionOp > > all(const Dims& dims) const { return cast().reduce(dims, internal::AndReducer()); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const TensorReductionOp, const typename internal::conditional::value, Derived, TensorConversionOp >::type > + const TensorReductionOp, const std::conditional_t::value, Derived, TensorConversionOp > > all() const { DimensionList in_dims; return cast().reduce(in_dims, internal::AndReducer()); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const TensorReductionOp::value, Derived, TensorConversionOp >::type > + const TensorReductionOp::value, Derived, TensorConversionOp > > any(const Dims& dims) const { return cast().reduce(dims, internal::OrReducer()); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const TensorReductionOp, const typename internal::conditional::value, Derived, TensorConversionOp >::type > + const TensorReductionOp, const std::conditional_t::value, Derived, TensorConversionOp > > any() const { DimensionList in_dims; return cast().reduce(in_dims, internal::OrReducer()); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h index 5f7d6d04a..6f394a6dd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h @@ -839,10 +839,10 @@ class TensorCwiseUnaryBlock { internal::is_void::value; public: - typedef typename conditional< + typedef std::conditional_t< NoArgBlockAccess, void, - TensorCwiseUnaryOp >:: - type XprType; + TensorCwiseUnaryOp > + XprType; typedef typename XprScalar::type Scalar; @@ -871,10 +871,10 @@ class TensorCwiseBinaryBlock { internal::is_void::value; public: - typedef typename conditional< + typedef std::conditional_t< NoArgBlockAccess, void, TensorCwiseBinaryOp >::type + const typename RhsTensorBlock::XprType> > XprType; typedef typename XprScalar::type Scalar; @@ -916,9 +916,9 @@ class TensorUnaryExprBlock { static const bool NoArgBlockAccess = internal::is_void::value; public: - typedef typename conditional< + typedef std::conditional_t< NoArgBlockAccess, void, - typename BlockFactory::template XprType::type>::type XprType; + typename BlockFactory::template XprType::type> XprType; typedef typename XprScalar::type Scalar; @@ -952,10 +952,10 @@ class TensorTernaryExprBlock { internal::is_void::value; public: - typedef typename conditional< + typedef std::conditional_t< NoArgBlockAccess, void, typename BlockFactory::template XprType::type>::type XprType; + Arg3XprType>::type> XprType; typedef typename XprScalar::type Scalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h index 37bba2be2..541468d82 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h @@ -30,7 +30,7 @@ struct traits > : public traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -85,7 +85,7 @@ class TensorBroadcastingOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -118,11 +118,11 @@ struct TensorEvaluator, Device> PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::BlockAccess, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, RawAccess = false }; + static constexpr int Layout = TensorEvaluator::Layout; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; // We do block based broadcasting using a trick with 2x tensor rank and 0 // strides. See block method implementation for details. @@ -231,7 +231,7 @@ struct TensorEvaluator, Device> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE CoeffReturnType coeff(Index index) const { - if (internal::is_input_scalar::type>::value) { + if (internal::is_input_scalar>::value) { return m_impl.coeff(0); } @@ -324,7 +324,7 @@ struct TensorEvaluator, Device> template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE PacketReturnType packet(Index index) const { - if (internal::is_input_scalar::type>::value) { + if (internal::is_input_scalar>::value) { return internal::pset1(m_impl.coeff(0)); } @@ -372,7 +372,7 @@ struct TensorEvaluator, Device> { eigen_assert(index+PacketSize-1 < dimensions().TotalSize()); - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; Index startDim, endDim; Index inputIndex, outputOffset, batchedIndex; @@ -424,7 +424,7 @@ struct TensorEvaluator, Device> if (inputIndex + PacketSize <= M) { return m_impl.template packet(inputIndex); } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { if (inputIndex > M - 1) { @@ -453,7 +453,7 @@ struct TensorEvaluator, Device> if (outputOffset + PacketSize <= M) { return internal::pset1(m_impl.coeff(inputIndex)); } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { if (outputOffset < M) { @@ -512,7 +512,7 @@ struct TensorEvaluator, Device> if (innermostLoc + PacketSize <= m_impl.dimensions()[0]) { return m_impl.template packet(inputIndex); } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; values[0] = m_impl.coeff(inputIndex); EIGEN_UNROLL_LOOP for (int i = 1; i < PacketSize; ++i) { @@ -569,7 +569,7 @@ struct TensorEvaluator, Device> if (innermostLoc + PacketSize <= m_impl.dimensions()[NumDims-1]) { return m_impl.template packet(inputIndex); } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; values[0] = m_impl.coeff(inputIndex); EIGEN_UNROLL_LOOP for (int i = 1; i < PacketSize; ++i) { @@ -1074,7 +1074,7 @@ struct TensorEvaluator, Device> protected: const Device EIGEN_DEVICE_REF m_device; - const typename internal::remove_reference::type m_broadcast; + const std::remove_reference_t m_broadcast; Dimensions m_dimensions; array m_outputStrides; array m_inputStrides; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index a2ffd3fb4..8870344bc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -31,7 +31,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions - 1; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -100,7 +100,7 @@ class TensorChippingOp : public TensorBase > const Index dim() const { return m_dim.actualDim(); } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorChippingOp) @@ -127,21 +127,21 @@ struct TensorEvaluator, Device> static const int PacketSize = PacketType::size; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { // Alignment can't be guaranteed at compile time since it depends on the // slice offsets. IsAligned = false, - Layout = TensorEvaluator::Layout, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::BlockAccess, // Chipping of outer-most dimension is a trivial operation, because we can // read and write directly from the underlying tensor using single offset. - IsOuterChipping = (static_cast(Layout) == ColMajor && DimId == NumInputDims - 1) || - (static_cast(Layout) == RowMajor && DimId == 0), + IsOuterChipping = (Layout == ColMajor && DimId == NumInputDims - 1) || + (Layout == RowMajor && DimId == 0), // Chipping inner-most dimension. - IsInnerChipping = (static_cast(Layout) == ColMajor && DimId == 0) || - (static_cast(Layout) == RowMajor && DimId == NumInputDims - 1), + IsInnerChipping = (Layout == ColMajor && DimId == 0) || + (Layout == RowMajor && DimId == NumInputDims - 1), // Prefer block access if the underlying expression prefers it, otherwise // only if chipping is not trivial. PreferBlockAccess = TensorEvaluator::PreferBlockAccess || @@ -150,7 +150,7 @@ struct TensorEvaluator, Device> RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -225,7 +225,7 @@ struct TensorEvaluator, Device> // m_stride is equal to 1, so let's avoid the integer division. eigen_assert(m_stride == 1); Index inputIndex = index * m_inputStride + m_inputOffset; - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = m_impl.coeff(inputIndex); @@ -245,7 +245,7 @@ struct TensorEvaluator, Device> return m_impl.template packet(inputIndex); } else { // Cross the stride boundary. Fallback to slow path. - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index); @@ -449,7 +449,7 @@ struct TensorEvaluator, Device> if (this->isInnerChipping()) { // m_stride is equal to 1, so let's avoid the integer division. eigen_assert(this->m_stride == 1); - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; internal::pstore(values, x); Index inputIndex = index * this->m_inputStride + this->m_inputOffset; EIGEN_UNROLL_LOOP @@ -469,7 +469,7 @@ struct TensorEvaluator, Device> this->m_impl.template writePacket(inputIndex, x); } else { // Cross stride boundary. Fallback to slow path. - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; internal::pstore(values, x); EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h index 00759a565..33674fee5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h @@ -34,13 +34,13 @@ struct traits > typename traits::Index>::type Index; typedef typename LhsXprType::Nested LhsNested; typedef typename RhsXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = traits::Layout; enum { Flags = 0 }; - typedef typename conditional::val, - typename traits::PointerType, typename traits::PointerType>::type PointerType; + typedef std::conditional_t::val, + typename traits::PointerType, typename traits::PointerType> PointerType; }; template @@ -75,11 +75,11 @@ class TensorConcatenationOp : public TensorBase::type& + const internal::remove_all_t& lhsExpression() const { return m_lhs_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& rhsExpression() const { return m_rhs_xpr; } EIGEN_DEVICE_FUNC const Axis& axis() const { return m_axis; } @@ -106,6 +106,7 @@ struct TensorEvaluator::type PacketReturnType; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess && @@ -113,7 +114,6 @@ struct TensorEvaluator::PreferBlockAccess || TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, RawAccess = false }; @@ -305,6 +305,7 @@ template, Device> Base; typedef TensorConcatenationOp XprType; typedef typename Base::Dimensions Dimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess && @@ -312,7 +313,6 @@ template::PreferBlockAccess || TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h index ec19fd4f8..e0496ac66 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h @@ -27,8 +27,8 @@ template > { // Type promotion to handle the case where the types of the lhs and the rhs are different. - typedef typename gebp_traits::type, - typename remove_const::type>::ResScalar Scalar; + typedef typename gebp_traits, + std::remove_const_t>::ResScalar Scalar; typedef typename promote_storage_type::StorageKind, typename traits::StorageKind>::ret StorageKind; @@ -36,15 +36,15 @@ struct traits::Index>::type Index; typedef typename LhsXprType::Nested LhsNested; typedef typename RhsXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; // From NumDims below. static const int NumDimensions = traits::NumDimensions + traits::NumDimensions - 2 * array_size::value; static const int Layout = traits::Layout; - typedef typename conditional::val, - typename traits::PointerType, - typename traits::PointerType>::type + typedef std::conditional_t::val, + typename traits::PointerType, + typename traits::PointerType> PointerType; enum { @@ -345,11 +345,11 @@ class TensorContractionOp : public TensorBase::type& + const internal::remove_all_t& lhsExpression() const { return m_lhs_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& rhsExpression() const { return m_rhs_xpr; } EIGEN_DEVICE_FUNC @@ -373,19 +373,19 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator typedef typename internal::traits::Device Device; typedef TensorContractionOp XprType; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::Index Index; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = true, PacketAccess = (PacketType::size > 1), BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = true }; @@ -398,10 +398,10 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator // inputs are RowMajor, we will "cheat" by swapping the LHS and RHS: // If we want to compute A * B = C, where A is LHS and B is RHS, the code // will pretend B is LHS and A is RHS. - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType>::type EvalLeftArgType; - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType>::type EvalRightArgType; + typedef std::conditional_t< + static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType> EvalLeftArgType; + typedef std::conditional_t< + static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType> EvalRightArgType; typedef TensorEvaluator LeftEvaluatorType; typedef TensorEvaluator RightEvaluatorType; @@ -735,8 +735,8 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator const Index rows = m_i_size; const Index cols = m_k_size; - typedef typename internal::remove_const::type LhsScalar; - typedef typename internal::remove_const::type RhsScalar; + typedef std::remove_const_t LhsScalar; + typedef std::remove_const_t RhsScalar; typedef TensorEvaluator LeftEvaluator; typedef TensorEvaluator RightEvaluator; const Index lhs_packet_size = internal::unpacket_traits::size; @@ -812,8 +812,8 @@ struct TensorContractionEvaluatorBase : internal::no_assignment_operator const Index n = this->m_j_size; // define data mappers for Lhs and Rhs - typedef typename internal::remove_const::type LhsScalar; - typedef typename internal::remove_const::type RhsScalar; + typedef std::remove_const_t LhsScalar; + typedef std::remove_const_t RhsScalar; typedef TensorEvaluator LeftEvaluator; typedef TensorEvaluator RightEvaluator; @@ -978,23 +978,19 @@ struct TensorEvaluator Base; typedef TensorContractionOp XprType; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::Index Index; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; - enum { - Layout = TensorEvaluator::Layout - }; + static constexpr int Layout = TensorEvaluator::Layout; // Most of the code is assuming that both input tensors are ColMajor. If the // inputs are RowMajor, we will "cheat" by swapping the LHS and RHS: // If we want to compute A * B = C, where A is LHS and B is RHS, the code // will pretend B is LHS and A is RHS. - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType>::type EvalLeftArgType; - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType>::type EvalRightArgType; + typedef std::conditional_t(ColMajor), LeftArgType, RightArgType> EvalLeftArgType; + typedef std::conditional_t(ColMajor), RightArgType, LeftArgType> EvalRightArgType; static const int LDims = internal::array_size::Dimensions>::value; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h index 65d9a343f..794aa006e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h @@ -1227,23 +1227,19 @@ struct TensorEvaluator Base; typedef TensorContractionOp XprType; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::Index Index; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; - enum { - Layout = TensorEvaluator::Layout, - }; + static constexpr int Layout = TensorEvaluator::Layout; // Most of the code is assuming that both input tensors are ColMajor. If the // inputs are RowMajor, we will "cheat" by swapping the LHS and RHS: // If we want to compute A * B = C, where A is LHS and B is RHS, the code // will pretend B is LHS and A is RHS. - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType>::type EvalLeftArgType; - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType>::type EvalRightArgType; + typedef std::conditional_t(ColMajor), LeftArgType, RightArgType> EvalLeftArgType; + typedef std::conditional_t(ColMajor), RightArgType, LeftArgType> EvalRightArgType; static const int LDims = internal::array_size::Dimensions>::value; @@ -1263,8 +1259,8 @@ struct TensorEvaluator Dimensions; // typedefs needed in evalTo - typedef typename internal::remove_const::type LhsScalar; - typedef typename internal::remove_const::type RhsScalar; + typedef std::remove_const_t LhsScalar; + typedef std::remove_const_t RhsScalar; typedef TensorEvaluator LeftEvaluator; typedef TensorEvaluator RightEvaluator; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h index 5378184f7..227d4f30f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h @@ -296,7 +296,7 @@ class BaseTensorContractionMapper : public SimpleTensorContractionMapper EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::size==packet_size,PacketT>::type + std::enable_if_t::size==packet_size,PacketT> load(Index i, Index j) const { // whole method makes column major assumption @@ -342,7 +342,7 @@ class BaseTensorContractionMapper : public SimpleTensorContractionMapper EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::size!=packet_size,PacketT>::type + std::enable_if_t::size!=packet_size,PacketT> load(Index i, Index j) const { const Index requested_packet_size = internal::unpacket_traits::size; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h index dd116748f..054238270 100755 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h @@ -158,7 +158,7 @@ enum class data_source { global_mem, local_mem, private_mem }; */ template -static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if::type read( +static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t read( const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &ld) { const StorageIndex row = (is_coalesced_layout) ? NCIndex : CIndex; const StorageIndex col = (is_coalesced_layout) ? CIndex : NCIndex; @@ -188,7 +188,7 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_ * \param CIndex: is the contracting dim index */ template -static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if::type read( +static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t read( const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &) { const StorageIndex row = (IsRhs) ? CIndex : NCIndex; const StorageIndex col = (IsRhs) ? NCIndex : CIndex; @@ -218,7 +218,7 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_ template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if
::type + std::enable_if_t
write(PacketType &packet_data, DataScalar ptr) { EIGEN_CONSTEXPR int PacketSize = Eigen::internal::unpacket_traits::size; EIGEN_UNROLL_LOOP @@ -244,8 +244,8 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE */ template -static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if< - Eigen::internal::unpacket_traits::size != 1 && dt == data_source::global_mem, void>::type +static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename std::enable_if_t< + Eigen::internal::unpacket_traits::size != 1 && dt == data_source::global_mem, void> write(PacketType &packet_data, DataScalar *ptr) { ::Eigen::internal::pstoreu(ptr, packet_data); } @@ -264,8 +264,8 @@ write(PacketType &packet_data, DataScalar *ptr) { * \param ptr: a pointer to the local memory */ template -static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if< - Eigen::internal::unpacket_traits::size == 1 && dt == data_source::global_mem, void>::type +static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename std::enable_if_t< + Eigen::internal::unpacket_traits::size == 1 && dt == data_source::global_mem, void> write(PacketType &packet_data, DataScalar *ptr) { *ptr = packet_data; } @@ -321,7 +321,7 @@ struct BlockProperties { static EIGEN_CONSTEXPR bool packet_load = packet_load_; typedef typename Eigen::internal::unpacket_traits::type OutScalar; static EIGEN_CONSTEXPR bool is_rhs = is_rhs_; - typedef typename Eigen::internal::conditional::type OutType; + typedef Eigen::std::conditional_t OutType; static EIGEN_CONSTEXPR int elements_per_access = Eigen::internal::unpacket_traits::size; static EIGEN_CONSTEXPR bool is_coalesced_layout = !(is_transposed ^ is_rhs); static EIGEN_CONSTEXPR int nc_stride = (is_coalesced_layout ? elements_per_access : 1); @@ -477,8 +477,7 @@ class TensorContractionKernel { typedef cl::sycl::accessor Scratch; typedef cl::sycl::multi_ptr local_ptr; typedef OutScalar * /*cl::sycl::multi_ptr*/ private_ptr; - typedef - typename ::Eigen::internal::conditional::type + typedef std::conditional_t tile_ptr; static EIGEN_CONSTEXPR StorageIndex LSDL = contraction_tp == contraction_type::local ? Properties::TileSizeDimM + Properties::BC @@ -544,7 +543,7 @@ class TensorContractionKernel { template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TiledMemory(const ThreadProperties &, local_ptr, - typename ::Eigen::internal::enable_if::type * = 0) + std::enable_if_t * = 0) : lhs_scratch_extract{}, rhs_scratch_extract{}, lhs_scratch_ptr_compute(lhs_scratch_extract.ptr), @@ -555,7 +554,7 @@ class TensorContractionKernel { template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TiledMemory(const ThreadProperties &thread_properties, local_ptr block_start_ptr, - typename ::Eigen::internal::enable_if::type * = 0) + std::enable_if_t * = 0) : lhs_scratch_extract{block_start_ptr}, rhs_scratch_extract{lhs_scratch_extract.ptr + ((Properties::DoubleBuffer + 1) * LSDL * Properties::TileSizeDimK)}, @@ -712,7 +711,7 @@ class TensorContractionKernel { template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t extract_block(const Input &inpt, PrivateReg private_ptr, const std::pair &, const StorageIndex &ncOffset, const StorageIndex cOffset) { EIGEN_CONSTEXPR StorageIndex LocalThreadSizeNC = @@ -785,28 +784,28 @@ class TensorContractionKernel { template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t sync_mem(const cl::sycl::nd_item<1> &, bool &db_offset) noexcept { db_offset = !db_offset; } template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t sync_mem(const cl::sycl::nd_item<1> &itemID, bool &) noexcept { itemID.barrier(cl::sycl::access::fence_space::local_space); } template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t sync_mem(const cl::sycl::nd_item<1> &, bool &) noexcept { return; } template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t sync_thread(const cl::sycl::nd_item<1> & #ifdef EIGEN_SYCL_ARM_GPU_CACHE_OPTIMISATION itemID @@ -820,12 +819,12 @@ class TensorContractionKernel { } template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t sync_thread(const cl::sycl::nd_item<1> &itemID) { itemID.barrier(cl::sycl::access::fence_space::local_space); } template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if::type sync_thread( + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t sync_thread( const cl::sycl::nd_item<1> &) { return; } @@ -896,7 +895,7 @@ class TensorContractionKernel { template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename ::Eigen::internal::enable_if::type + std::enable_if_t extract_block(const Input &inpt, Local local_ptr, const std::pair& local_index, const StorageIndex &ncOffset, const StorageIndex cOffset) { EIGEN_CONSTEXPR StorageIndex TileSizeDimNC = @@ -1294,7 +1293,7 @@ struct TensorEvaluator, Device> Self; typedef TensorContractionEvaluatorBase Base; typedef TensorContractionOp XprType; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::Index StorageIndex; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; @@ -1307,11 +1306,11 @@ struct TensorEvaluator::Layout, PacketAccess = (PacketType::size > 1), BlockAccess = false, }; + static constexpr int Layout = TensorEvaluator::Layout; static EIGEN_CONSTEXPR int LDims = Base::LDims; static EIGEN_CONSTEXPR int RDims = Base::RDims; static EIGEN_CONSTEXPR int ContractDims = Base::ContractDims; @@ -1329,8 +1328,8 @@ struct TensorEvaluator LeftEvaluator; typedef TensorEvaluator RightEvaluator; - typedef typename Eigen::internal::remove_const::type LhsScalar; - typedef typename Eigen::internal::remove_const::type RhsScalar; + typedef std::remove_const_t LhsScalar; + typedef std::remove_const_t RhsScalar; typedef typename LeftEvaluator::Dimensions LeftDimensions; typedef typename RightEvaluator::Dimensions RightDimensions; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 0bbc1e8fb..faf62019d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -27,23 +27,21 @@ struct TensorEvaluator Base; typedef TensorContractionOp XprType; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::Index Index; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; - enum { - Layout = TensorEvaluator::Layout, - }; + static constexpr int Layout = TensorEvaluator::Layout; // Most of the code is assuming that both input tensors are ColMajor. If the // inputs are RowMajor, we will "cheat" by swapping the LHS and RHS: // If we want to compute A * B = C, where A is LHS and B is RHS, the code // will pretend B is LHS and A is RHS. - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType>::type EvalLeftArgType; - typedef typename internal::conditional< - static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType>::type EvalRightArgType; + typedef std::conditional_t< + static_cast(Layout) == static_cast(ColMajor), LeftArgType, RightArgType> EvalLeftArgType; + typedef std::conditional_t< + static_cast(Layout) == static_cast(ColMajor), RightArgType, LeftArgType> EvalRightArgType; static const int LDims = internal::array_size::Dimensions>::value; @@ -63,8 +61,8 @@ struct TensorEvaluator Dimensions; // typedefs needed in evalTo - typedef typename internal::remove_const::type LhsScalar; - typedef typename internal::remove_const::type RhsScalar; + typedef std::remove_const_t LhsScalar; + typedef std::remove_const_t RhsScalar; typedef typename internal::gebp_traits Traits; typedef TensorEvaluator LeftEvaluator; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h index a50099676..0cd7fe80d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h @@ -30,7 +30,7 @@ struct traits > typedef typename traits::StorageKind StorageKind; typedef typename traits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = traits::Layout; enum { Flags = 0 }; @@ -189,7 +189,7 @@ class TensorConversionOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -257,7 +257,7 @@ struct PacketConv { template static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator& impl, Index index) { internal::scalar_cast_op converter; - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = converter(impl.coeff(index+i)); @@ -289,7 +289,7 @@ struct PacketConv static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator& impl, Index index) { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; for (int i = 0; i < PacketSize; ++i) values[i] = impl.coeff(index+i); return internal::pload(values); } @@ -314,7 +314,7 @@ struct TensorEvaluator, Device> typedef typename TensorEvaluator::Dimensions Dimensions; typedef TargetType Scalar; typedef TargetType CoeffReturnType; - typedef typename internal::remove_all::Scalar>::type SrcType; + typedef internal::remove_all_t::Scalar> SrcType; typedef typename PacketType::type PacketReturnType; typedef typename PacketType::type PacketSourceType; static const int PacketSize = PacketType::size; @@ -333,10 +333,10 @@ struct TensorEvaluator, Device> #endif BlockAccess = TensorEvaluator::BlockAccess, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, RawAccess = false }; + static constexpr int Layout = TensorEvaluator::Layout; static const int NumDims = internal::array_size::value; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h index c1531998b..cbe06b7cf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h @@ -229,12 +229,12 @@ struct traits > typename traits::Index>::type Index; typedef typename InputXprType::Nested LhsNested; typedef typename KernelXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = traits::Layout; - typedef typename conditional::val, - typename traits::PointerType, typename traits::PointerType>::type PointerType; + typedef std::conditional_t::val, + typename traits::PointerType, typename traits::PointerType> PointerType; enum { Flags = 0 @@ -277,11 +277,11 @@ class TensorConvolutionOp : public TensorBase::type& + const internal::remove_all_t& inputExpression() const { return m_input_xpr; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const typename internal::remove_all::type& + const internal::remove_all_t& kernelExpression() const { return m_kernel_xpr; } protected: @@ -308,12 +308,12 @@ struct TensorEvaluator Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = int(TensorEvaluator::IsAligned) & int(TensorEvaluator::IsAligned), PacketAccess = int(TensorEvaluator::PacketAccess) & int(TensorEvaluator::PacketAccess), BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -785,12 +785,12 @@ struct TensorEvaluator Dimensions; typedef typename TensorEvaluator::Dimensions KernelDimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned & TensorEvaluator::IsAligned, PacketAccess = false, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h index a9d3d683c..7e7328283 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h @@ -292,13 +292,13 @@ struct TensorEvaluator KernelStorage; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned & TensorEvaluator::IsAligned, PacketAccess = false, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h b/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h index 19a5dec86..7f8c59601 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h @@ -29,7 +29,7 @@ struct traits > typedef typename XprType::StorageKind StorageKind; typedef typename XprType::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = traits::Layout; typedef typename traits::PointerType PointerType; @@ -69,7 +69,7 @@ class TensorCustomUnaryOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_expr; } protected: @@ -86,20 +86,20 @@ struct TensorEvaluator, Devi typedef typename internal::traits::Index Index; static const int NumDims = internal::traits::NumDimensions; typedef DSizes Dimensions; - typedef typename internal::remove_const::type Scalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t Scalar; + typedef std::remove_const_t CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; typedef typename Eigen::internal::traits::PointerType TensorPointerType; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -193,12 +193,12 @@ struct traits > typename traits::Index>::type Index; typedef typename LhsXprType::Nested LhsNested; typedef typename RhsXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = traits::Layout; - typedef typename conditional::val, - typename traits::PointerType, typename traits::PointerType>::type PointerType; + typedef std::conditional_t::val, + typename traits::PointerType, typename traits::PointerType> PointerType; }; template @@ -236,11 +236,11 @@ class TensorCustomBinaryOp : public TensorBase::type& + const internal::remove_all_t& lhsExpression() const { return m_lhs_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& rhsExpression() const { return m_rhs_xpr; } protected: @@ -259,7 +259,7 @@ struct TensorEvaluator::NumDimensions; typedef DSizes Dimensions; typedef typename XprType::Scalar Scalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; @@ -267,12 +267,12 @@ struct TensorEvaluator Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h index 454944e25..b2ae6088c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h @@ -381,11 +381,11 @@ class QueueInterface { eigen_assert(typed_offset >= 0); const auto typed_size = original_buffer.get_size() / sizeof(T); auto buffer = original_buffer.template reinterpret< - typename Eigen::internal::remove_const::type>( + std::remove_const_t>( cl::sycl::range<1>(typed_size)); const ptrdiff_t size = buffer.get_count() - typed_offset; eigen_assert(size >= 0); - typedef cl::sycl::accessor::type, + typedef cl::sycl::accessor, 1, AcMd, global_access, is_place_holder> placeholder_accessor_t; const auto start_ptr = static_cast(ptr) - offset; @@ -441,7 +441,7 @@ class QueueInterface { const ptrdiff_t typed_offset = offset / sizeof(T); const size_t typed_size = buffer.get_size() / sizeof(T); auto reint = buffer.template reinterpret< - typename Eigen::internal::remove_const::type>( + std::remove_const_t>( cl::sycl::range<1>(typed_size)); return reint.template get_access( cgh, cl::sycl::range<1>(count), cl::sycl::id<1>(typed_offset)); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index d44ab4c5b..6d9e9dc23 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -284,14 +284,14 @@ struct DSizes : array { EIGEN_DEVICE_FUNC explicit DSizes(const array& other, // Default template parameters require c++11. - typename internal::enable_if< + std::enable_if_t< internal::is_same< DenseIndex, typename internal::promote_index_type< DenseIndex, OtherIndex >::type - >::value, void*>::type = 0) { + >::value, void*> = 0) { for (int i = 0; i < NumDims; ++i) { (*this)[i] = static_cast(other[i]); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h index cd43ac1b1..9d8b01784 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h @@ -31,7 +31,7 @@ struct traits > typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename MakePointer_::Type PointerType; @@ -72,7 +72,7 @@ class TensorEvalToOp : public TensorBase, public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename MakePointer_::Type PointerType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; @@ -84,7 +84,7 @@ class TensorEvalToOp : public TensorBase, : m_xpr(expr), m_buffer(buffer) {} EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_DEVICE_FUNC PointerType buffer() const { return m_buffer; } @@ -103,7 +103,7 @@ struct TensorEvaluator, Device> typedef typename ArgType::Scalar Scalar; typedef typename TensorEvaluator::Dimensions Dimensions; typedef typename XprType::Index Index; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; typedef typename Eigen::internal::traits::PointerType TensorPointerType; @@ -114,11 +114,11 @@ struct TensorEvaluator, Device> PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = true, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = true }; + static constexpr int Layout = TensorEvaluator::Layout; static const int NumDims = internal::traits::NumDimensions; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h index 1711c12ab..941666a73 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h @@ -43,18 +43,18 @@ struct TensorEvaluator // NumDimensions is -1 for variable dim tensors static const int NumCoords = internal::traits::NumDimensions > 0 ? internal::traits::NumDimensions : 0; + static constexpr int Layout = Derived::Layout; enum { IsAligned = Derived::IsAligned, PacketAccess = (PacketType::size > 1), - BlockAccess = internal::is_arithmetic::type>::value, + BlockAccess = internal::is_arithmetic>::value, PreferBlockAccess = false, - Layout = Derived::Layout, CoordAccess = NumCoords > 0, RawAccess = true }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -75,7 +75,7 @@ struct TensorEvaluator EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dims; } EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType dest) { - if (!NumTraits::type>::RequireInitialization && dest) { + if (!NumTraits>::RequireInitialization && dest) { m_device.memcpy((void*)(m_device.get(dest)), m_device.get(m_data), m_dims.TotalSize() * sizeof(Scalar)); return false; } @@ -115,7 +115,7 @@ struct TensorEvaluator // float element will be loaded, otherwise 0 will be loaded. // Function has been templatized to enable Sfinae. template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::masked_load_available, PacketReturnTypeT>::type + std::enable_if_t::masked_load_available, PacketReturnTypeT> partialPacket(Index index, typename internal::unpacket_traits::mask_t umask) const { return internal::ploadu(m_data + index, umask); @@ -237,19 +237,19 @@ struct TensorEvaluator typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; // NumDimensions is -1 for variable dim tensors static const int NumCoords = internal::traits::NumDimensions > 0 ? internal::traits::NumDimensions : 0; static const int PacketSize = PacketType::size; + static constexpr int Layout = Derived::Layout; enum { IsAligned = Derived::IsAligned, PacketAccess = (PacketType::size > 1), BlockAccess = internal::is_arithmetic::value, PreferBlockAccess = false, - Layout = Derived::Layout, CoordAccess = NumCoords > 0, RawAccess = true }; @@ -270,7 +270,7 @@ struct TensorEvaluator EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dims; } EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data) { - if (!NumTraits::type>::RequireInitialization && data) { + if (!NumTraits>::RequireInitialization && data) { m_device.memcpy((void*)(m_device.get(data)),m_device.get(m_data), m_dims.TotalSize() * sizeof(Scalar)); return false; } @@ -305,7 +305,7 @@ struct TensorEvaluator // float element will be loaded, otherwise 0 will be loaded. // Function has been templatized to enable Sfinae. template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::masked_load_available, PacketReturnTypeT>::type + std::enable_if_t::masked_load_available, PacketReturnTypeT> partialPacket(Index index, typename internal::unpacket_traits::mask_t umask) const { return internal::ploadu(m_data + index, umask); @@ -371,6 +371,7 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = true, PacketAccess = internal::functor_traits::PacketAccess @@ -380,7 +381,6 @@ struct TensorEvaluator, Device> , BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -444,13 +444,13 @@ struct TensorEvaluator, Device> { typedef TensorCwiseUnaryOp XprType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned, PacketAccess = int(TensorEvaluator::PacketAccess) & int(internal::functor_traits::PacketAccess), BlockAccess = TensorEvaluator::BlockAccess, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -463,7 +463,7 @@ struct TensorEvaluator, Device> typedef typename XprType::Index Index; typedef typename XprType::Scalar Scalar; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; typedef typename internal::traits::Scalar CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; @@ -556,6 +556,7 @@ struct TensorEvaluator XprType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = int(TensorEvaluator::IsAligned) & int(TensorEvaluator::IsAligned), @@ -566,7 +567,6 @@ struct TensorEvaluator::BlockAccess), PreferBlockAccess = int(TensorEvaluator::PreferBlockAccess) | int(TensorEvaluator::PreferBlockAccess), - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -694,6 +694,7 @@ struct TensorEvaluator XprType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned & TensorEvaluator::IsAligned & TensorEvaluator::IsAligned, PacketAccess = TensorEvaluator::PacketAccess && @@ -704,7 +705,6 @@ struct TensorEvaluator::PreferBlockAccess || TensorEvaluator::PreferBlockAccess || TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -812,6 +812,7 @@ struct TensorEvaluator typedef TensorSelectOp XprType; typedef typename XprType::Scalar Scalar; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned & TensorEvaluator::IsAligned, @@ -824,7 +825,6 @@ struct TensorEvaluator PreferBlockAccess = TensorEvaluator::PreferBlockAccess || TensorEvaluator::PreferBlockAccess || TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index 9a513dc8a..37244c4f0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -167,7 +167,7 @@ class TensorExecutor { public: typedef typename traits::Scalar Scalar; - typedef typename remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; typedef TensorEvaluator Evaluator; typedef typename traits::Index StorageIndex; @@ -353,7 +353,7 @@ class TensorExecutor::Index IndexType; typedef typename traits::Scalar Scalar; - typedef typename remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; static const int NumDims = traits::NumDimensions; @@ -461,7 +461,7 @@ class TensorAsyncExecutor::Index IndexType; typedef typename traits::Scalar Scalar; - typedef typename remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; static const int NumDims = traits::NumDimensions; @@ -692,7 +692,7 @@ struct ExecExprFunctorKernel { compute(itemID); } template - EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE typename std::enable_if::type + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::enable_if_t compute(const cl::sycl::nd_item<1>& itemID) { Index gId = static_cast(itemID.get_global_linear_id()); Index total_threads = itemID.get_global_range(0); @@ -702,7 +702,7 @@ struct ExecExprFunctorKernel { } } template - EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE typename std::enable_if::type + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::enable_if_t compute(const cl::sycl::nd_item<1>& itemID) { const Index vectorizedRange = (range / Evaluator::PacketSize) * Evaluator::PacketSize; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h index 16daa318d..aab9b51b1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h @@ -37,7 +37,7 @@ struct traits > typedef traits XprTraits; typedef typename XprType::Scalar Scalar; typedef typename XprType::Nested XprTypeNested; - typedef typename remove_reference::type XprTypeNested_; + typedef std::remove_reference_t XprTypeNested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -65,7 +65,7 @@ class TensorCwiseNullaryOp : public TensorBase::type& + const internal::remove_all_t& nestedExpression() const { return m_xpr; } EIGEN_DEVICE_FUNC @@ -88,7 +88,7 @@ struct traits > typedef typename result_of::type Scalar; typedef traits XprTraits; typedef typename XprType::Nested XprTypeNested; - typedef typename remove_reference::type XprTypeNested_; + typedef std::remove_reference_t XprTypeNested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename TypeConversion::type& + const internal::remove_all_t& nestedExpression() const { return m_xpr; } protected: @@ -163,14 +163,14 @@ struct traits > typename traits::Index>::type Index; typedef typename LhsXprType::Nested LhsNested; typedef typename RhsXprType::Nested RhsNested; - typedef typename remove_reference::type LhsNested_; - typedef typename remove_reference::type RhsNested_; + typedef std::remove_reference_t LhsNested_; + typedef std::remove_reference_t RhsNested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename TypeConversion::val, + std::conditional_t::val, typename traits::PointerType, - typename traits::PointerType>::type + typename traits::PointerType> >::type PointerType; enum { @@ -215,11 +215,11 @@ class TensorCwiseBinaryOp : public TensorBase::type& + const internal::remove_all_t& lhsExpression() const { return m_lhs_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& rhsExpression() const { return m_rhs_xpr; } protected: @@ -244,15 +244,15 @@ struct traits::type Arg1Nested_; - typedef typename remove_reference::type Arg2Nested_; - typedef typename remove_reference::type Arg3Nested_; + typedef std::remove_reference_t Arg1Nested_; + typedef std::remove_reference_t Arg2Nested_; + typedef std::remove_reference_t Arg3Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename TypeConversion::val, + std::conditional_t::val, typename traits::PointerType, - typename traits::PointerType>::type + typename traits::PointerType> >::type PointerType; enum { @@ -295,15 +295,15 @@ class TensorCwiseTernaryOp : public TensorBase::type& + const internal::remove_all_t& arg1Expression() const { return m_arg1_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& arg2Expression() const { return m_arg2_xpr; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& arg3Expression() const { return m_arg3_xpr; } protected: @@ -330,9 +330,9 @@ struct traits > typedef typename ElseXprType::Nested ElseNested; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; - typedef typename conditional::val, + typedef std::conditional_t::val, typename traits::PointerType, - typename traits::PointerType>::type PointerType; + typename traits::PointerType> PointerType; }; template diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h index bfb5e79c5..bd98da47c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h @@ -62,11 +62,11 @@ struct traits > : public traits typedef typename NumTraits::Real RealScalar; typedef typename std::complex ComplexScalar; typedef typename XprTraits::Scalar InputScalar; - typedef typename conditional::type OutputScalar; + typedef std::conditional_t OutputScalar; typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename traits::PointerType PointerType; @@ -90,7 +90,7 @@ class TensorFFTOp : public TensorBase::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename std::complex ComplexScalar; - typedef typename internal::conditional::type OutputScalar; + typedef std::conditional_t OutputScalar; typedef OutputScalar CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; @@ -103,7 +103,7 @@ class TensorFFTOp : public TensorBase::type& expression() const { + const internal::remove_all_t& expression() const { return m_xpr; } @@ -125,19 +125,19 @@ struct TensorEvaluator, D typedef typename TensorEvaluator::Dimensions InputDimensions; typedef internal::traits XprTraits; typedef typename XprTraits::Scalar InputScalar; - typedef typename internal::conditional::type OutputScalar; + typedef std::conditional_t OutputScalar; typedef OutputScalar CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = internal::unpacket_traits::size; - typedef StorageMemory Storage; + typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = true, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h index fdce7ad8f..9e782f012 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h @@ -39,13 +39,13 @@ class TensorFixedSize : public TensorBase0), PacketAccess = (internal::packet_traits::size > 1), BlockAccess = false, PreferBlockAccess = false, - Layout = Options_ & RowMajor ? RowMajor : ColMajor, CoordAccess = true, RawAccess = true }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h index 07a03b288..f16833063 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h @@ -31,7 +31,7 @@ struct traits > typedef typename traits::StorageKind StorageKind; typedef typename traits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -63,7 +63,7 @@ class TensorForcedEvalOp : public TensorBase, ReadOn public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; typedef typename Eigen::internal::traits::Index Index; @@ -72,7 +72,7 @@ class TensorForcedEvalOp : public TensorBase, ReadOn : m_xpr(expr) {} EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -105,7 +105,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void operator()(Index, StorageType) { template struct TensorEvaluator, Device> { - typedef const typename internal::remove_all::type ArgType; + typedef const internal::remove_all_t ArgType; typedef TensorForcedEvalOp XprType; typedef typename ArgType::Scalar Scalar; typedef typename TensorEvaluator::Dimensions Dimensions; @@ -122,10 +122,10 @@ struct TensorEvaluator, Device> PacketAccess = (PacketType::size > 1), BlockAccess = internal::is_arithmetic::value, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, RawAccess = true }; + static constexpr int Layout = TensorEvaluator::Layout; static const int NumDims = internal::traits::NumDimensions; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// @@ -150,11 +150,11 @@ struct TensorEvaluator, Device> internal::non_integral_type_placement_new()(numValues, m_buffer); - typedef TensorEvalToOp< const typename internal::remove_const::type > EvalTo; + typedef TensorEvalToOp< const std::remove_const_t > EvalTo; EvalTo evalToTmp(m_device.get(m_buffer), m_op); internal::TensorExecutor< - const EvalTo, typename internal::remove_const::type, + const EvalTo, std::remove_const_t, /*Vectorizable=*/internal::IsVectorizable::value, /*Tiling=*/internal::IsTileable::value>:: run(evalToTmp, m_device); @@ -169,14 +169,14 @@ struct TensorEvaluator, Device> const Index numValues = internal::array_prod(m_impl.dimensions()); m_buffer = m_device.get((CoeffReturnType*)m_device.allocate_temp( numValues * sizeof(CoeffReturnType))); - typedef TensorEvalToOp::type> + typedef TensorEvalToOp> EvalTo; EvalTo evalToTmp(m_device.get(m_buffer), m_op); auto on_done = std::bind([](EvalSubExprsCallback done_) { done_(true); }, std::move(done)); internal::TensorAsyncExecutor< - const EvalTo, typename internal::remove_const::type, + const EvalTo, std::remove_const_t, decltype(on_done), /*Vectorizable=*/internal::IsVectorizable::value, /*Tiling=*/internal::IsTileable::value>:: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h index f367641df..5a173909b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h @@ -30,7 +30,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -70,7 +70,7 @@ class TensorGeneratorOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -92,12 +92,12 @@ struct TensorEvaluator, Device> typedef typename PacketType::type PacketReturnType; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = true, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -157,7 +157,7 @@ struct TensorEvaluator, Device> const int packetSize = PacketType::size; eigen_assert(index+packetSize-1 < dimensions().TotalSize()); - EIGEN_ALIGN_MAX typename internal::remove_const::type values[packetSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[packetSize]; for (int i = 0; i < packetSize; ++i) { values[i] = coeff(index+i); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h index 2e655862e..2511d5a97 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h @@ -186,7 +186,7 @@ namespace internal { template struct TensorPrinter { static void run(std::ostream& s, const Tensor& _t, const TensorIOFormat& fmt) { - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename Tensor::Index IndexType; static const int layout = Tensor::Layout; // backwards compatibility case: print tensor after reshaping to matrix of size dim(0) x @@ -203,14 +203,14 @@ struct TensorPrinter { } assert(layout == RowMajor); - typedef typename conditional::value || is_same::value || - is_same::value || is_same::value, - int, - typename conditional >::value || - is_same >::value || - is_same >::value || - is_same >::value, - std::complex, const Scalar&>::type>::type PrintType; + typedef std::conditional_t::value || is_same::value || + is_same::value || is_same::value, + int, + std::conditional_t >::value || + is_same >::value || + is_same >::value || + is_same >::value, + std::complex, const Scalar&>> PrintType; const IndexType total_size = array_prod(_t.dimensions()); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h index cec95bb1e..4987e7ab1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h @@ -33,12 +33,12 @@ namespace internal { template struct traits > : public traits { - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef traits XprTraits; typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions + 1; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -189,7 +189,7 @@ class TensorImagePatchOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -220,7 +220,7 @@ struct TensorEvaluator, Device> static const int NumInputDims = internal::array_size::Dimensions>::value; static const int NumDims = NumInputDims + 1; typedef DSizes Dimensions; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef TensorEvaluator, Device> Self; typedef TensorEvaluator Impl; @@ -230,12 +230,12 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; @@ -541,7 +541,7 @@ struct TensorEvaluator, Device> protected: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packetWithPossibleZero(Index index) const { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index+i); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h index 38449536a..53592895c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h @@ -30,7 +30,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -68,7 +68,7 @@ class TensorInflationOp : public TensorBase, const Strides& strides() const { return m_strides; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -91,12 +91,12 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = /*TensorEvaluator::IsAligned*/ false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -204,7 +204,7 @@ struct TensorEvaluator, Device> EIGEN_STATIC_ASSERT((PacketSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE) eigen_assert(index+PacketSize-1 < dimensions().TotalSize()); - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index+i); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h index d99edad94..7afb775f2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h @@ -33,7 +33,7 @@ namespace internal { // Note: result is undefined if val == 0 template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE - typename internal::enable_if::type count_leading_zeros(const T val) + std::enable_if_t count_leading_zeros(const T val) { #ifdef EIGEN_GPU_COMPILE_PHASE return __clz(val); @@ -51,7 +51,7 @@ namespace internal { template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE - typename internal::enable_if::type count_leading_zeros(const T val) + std::enable_if_t count_leading_zeros(const T val) { #ifdef EIGEN_GPU_COMPILE_PHASE return __clzll(val); @@ -79,7 +79,7 @@ namespace internal { template struct UnsignedTraits { - typedef typename conditional::type type; + typedef std::conditional_t type; }; template diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h index 6a361ab48..0e6ee93e6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h @@ -45,7 +45,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = traits::NumDimensions; static const int Layout = (traits::Layout == ColMajor) ? RowMajor : ColMajor; typedef typename XprTraits::PointerType PointerType; @@ -74,7 +74,7 @@ class TensorLayoutSwapOp : public TensorBase, WriteA typedef TensorBase, WriteAccessors> Base; typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; typedef typename Eigen::internal::traits::Index Index; @@ -83,7 +83,7 @@ class TensorLayoutSwapOp : public TensorBase, WriteA : m_xpr(expr) {} EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorLayoutSwapOp) @@ -101,12 +101,12 @@ struct TensorEvaluator, Device> static const int NumDims = internal::array_size::Dimensions>::value; typedef DSizes Dimensions; + static constexpr int Layout = (TensorEvaluator::Layout == static_cast(ColMajor)) ? RowMajor : ColMajor; enum { IsAligned = TensorEvaluator::IsAligned, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = (static_cast(TensorEvaluator::Layout) == static_cast(ColMajor)) ? RowMajor : ColMajor, CoordAccess = false, // to be implemented RawAccess = TensorEvaluator::RawAccess }; @@ -180,12 +180,12 @@ template typedef TensorEvaluator, Device> Base; typedef TensorLayoutSwapOp XprType; + static constexpr int Layout = (TensorEvaluator::Layout == static_cast(ColMajor)) ? RowMajor : ColMajor; enum { IsAligned = TensorEvaluator::IsAligned, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = (static_cast(TensorEvaluator::Layout) == static_cast(ColMajor)) ? RowMajor : ColMajor, CoordAccess = false // to be implemented }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h index f7cd82763..7d8814acf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h @@ -14,7 +14,7 @@ /** use this macro in sfinae selection in templated functions * * template::value , int >::type = 0 + * std::enable_if_t< isBanana::value , int > = 0 * > * void foo(){} * @@ -27,7 +27,7 @@ */ #define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \ - typename internal::enable_if< ( __condition__ ) , int >::type = 0 + std::enable_if_t< ( __condition__ ) , int > = 0 // Define a macro to use a reference on the host but a value on the device #if defined(SYCL_DEVICE_ONLY) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h index 7a2bad4de..bc842669b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h @@ -34,7 +34,7 @@ template class MakePoin typedef TensorMap Self; typedef TensorBase > Base; #ifdef EIGEN_USE_SYCL - typedef typename Eigen::internal::remove_reference::type>::type Nested; + typedef std::remove_reference_t::type> Nested; #else typedef typename Eigen::internal::nested::type Nested; #endif @@ -51,29 +51,29 @@ template class MakePoin // example in TensorMap> expression. This type of // expression should be illegal, but adding this restriction is not possible // in practice (see https://bitbucket.org/eigen/eigen/pull-requests/488). - typedef typename internal::conditional< + typedef std::conditional_t< bool(internal::is_lvalue::value), PointerType, // use simple pointer in lvalue expressions PointerConstType // use const pointer in rvalue expressions - >::type StoragePointerType; + > StoragePointerType; // If TensorMap was constructed over rvalue expression (e.g. const Tensor), // we should return a reference to const from operator() (and others), even // if TensorMap itself is not const. - typedef typename internal::conditional< + typedef std::conditional_t< bool(internal::is_lvalue::value), Scalar&, const Scalar& - >::type StorageRefType; + > StorageRefType; static const int Options = Options_; static const Index NumIndices = PlainObjectType::NumIndices; typedef typename PlainObjectType::Dimensions Dimensions; + static constexpr int Layout = PlainObjectType::Layout; enum { IsAligned = ((int(Options_)&Aligned)==Aligned), - Layout = PlainObjectType::Layout, CoordAccess = true, RawAccess = true }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index ee955f0b0..c1546b628 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -30,7 +30,7 @@ struct traits > : public traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = array_size::value; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -58,7 +58,7 @@ class TensorReshapingOp : public TensorBase, WriteAccessors> Base; typedef typename Eigen::internal::traits::Scalar Scalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; typedef typename Eigen::internal::traits::Index Index; @@ -70,7 +70,7 @@ class TensorReshapingOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorReshapingOp) @@ -94,7 +94,7 @@ struct TensorEvaluator, Device> typedef typename PacketType::type PacketReturnType; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; - typedef StorageMemory::type, Device> ConstCastStorage; + typedef StorageMemory, Device> ConstCastStorage; static const int NumOutputDims = internal::array_size::value; static const int NumInputDims = internal::array_size::Dimensions>::value; @@ -114,6 +114,7 @@ struct TensorEvaluator, Device> : Runtime; // clang-format on + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned, PacketAccess = TensorEvaluator::PacketAccess, @@ -123,12 +124,11 @@ struct TensorEvaluator, Device> BlockAccess = TensorEvaluator::RawAccess && NumInputDims > 0 && NumOutputDims > 0, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = TensorEvaluator::RawAccess }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -243,12 +243,12 @@ template typedef TensorReshapingOp XprType; typedef NewDimensions Dimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = TensorEvaluator::IsAligned, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::RawAccess, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = TensorEvaluator::RawAccess }; @@ -313,7 +313,7 @@ struct traits > : public traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = array_size::value; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -355,7 +355,7 @@ class TensorSlicingOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorSlicingOp) @@ -414,9 +414,10 @@ struct TensorEvaluator, Devi typedef typename PacketType::type PacketReturnType; typedef Sizes Dimensions; typedef StorageMemory Storage; - typedef StorageMemory::type, Device> ConstCastStorage; + typedef StorageMemory, Device> ConstCastStorage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { // Alignment can't be guaranteed at compile time since it depends on the // slice offsets and sizes. @@ -424,14 +425,13 @@ struct TensorEvaluator, Devi PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::BlockAccess && // FIXME: Temporary workaround for bug in slicing of bool tensors. - !internal::is_same::type, bool>::value, + !internal::is_same, bool>::value, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -491,7 +491,7 @@ struct TensorEvaluator, Devi EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data) { m_impl.evalSubExprsIfNeeded(NULL); - if (!NumTraits::type>::RequireInitialization + if (!NumTraits>::RequireInitialization && data && m_impl.data()) { Index contiguous_values = 1; if (static_cast(Layout) == static_cast(ColMajor)) { @@ -587,7 +587,7 @@ struct TensorEvaluator, Devi return rslt; } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[packetSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[packetSize]; values[0] = m_impl.coeff(inputIndices[0]); values[packetSize-1] = m_impl.coeff(inputIndices[1]); EIGEN_UNROLL_LOOP @@ -712,17 +712,17 @@ struct TensorEvaluator, Device> typedef typename PacketType::type PacketReturnType; typedef Sizes Dimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::BlockAccess, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = (NumDims == 1) & TensorEvaluator::RawAccess }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -810,7 +810,7 @@ struct traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = array_size::value; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -856,7 +856,7 @@ class TensorStridingSlicingOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorStridingSlicingOp) @@ -882,6 +882,7 @@ struct TensorEvaluator::Layout; enum { // Alignment can't be guaranteed at compile time since it depends on the // slice offsets and sizes. @@ -889,7 +890,6 @@ struct TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, RawAccess = false }; @@ -1060,13 +1060,13 @@ struct TensorEvaluator, Device> Base; typedef TensorStridingSlicingOp XprType; static const int NumDims = internal::array_size::value; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = false, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = TensorEvaluator::CoordAccess, RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index de68013d3..de615132b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -30,7 +30,7 @@ struct traits > : public traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -72,7 +72,7 @@ class TensorPaddingOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -97,17 +97,17 @@ struct TensorEvaluator, Device typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = true, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = TensorEvaluator::RawAccess, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = true, RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -665,7 +665,7 @@ struct TensorEvaluator, Device EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packetWithPossibleZero(Index index) const { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index+i); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h index f43c68c75..4e86d119d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h @@ -30,7 +30,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions + 1; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -70,7 +70,7 @@ class TensorPatchOp : public TensorBase, ReadOn const PatchDim& patch_dims() const { return m_patch_dims; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -94,13 +94,12 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; - + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index eb44be266..39b33df4d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -499,9 +499,9 @@ __global__ EIGEN_HIP_LAUNCH_BOUNDS_1024 void OuterReductionKernel(R, const S, I_ template struct ReductionReturnType { #if defined(EIGEN_USE_SYCL) - typedef typename remove_const().initialize())>::type type; + typedef std::remove_const_t().initialize())> type; #else - typedef typename remove_const::type type; + typedef std::remove_const_t type; #endif }; @@ -513,7 +513,7 @@ class TensorReductionOp : public TensorBase::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; - typedef typename internal::remove_const::type CoeffReturnType; + typedef std::remove_const_t CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; typedef typename Eigen::internal::traits::StorageKind StorageKind; typedef typename Eigen::internal::traits::Index Index; @@ -554,7 +554,7 @@ struct TensorReductionEvaluatorBase::value; static const int NumReducedDims = internal::array_size::value; static const int NumOutputDims = NumInputDims - NumReducedDims; - typedef typename internal::conditional, DSizes >::type Dimensions; + typedef std::conditional_t, DSizes > Dimensions; typedef typename XprType::Scalar Scalar; typedef TensorReductionEvaluatorBase, Device> Self; static const bool InputPacketAccess = TensorEvaluator::PacketAccess; @@ -575,24 +575,24 @@ struct TensorReductionEvaluatorBase::value; static constexpr bool RunningOnSycl = false; #elif defined(EIGEN_USE_SYCL) -static const bool RunningOnSycl = internal::is_same::type, Eigen::SyclDevice>::value; +static const bool RunningOnSycl = internal::is_same, Eigen::SyclDevice>::value; static const bool RunningOnGPU = false; #else static constexpr bool RunningOnGPU = false; static constexpr bool RunningOnSycl = false; #endif + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = Self::InputPacketAccess && ReducerTraits::PacketAccess, BlockAccess = false, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockNotImplemented TensorBlock; @@ -843,7 +843,7 @@ static const bool RunningOnGPU = false; return internal::pload(m_result + index); } - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; if (ReducingInnerMostDims) { const Index num_values_to_reduce = (static_cast(Layout) == static_cast(ColMajor)) ? m_preservedStrides[0] : m_preservedStrides[NumPreservedStrides - 1]; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h index a73bc7874..a4bef4733 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h @@ -394,10 +394,10 @@ struct FullReductionLauncher { template struct FullReductionLauncher< Self, Op, OutputType, PacketAccess, - typename internal::enable_if< + std::enable_if_t< internal::is_same::value || internal::is_same::value, - void>::type> { + void>> { static void run(const Self& self, Op& reducer, const GpuDevice& device, OutputType* output, typename Self::Index num_coeffs) { typedef typename Self::Index Index; @@ -764,10 +764,10 @@ struct InnerReductionLauncher { template struct InnerReductionLauncher< Self, Op, OutputType, PacketAccess, - typename internal::enable_if< + std::enable_if_t< internal::is_same::value || internal::is_same::value, - void>::type> { + void>> { static bool run(const Self& self, Op& reducer, const GpuDevice& device, OutputType* output, typename Self::Index num_coeffs_to_reduce, typename Self::Index num_preserved_vals) { typedef typename Self::Index Index; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h index 0f65fc673..397870fcf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h @@ -127,9 +127,8 @@ class FullReductionKernelFunctor { typedef typename OpDef::type Op; typedef typename Evaluator::EvaluatorPointerType EvaluatorPointerType; typedef typename Evaluator::PacketReturnType PacketReturnType; - typedef - typename ::Eigen::internal::conditional<(Evaluator::ReducerTraits::PacketAccess & Evaluator::InputPacketAccess), - PacketReturnType, CoeffReturnType>::type OutType; + typedef std::conditional_t<(Evaluator::ReducerTraits::PacketAccess & Evaluator::InputPacketAccess), + PacketReturnType, CoeffReturnType> OutType; typedef cl::sycl::accessor LocalAccessor; LocalAccessor scratch; @@ -145,7 +144,7 @@ class FullReductionKernelFunctor { void operator()(cl::sycl::nd_item<1> itemID) { compute_reduction(itemID); } template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if::type compute_reduction( + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t compute_reduction( const cl::sycl::nd_item<1> &itemID) { auto output_ptr = final_output.get_pointer(); Index VectorizedRange = (rng / Evaluator::PacketSize) * Evaluator::PacketSize; @@ -184,7 +183,7 @@ class FullReductionKernelFunctor { } template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ::Eigen::internal::enable_if::type compute_reduction( + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t compute_reduction( const cl::sycl::nd_item<1> &itemID) { auto output_ptr = final_output.get_pointer(); Index globalid = itemID.get_global_id(0); @@ -483,7 +482,7 @@ struct FullReducer { static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true; static EIGEN_CONSTEXPR int PacketSize = Self::PacketAccess ? Self::PacketSize : 1; static void run(const Self &self, Op &reducer, const Eigen::SyclDevice &dev, EvaluatorPointerType data) { - typedef typename conditional::type OutType; + typedef std::conditional_t OutType; static_assert(!((EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1) & (EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)), "The Local thread size must be a power of 2 for the reduction " diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h index 67062691d..3813d93d9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h @@ -98,13 +98,13 @@ class TensorLazyEvaluatorWritable : public TensorLazyEvaluatorReadOnly -class TensorLazyEvaluator : public internal::conditional::value), +class TensorLazyEvaluator : public std::conditional_t::value), TensorLazyEvaluatorWritable, - TensorLazyEvaluatorReadOnly >::type { + TensorLazyEvaluatorReadOnly > { public: - typedef typename internal::conditional::value), - TensorLazyEvaluatorWritable, - TensorLazyEvaluatorReadOnly >::type Base; + typedef std::conditional_t::value), + TensorLazyEvaluatorWritable, + TensorLazyEvaluatorReadOnly > Base; typedef typename Base::Scalar Scalar; TensorLazyEvaluator(const Expr& expr, const Device& device) : Base(expr, device) { @@ -140,12 +140,12 @@ template class TensorRef : public TensorBase, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorRef::Layout; enum { IsAligned = false, PacketAccess = false, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorRef::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h index 74d5726c3..679977d6e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h @@ -30,7 +30,7 @@ struct traits::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -73,7 +73,7 @@ class TensorReverseOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorReverseOp) @@ -99,12 +99,12 @@ struct TensorEvaluator, Device typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = NumDims > 0, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -219,7 +219,7 @@ struct TensorEvaluator, Device // TODO(ndjaitly): write a better packing routine that uses // local structure. - EIGEN_ALIGN_MAX typename internal::remove_const::type + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { @@ -417,12 +417,12 @@ struct TensorEvaluator, Device> static const int NumDims = internal::array_size::value; typedef DSizes Dimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h index eac70cbab..3b49aaea7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h @@ -23,7 +23,7 @@ struct traits > typedef traits XprTraits; typedef typename XprTraits::StorageKind StorageKind; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -383,19 +383,19 @@ struct TensorEvaluator, Device> { typedef const ArgType ChildType; static const int NumDims = internal::array_size::Dimensions>::value; typedef DSizes Dimensions; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; typedef TensorEvaluator, Device> Self; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = false, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = true }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h index 5b4942b76..636fb7d71 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h @@ -107,27 +107,27 @@ struct ScanKernelFunctor { inclusive(inclusive_) {} template - typename ::Eigen::internal::enable_if::type EIGEN_DEVICE_FUNC + std::enable_if_t EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE read(const Input &inpt, Index global_id) { return inpt.coeff(global_id); } template - typename ::Eigen::internal::enable_if::type EIGEN_DEVICE_FUNC + std::enable_if_t EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE read(const Input &inpt, Index global_id) { return inpt[global_id]; } template - typename ::Eigen::internal::enable_if::type EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + std::enable_if_t EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE first_step_inclusive_Operation(InclusiveOp inclusive_op) { inclusive_op(); } template - typename ::Eigen::internal::enable_if::type EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + std::enable_if_t EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE first_step_inclusive_Operation(InclusiveOp) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void operator()(cl::sycl::nd_item<1> itemID) { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 3b68c403e..6c7f0a41e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -30,7 +30,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -71,7 +71,7 @@ class TensorShufflingOp : public TensorBase const Shuffle& shufflePermutation() const { return m_shuffle; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorShufflingOp) @@ -99,17 +99,17 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = TensorEvaluator::RawAccess, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -196,7 +196,7 @@ struct TensorEvaluator, Device> struct PacketLoader { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE static PacketReturnType Run(const Self& self, Index index) { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = self.coeff(index + i); @@ -213,7 +213,7 @@ struct TensorEvaluator, Device> if (self.m_is_identity) { return self.m_impl.template packet(index); } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = self.coeff(index + i); @@ -370,17 +370,17 @@ struct TensorEvaluator, Device> typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = (PacketType::size > 1), BlockAccess = TensorEvaluator::RawAccess, PreferBlockAccess = true, - Layout = TensorEvaluator::Layout, RawAccess = false }; - typedef typename internal::remove_const::type ScalarNoConst; + typedef std::remove_const_t ScalarNoConst; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; @@ -398,7 +398,7 @@ struct TensorEvaluator, Device> template EIGEN_STRONG_INLINE void writePacket(Index index, const PacketReturnType& x) { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; internal::pstore(values, x); EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h index 8d22f3ced..f836659a9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h @@ -30,7 +30,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -71,7 +71,7 @@ class TensorStridingOp : public TensorBase > const Strides& strides() const { return m_dims; } EIGEN_DEVICE_FUNC - const typename internal::remove_all::type& + const internal::remove_all_t& expression() const { return m_xpr; } EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorStridingOp) @@ -97,12 +97,12 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = /*TensorEvaluator::IsAligned*/false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; @@ -195,7 +195,7 @@ struct TensorEvaluator, Device> return rslt; } else { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; values[0] = m_impl.coeff(inputIndices[0]); values[PacketSize-1] = m_impl.coeff(inputIndices[1]); EIGEN_UNROLL_LOOP @@ -270,11 +270,11 @@ struct TensorEvaluator, Device> static const int NumDims = internal::array_size::Dimensions>::value; // typedef DSizes Dimensions; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = /*TensorEvaluator::IsAligned*/false, PacketAccess = TensorEvaluator::PacketAccess, PreferBlockAccess = false, - Layout = TensorEvaluator::Layout, CoordAccess = false, // to be implemented RawAccess = false }; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h index 51409069d..f2a6c5fcd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h @@ -32,7 +32,7 @@ struct traits > : public traits typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions - array_size::value; static const int Layout = XprTraits::Layout; }; @@ -71,7 +71,7 @@ class TensorTraceOp : public TensorBase > const Dims& dims() const { return m_dims; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const typename internal::remove_all::type& expression() const { return m_xpr; } + const internal::remove_all_t& expression() const { return m_xpr; } protected: typename XprType::Nested m_xpr; @@ -96,12 +96,12 @@ struct TensorEvaluator, Device> typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; @@ -247,7 +247,7 @@ struct TensorEvaluator, Device> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const { eigen_assert(index + PacketSize - 1 < dimensions().TotalSize()); - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index + i); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h b/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h index 7d49b4817..37be364d7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h @@ -57,7 +57,7 @@ struct TensorUInt128 template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE explicit TensorUInt128(const T& x) : high(0), low(x) { - eigen_assert((static_cast::type>(x) <= NumTraits::highest())); + eigen_assert((static_cast>(x) <= NumTraits::highest())); eigen_assert(x >= 0); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h index 3f0b3c278..a6fddba30 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h @@ -28,12 +28,12 @@ namespace internal { template struct traits > : public traits { - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef traits XprTraits; typedef typename XprTraits::StorageKind StorageKind; typedef typename XprTraits::Index Index; typedef typename XprType::Nested Nested; - typedef typename remove_reference::type Nested_; + typedef std::remove_reference_t Nested_; static const int NumDimensions = XprTraits::NumDimensions + 1; static const int Layout = XprTraits::Layout; typedef typename XprTraits::PointerType PointerType; @@ -137,7 +137,7 @@ class TensorVolumePatchOp : public TensorBase::type& + const internal::remove_all_t& expression() const { return m_xpr; } protected: @@ -175,19 +175,19 @@ struct TensorEvaluator, D static const int NumInputDims = internal::array_size::Dimensions>::value; static const int NumDims = NumInputDims + 1; typedef DSizes Dimensions; - typedef typename internal::remove_const::type Scalar; + typedef std::remove_const_t Scalar; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename PacketType::type PacketReturnType; static const int PacketSize = PacketType::size; typedef StorageMemory Storage; typedef typename Storage::Type EvaluatorPointerType; + static constexpr int Layout = TensorEvaluator::Layout; enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, BlockAccess = false, PreferBlockAccess = TensorEvaluator::PreferBlockAccess, - Layout = TensorEvaluator::Layout, CoordAccess = false, RawAccess = false }; @@ -544,7 +544,7 @@ struct TensorEvaluator, D protected: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packetWithPossibleZero(Index index) const { - EIGEN_ALIGN_MAX typename internal::remove_const::type values[PacketSize]; + EIGEN_ALIGN_MAX std::remove_const_t values[PacketSize]; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; ++i) { values[i] = coeff(index+i); diff --git a/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h b/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h index d47f28ece..a95f79c4f 100644 --- a/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h +++ b/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h @@ -239,11 +239,11 @@ struct tensor_symmetry_pre_analysis typedef tensor_static_symgroup_if<(sizeof...(Gens_) + 1 <= max_static_generators), NumIndices, Gen_, Gens_...> helper; constexpr static std::size_t possible_size = helper::size; - typedef typename conditional< + typedef std::conditional_t< possible_size == 0 || possible_size >= max_static_elements, DynamicSGroupFromTemplateArgs, typename helper::type - >::type root_type; + > root_type; }; template diff --git a/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h b/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h index a404c3954..c27d1ed8f 100644 --- a/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h +++ b/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h @@ -128,11 +128,11 @@ template< > struct strip_identities> { - typedef typename conditional< + typedef std::conditional_t< Equality::value, typename strip_identities>::type, typename concat, typename strip_identities>::type>::type - >::type type; + > type; constexpr static int global_flags = Equality::global_flags | strip_identities>::global_flags; }; diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 855e83c49..47b0b344b 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -68,14 +68,14 @@ inline AutoDiffScalar MakeAutoDiffScalar(const typename NewDerType:: template class AutoDiffScalar : public internal::auto_diff_special_op - ::type>::Scalar, - typename NumTraits::type>::Scalar>::Real>::value> + >::Scalar, + typename NumTraits>::Scalar>::Real>::value> { public: typedef internal::auto_diff_special_op - ::type>::Scalar, - typename NumTraits::type>::Scalar>::Real>::value> Base; - typedef typename internal::remove_all::type DerType; + >::Scalar, + typename NumTraits>::Scalar>::Real>::value> Base; + typedef internal::remove_all_t DerType; typedef typename internal::traits::Scalar Scalar; typedef typename NumTraits::Real Real; @@ -110,9 +110,9 @@ class AutoDiffScalar template AutoDiffScalar(const AutoDiffScalar& other #ifndef EIGEN_PARSED_BY_DOXYGEN - , typename internal::enable_if< - internal::is_same::type>::Scalar>::value - && internal::is_convertible::value , void*>::type = 0 + , std::enable_if_t< + internal::is_same>::Scalar>::value + && internal::is_convertible::value , void*> = 0 #endif ) : m_value(other.value()), m_derivatives(other.derivatives()) @@ -207,11 +207,11 @@ class AutoDiffScalar } template - inline AutoDiffScalar,const DerType,const typename internal::remove_all::type> > + inline AutoDiffScalar,const DerType,const internal::remove_all_t> > operator+(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); - return AutoDiffScalar,const DerType,const typename internal::remove_all::type> >( + return AutoDiffScalar,const DerType,const internal::remove_all_t> >( m_value + other.value(), m_derivatives + other.derivatives()); } @@ -243,11 +243,11 @@ class AutoDiffScalar } template - inline AutoDiffScalar, const DerType,const typename internal::remove_all::type> > + inline AutoDiffScalar, const DerType,const internal::remove_all_t> > operator-(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); - return AutoDiffScalar, const DerType,const typename internal::remove_all::type> >( + return AutoDiffScalar, const DerType,const internal::remove_all_t> >( m_value - other.value(), m_derivatives - other.derivatives()); } @@ -328,7 +328,7 @@ class AutoDiffScalar inline AutoDiffScalar EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType,Scalar,product) EIGEN_COMMA - const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,Scalar,product) >,Scalar,product) > + const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(internal::remove_all_t,Scalar,product) >,Scalar,product) > operator/(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); @@ -341,7 +341,7 @@ class AutoDiffScalar template inline AutoDiffScalar, const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType,Scalar,product), - const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,Scalar,product) > > + const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(internal::remove_all_t,Scalar,product) > > operator*(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); @@ -389,7 +389,7 @@ struct auto_diff_special_op // : auto_diff_scalar_op::Real, // is_same::Real>::value> { - typedef typename remove_all::type DerType; + typedef remove_all_t DerType; typedef typename traits::Scalar Scalar; typedef typename NumTraits::Real Real; @@ -559,17 +559,17 @@ struct ScalarBinaryOpTraits, Bi #define EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(FUNC,CODE) \ template \ inline Eigen::AutoDiffScalar< \ - EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename Eigen::internal::remove_all::type, typename Eigen::internal::traits::type>::Scalar, product) > \ + EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Eigen::internal::remove_all_t, typename Eigen::internal::traits>::Scalar, product) > \ FUNC(const Eigen::AutoDiffScalar& x) { \ using namespace Eigen; \ - typedef typename Eigen::internal::traits::type>::Scalar Scalar; \ + typedef typename Eigen::internal::traits>::Scalar Scalar; \ EIGEN_UNUSED_VARIABLE(sizeof(Scalar)); \ CODE; \ } template struct CleanedUpDerType { - typedef AutoDiffScalar::type::PlainObject> type; + typedef AutoDiffScalar::PlainObject> type; }; template @@ -642,8 +642,8 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(log, template inline Eigen::AutoDiffScalar< -EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,typename internal::traits::type>::Scalar,product) > -pow(const Eigen::AutoDiffScalar &x, const typename internal::traits::type>::Scalar &y) +EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(internal::remove_all_t, typename internal::traits>::Scalar,product) > +pow(const Eigen::AutoDiffScalar &x, const typename internal::traits>::Scalar &y) { using namespace Eigen; using std::pow; @@ -652,11 +652,11 @@ pow(const Eigen::AutoDiffScalar &x, const typename internal::traits -inline AutoDiffScalar::type>::Scalar,Dynamic,1> > +inline AutoDiffScalar>::Scalar,Dynamic,1> > atan2(const AutoDiffScalar& a, const AutoDiffScalar& b) { using std::atan2; - typedef typename internal::traits::type>::Scalar Scalar; + typedef typename internal::traits>::Scalar Scalar; typedef AutoDiffScalar > PlainADS; PlainADS ret; ret.value() = atan2(a.value(), b.value()); @@ -702,9 +702,9 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(cosh, #undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY template struct NumTraits > - : NumTraits< typename NumTraits::type::Scalar>::Real > + : NumTraits< typename NumTraits::Scalar>::Real > { - typedef typename internal::remove_all::type DerTypeCleaned; + typedef internal::remove_all_t DerTypeCleaned; typedef AutoDiffScalar::Real,DerTypeCleaned::RowsAtCompileTime,DerTypeCleaned::ColsAtCompileTime, 0, DerTypeCleaned::MaxRowsAtCompileTime, DerTypeCleaned::MaxColsAtCompileTime> > Real; typedef AutoDiffScalar NonInteger; diff --git a/unsupported/Eigen/src/EulerAngles/EulerSystem.h b/unsupported/Eigen/src/EulerAngles/EulerSystem.h index 34c121e7a..bf5804de9 100644 --- a/unsupported/Eigen/src/EulerAngles/EulerSystem.h +++ b/unsupported/Eigen/src/EulerAngles/EulerSystem.h @@ -262,7 +262,7 @@ namespace Eigen { CalcEulerAngles_imp( res.angles(), mat, - typename internal::conditional::type()); + std::conditional_t()); if (IsAlphaOpposite) res.alpha() = -res.alpha(); diff --git a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h index 91e60d801..0387ef3ce 100644 --- a/unsupported/Eigen/src/IterativeSolvers/DGMRES.h +++ b/unsupported/Eigen/src/IterativeSolvers/DGMRES.h @@ -421,7 +421,7 @@ template< typename MatrixType_, typename Preconditioner_> Index DGMRES::dgmresComputeDeflationData(const MatrixType& mat, const Preconditioner& precond, const Index& it, StorageIndex& neig) const { // First, find the Schur form of the Hessenberg matrix H - typename internal::conditional::IsComplex, ComplexSchur, RealSchur >::type schurofH; + std::conditional_t::IsComplex, ComplexSchur, RealSchur > schurofH; bool computeU = true; DenseMatrix matrixQ(it,it); matrixQ.setIdentity(); diff --git a/unsupported/Eigen/src/IterativeSolvers/MINRES.h b/unsupported/Eigen/src/IterativeSolvers/MINRES.h index ac78c0e33..22827776c 100644 --- a/unsupported/Eigen/src/IterativeSolvers/MINRES.h +++ b/unsupported/Eigen/src/IterativeSolvers/MINRES.h @@ -245,12 +245,12 @@ namespace Eigen { && (!MatrixType::IsRowMajor) && (!NumTraits::IsComplex) }; - typedef typename internal::conditional, ActualMatrixType const&>::type RowMajorWrapper; + typedef std::conditional_t, ActualMatrixType const&> RowMajorWrapper; EIGEN_STATIC_ASSERT(internal::check_implication(MatrixWrapper::MatrixFree, UpLo==(Lower|Upper)),MATRIX_FREE_CONJUGATE_GRADIENT_IS_COMPATIBLE_WITH_UPPER_UNION_LOWER_MODE_ONLY); - typedef typename internal::conditional::Type - >::type SelfAdjointWrapper; + > SelfAdjointWrapper; m_iterations = Base::maxIterations(); m_error = Base::m_tolerance; diff --git a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h index 5524e3e2c..3aecf9e66 100644 --- a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +++ b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h @@ -154,10 +154,10 @@ void KroneckerProductSparse::evalTo(Dest& dst) const // 1 - evaluate the operands if needed: typedef typename internal::nested_eval::type Lhs1; - typedef typename internal::remove_all::type Lhs1Cleaned; + typedef internal::remove_all_t Lhs1Cleaned; const Lhs1 lhs1(m_A); typedef typename internal::nested_eval::type Rhs1; - typedef typename internal::remove_all::type Rhs1Cleaned; + typedef internal::remove_all_t Rhs1Cleaned; const Rhs1 rhs1(m_B); // 2 - construct respective iterators @@ -203,8 +203,8 @@ namespace internal { template struct traits > { - typedef typename remove_all::type Lhs; - typedef typename remove_all::type Rhs; + typedef remove_all_t Lhs; + typedef remove_all_t Rhs; typedef typename ScalarBinaryOpTraits::ReturnType Scalar; typedef typename promote_index_type::type StorageIndex; @@ -222,8 +222,8 @@ template struct traits > { typedef MatrixXpr XprKind; - typedef typename remove_all::type Lhs; - typedef typename remove_all::type Rhs; + typedef remove_all_t Lhs; + typedef remove_all_t Rhs; typedef typename ScalarBinaryOpTraits::ReturnType Scalar; typedef typename cwise_promote_storage_type::StorageKind, typename traits::StorageKind, scalar_product_op >::ret StorageKind; typedef typename promote_index_type::type StorageIndex; diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h index bd322753d..8076bf5ab 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h @@ -496,7 +496,7 @@ template class MatrixFunctionReturnValue inline void evalTo(ResultType& result) const { typedef typename internal::nested_eval::type NestedEvalType; - typedef typename internal::remove_all::type NestedEvalTypeClean; + typedef internal::remove_all_t NestedEvalTypeClean; typedef internal::traits Traits; typedef std::complex::Real> ComplexScalar; typedef Matrix DynMatrixType; diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h index 63e4dad94..bb778854d 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h @@ -334,7 +334,7 @@ public: inline void evalTo(ResultType& result) const { typedef typename internal::nested_eval::type DerivedEvalType; - typedef typename internal::remove_all::type DerivedEvalTypeClean; + typedef internal::remove_all_t DerivedEvalTypeClean; typedef internal::traits Traits; typedef std::complex::Real> ComplexScalar; typedef Matrix DynMatrixType; diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h index 5e184eaf5..6c58cae66 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h @@ -338,7 +338,7 @@ template class MatrixSquareRootReturnValue inline void evalTo(ResultType& result) const { typedef typename internal::nested_eval::type DerivedEvalType; - typedef typename internal::remove_all::type DerivedEvalTypeClean; + typedef internal::remove_all_t DerivedEvalTypeClean; DerivedEvalType tmp(m_src); internal::matrix_sqrt_compute::run(tmp, result); } diff --git a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h index 0c44ca88b..64cab1204 100644 --- a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h +++ b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h @@ -339,10 +339,10 @@ class PolynomialSolver : public PolynomialSolverBase EIGEN_POLYNOMIAL_SOLVER_BASE_INHERITED_TYPES( PS_Base ) typedef Matrix CompanionMatrixType; - typedef typename internal::conditional::IsComplex, - ComplexEigenSolver, - EigenSolver >::type EigenSolverType; - typedef typename internal::conditional::IsComplex, Scalar, std::complex >::type ComplexScalar; + typedef std::conditional_t::IsComplex, + ComplexEigenSolver, + EigenSolver > EigenSolverType; + typedef std::conditional_t::IsComplex, Scalar, std::complex > ComplexScalar; public: /** Computes the complex roots of a new polynomial. */ diff --git a/unsupported/Eigen/src/Skyline/SkylineProduct.h b/unsupported/Eigen/src/Skyline/SkylineProduct.h index f3ea46ea7..03f4269e3 100644 --- a/unsupported/Eigen/src/Skyline/SkylineProduct.h +++ b/unsupported/Eigen/src/Skyline/SkylineProduct.h @@ -25,8 +25,8 @@ struct SkylineProductReturnType { template struct internal::traits > { // clean the nested types: - typedef typename internal::remove_all::type LhsNested_; - typedef typename internal::remove_all::type RhsNested_; + typedef internal::remove_all_t LhsNested_; + typedef internal::remove_all_t RhsNested_; typedef typename LhsNested_::Scalar Scalar; enum { @@ -54,9 +54,9 @@ struct internal::traits > { CoeffReadCost = HugeCost }; - typedef typename internal::conditional >, - MatrixBase > >::type Base; + MatrixBase > > Base; }; namespace internal { @@ -122,8 +122,8 @@ protected: template EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) { - typedef typename remove_all::type Lhs_; - typedef typename remove_all::type Rhs_; + typedef remove_all_t Lhs_; + typedef remove_all_t Rhs_; typedef typename traits::Scalar Scalar; enum { @@ -185,8 +185,8 @@ EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, cons template EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) { - typedef typename remove_all::type Lhs_; - typedef typename remove_all::type Rhs_; + typedef remove_all_t Lhs_; + typedef remove_all_t Rhs_; typedef typename traits::Scalar Scalar; enum { @@ -253,7 +253,7 @@ template struct skyline_product_selector { - typedef typename traits::type>::Scalar Scalar; + typedef typename traits>::Scalar Scalar; static void run(const Lhs& lhs, const Rhs& rhs, ResultType & res) { skyline_row_major_time_dense_product (lhs, rhs, res); @@ -262,7 +262,7 @@ struct skyline_product_selector { template struct skyline_product_selector { - typedef typename traits::type>::Scalar Scalar; + typedef typename traits>::Scalar Scalar; static void run(const Lhs& lhs, const Rhs& rhs, ResultType & res) { skyline_col_major_time_dense_product (lhs, rhs, res); @@ -274,9 +274,9 @@ struct skyline_product_selector { // template // template // Derived & MatrixBase::lazyAssign(const SkylineProduct& product) { -// typedef typename internal::remove_all::type Lhs_; -// internal::skyline_product_selector::type, -// typename internal::remove_all::type, +// typedef internal::remove_all_t Lhs_; +// internal::skyline_product_selector, +// internal::remove_all_t, // Derived>::run(product.lhs(), product.rhs(), derived()); // // return derived(); diff --git a/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h index 60e90ba78..853fbb0c0 100644 --- a/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h +++ b/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h @@ -304,7 +304,7 @@ class BlockSparseMatrix : public SparseMatrixBase BlockScalar; typedef Matrix BlockRealScalar; - typedef typename internal::conditional<_BlockAtCompileTime==Dynamic, Scalar, BlockScalar>::type BlockScalarReturnType; + typedef std::conditional_t<_BlockAtCompileTime==Dynamic, Scalar, BlockScalar> BlockScalarReturnType; typedef BlockSparseMatrix PlainObject; public: // Default constructor @@ -939,7 +939,7 @@ class BlockSparseMatrix : public SparseMatrixBase::type()); + //return blockDynIdx(id, std::conditional_t<(BlockSize==Dynamic), internal::true_type, internal::false_type>()); } diff --git a/unsupported/test/cxx11_tensor_casts.cpp b/unsupported/test/cxx11_tensor_casts.cpp index 45456f3ef..7b67738ea 100644 --- a/unsupported/test/cxx11_tensor_casts.cpp +++ b/unsupported/test/cxx11_tensor_casts.cpp @@ -149,7 +149,7 @@ struct test_cast_runner { // Only certain types allow cast from std::complex<>. template -struct test_cast_runner::IsComplex>::type> { +struct test_cast_runner::IsComplex>> { static void run() { test_type_cast(); test_type_cast(); diff --git a/unsupported/test/cxx11_tensor_fft.cpp b/unsupported/test/cxx11_tensor_fft.cpp index 2e1008eca..ff8ebcff0 100644 --- a/unsupported/test/cxx11_tensor_fft.cpp +++ b/unsupported/test/cxx11_tensor_fft.cpp @@ -186,7 +186,7 @@ static void test_fft_real_input_energy() { } const DSizes arr = dimensions; - typedef typename internal::conditional, RealScalar>::type InputScalar; + typedef std::conditional_t, RealScalar> InputScalar; Tensor input; input.resize(arr); @@ -197,7 +197,7 @@ static void test_fft_real_input_energy() { fft[i] = i; } - typedef typename internal::conditional, RealScalar>::type OutputScalar; + typedef std::conditional_t, RealScalar> OutputScalar; Tensor output; output = input.template fft(fft); diff --git a/unsupported/test/matrix_power.cpp b/unsupported/test/matrix_power.cpp index ab1a030b8..b13eb5ace 100644 --- a/unsupported/test/matrix_power.cpp +++ b/unsupported/test/matrix_power.cpp @@ -104,8 +104,8 @@ void testSingular(const MatrixType& m_const, const typename MatrixType::RealScal MatrixType& m = const_cast(m_const); const int IsComplex = NumTraits::Scalar>::IsComplex; - typedef typename internal::conditional, const MatrixType&>::type TriangularType; - typename internal::conditional< IsComplex, ComplexSchur, RealSchur >::type schur; + typedef std::conditional_t, const MatrixType&> TriangularType; + std::conditional_t< IsComplex, ComplexSchur, RealSchur > schur; MatrixType T; for (int i=0; i < g_repeat; ++i) {