mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Replace Eigen type metaprogramming with corresponding std types and make use of alias templates
This commit is contained in:
committed by
Antonio Sánchez
parent
514f90c9ff
commit
421cbf0866
@@ -37,7 +37,7 @@ struct traits<Homogeneous<MatrixType,Direction> >
|
||||
{
|
||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNested_;
|
||||
typedef std::remove_reference_t<MatrixTypeNested> MatrixTypeNested_;
|
||||
enum {
|
||||
RowsPlusOne = (MatrixType::RowsAtCompileTime != Dynamic) ?
|
||||
int(MatrixType::RowsAtCompileTime) + 1 : Dynamic,
|
||||
@@ -227,7 +227,7 @@ template<typename Scalar, int Dim, int Mode,int Options>
|
||||
struct take_matrix_for_product<Transform<Scalar, Dim, Mode, Options> >
|
||||
{
|
||||
typedef Transform<Scalar, Dim, Mode, Options> TransformType;
|
||||
typedef typename internal::add_const<typename TransformType::ConstAffinePart>::type type;
|
||||
typedef std::add_const_t<typename TransformType::ConstAffinePart> type;
|
||||
EIGEN_DEVICE_FUNC static type run (const TransformType& x) { return x.affine(); }
|
||||
};
|
||||
|
||||
@@ -243,8 +243,8 @@ template<typename MatrixType,typename Lhs>
|
||||
struct traits<homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
||||
{
|
||||
typedef typename take_matrix_for_product<Lhs>::type LhsMatrixType;
|
||||
typedef typename remove_all<MatrixType>::type MatrixTypeCleaned;
|
||||
typedef typename remove_all<LhsMatrixType>::type LhsMatrixTypeCleaned;
|
||||
typedef remove_all_t<MatrixType> MatrixTypeCleaned;
|
||||
typedef remove_all_t<LhsMatrixType> LhsMatrixTypeCleaned;
|
||||
typedef typename make_proper_matrix_type<
|
||||
typename traits<MatrixTypeCleaned>::Scalar,
|
||||
LhsMatrixTypeCleaned::RowsAtCompileTime,
|
||||
@@ -259,8 +259,8 @@ struct homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
|
||||
: public ReturnByValue<homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
||||
{
|
||||
typedef typename traits<homogeneous_left_product_impl>::LhsMatrixType LhsMatrixType;
|
||||
typedef typename remove_all<LhsMatrixType>::type LhsMatrixTypeCleaned;
|
||||
typedef typename remove_all<typename LhsMatrixTypeCleaned::Nested>::type LhsMatrixTypeNested;
|
||||
typedef remove_all_t<LhsMatrixType> LhsMatrixTypeCleaned;
|
||||
typedef remove_all_t<typename LhsMatrixTypeCleaned::Nested> LhsMatrixTypeNested;
|
||||
EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
|
||||
: m_lhs(take_matrix_for_product<Lhs>::run(lhs)),
|
||||
m_rhs(rhs)
|
||||
@@ -301,7 +301,7 @@ template<typename MatrixType,typename Rhs>
|
||||
struct homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
|
||||
: public ReturnByValue<homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
|
||||
{
|
||||
typedef typename remove_all<typename Rhs::Nested>::type RhsNested;
|
||||
typedef remove_all_t<typename Rhs::Nested> 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<Dim>::Type LinearBlockConst;
|
||||
typedef typename remove_const<LinearBlockConst>::type LinearBlock;
|
||||
typedef std::remove_const_t<LinearBlockConst> LinearBlock;
|
||||
typedef typename Rhs::ConstRowXpr ConstantColumn;
|
||||
typedef Replicate<const ConstantColumn,Rows,1> ConstantBlock;
|
||||
typedef Product<Lhs,LinearBlock,LazyProduct> LinearProduct;
|
||||
@@ -457,7 +457,7 @@ struct homogeneous_left_product_refactoring_helper
|
||||
Cols = Rhs::ColsAtCompileTime
|
||||
};
|
||||
typedef typename Lhs::template ConstNColsBlockXpr<Dim>::Type LinearBlockConst;
|
||||
typedef typename remove_const<LinearBlockConst>::type LinearBlock;
|
||||
typedef std::remove_const_t<LinearBlockConst> LinearBlock;
|
||||
typedef typename Lhs::ConstColXpr ConstantColumn;
|
||||
typedef Replicate<const ConstantColumn,1,Cols> ConstantBlock;
|
||||
typedef Product<LinearBlock,Rhs,LazyProduct> LinearProduct;
|
||||
|
||||
@@ -93,8 +93,8 @@ MatrixBase<Derived>::cross3(const MatrixBase<OtherDerived>& other) const
|
||||
OtherDerivedNested rhs(other.derived());
|
||||
|
||||
return internal::cross3_impl<Architecture::Target,
|
||||
typename internal::remove_all<DerivedNested>::type,
|
||||
typename internal::remove_all<OtherDerivedNested>::type>::run(lhs,rhs);
|
||||
internal::remove_all_t<DerivedNested>,
|
||||
internal::remove_all_t<OtherDerivedNested>>::run(lhs,rhs);
|
||||
}
|
||||
|
||||
/** \geometry_module \ingroup Geometry_Module
|
||||
|
||||
@@ -46,8 +46,8 @@ class QuaternionBase : public RotationBase<Derived, 3>
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef typename internal::traits<Derived>::Coefficients Coefficients;
|
||||
typedef typename Coefficients::CoeffReturnType CoeffReturnType;
|
||||
typedef typename internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit),
|
||||
Scalar&, CoeffReturnType>::type NonConstCoeffReturnType;
|
||||
typedef std::conditional_t<bool(internal::traits<Derived>::Flags&LvalueBit),
|
||||
Scalar&, CoeffReturnType> NonConstCoeffReturnType;
|
||||
|
||||
|
||||
enum {
|
||||
@@ -200,14 +200,14 @@ class QuaternionBase : public RotationBase<Derived, 3>
|
||||
|
||||
template<typename NewScalarType>
|
||||
EIGEN_DEVICE_FUNC inline
|
||||
typename internal::enable_if<internal::is_same<Scalar,NewScalarType>::value,const Derived&>::type cast() const
|
||||
std::enable_if_t<internal::is_same<Scalar,NewScalarType>::value,const Derived&> cast() const
|
||||
{
|
||||
return derived();
|
||||
}
|
||||
|
||||
template<typename NewScalarType>
|
||||
EIGEN_DEVICE_FUNC inline
|
||||
typename internal::enable_if<!internal::is_same<Scalar,NewScalarType>::value,Quaternion<NewScalarType> >::type cast() const
|
||||
std::enable_if_t<!internal::is_same<Scalar,NewScalarType>::value,Quaternion<NewScalarType> > cast() const
|
||||
{
|
||||
return Quaternion<NewScalarType>(coeffs().template cast<NewScalarType>());
|
||||
}
|
||||
|
||||
@@ -229,13 +229,13 @@ public:
|
||||
/** type of read reference to the linear part of the transformation */
|
||||
typedef const Block<ConstMatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (int(Options)&RowMajor)==0> ConstLinearPart;
|
||||
/** type of read/write reference to the affine part of the transformation */
|
||||
typedef typename internal::conditional<int(Mode)==int(AffineCompact),
|
||||
typedef std::conditional_t<int(Mode)==int(AffineCompact),
|
||||
MatrixType&,
|
||||
Block<MatrixType,Dim,HDim> >::type AffinePart;
|
||||
Block<MatrixType,Dim,HDim> > AffinePart;
|
||||
/** type of read reference to the affine part of the transformation */
|
||||
typedef typename internal::conditional<int(Mode)==int(AffineCompact),
|
||||
typedef std::conditional_t<int(Mode)==int(AffineCompact),
|
||||
const MatrixType&,
|
||||
const Block<const MatrixType,Dim,HDim> >::type ConstAffinePart;
|
||||
const Block<const MatrixType,Dim,HDim> > ConstAffinePart;
|
||||
/** type of a vector */
|
||||
typedef Matrix<Scalar,Dim,1> VectorType;
|
||||
/** type of a read/write reference to the translation part of the rotation */
|
||||
@@ -600,7 +600,7 @@ public:
|
||||
template<typename Derived>
|
||||
EIGEN_DEVICE_FUNC inline Transform operator*(const RotationBase<Derived,Dim>& r) const;
|
||||
|
||||
typedef typename internal::conditional<int(Mode)==Isometry,ConstLinearPart,const LinearMatrixType>::type RotationReturnType;
|
||||
typedef std::conditional_t<int(Mode)==Isometry,ConstLinearPart,const LinearMatrixType> RotationReturnType;
|
||||
EIGEN_DEVICE_FUNC RotationReturnType rotation() const;
|
||||
|
||||
template<typename RotationMatrixType, typename ScalingMatrixType>
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
/** Applies translation to vector */
|
||||
template<typename Derived>
|
||||
inline typename internal::enable_if<Derived::IsVectorAtCompileTime,VectorType>::type
|
||||
inline std::enable_if_t<Derived::IsVectorAtCompileTime,VectorType>
|
||||
operator* (const MatrixBase<Derived>& vec) const
|
||||
{ return m_coeffs + vec.derived(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user