mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Get rid of class internal::nested<> (still have to updated Tensor module)
This commit is contained in:
parent
386d9e5ebd
commit
846b227bb7
@ -52,7 +52,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
||||
const Scalar
|
||||
>::type ScalarWithConstIfNotLvalue;
|
||||
|
||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||
typedef typename internal::ref_selector<ExpressionType>::type NestedExpressionType;
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
@ -195,7 +195,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
||||
const Scalar
|
||||
>::type ScalarWithConstIfNotLvalue;
|
||||
|
||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||
typedef typename internal::ref_selector<ExpressionType>::type NestedExpressionType;
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
@ -55,7 +55,7 @@ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprTyp
|
||||
typedef typename traits<XprType>::Scalar Scalar;
|
||||
typedef typename traits<XprType>::StorageKind StorageKind;
|
||||
typedef typename traits<XprType>::XprKind XprKind;
|
||||
typedef typename nested<XprType>::type XprTypeNested;
|
||||
typedef typename ref_selector<XprType>::type XprTypeNested;
|
||||
typedef typename remove_reference<XprTypeNested>::type _XprTypeNested;
|
||||
enum{
|
||||
MatrixRows = traits<XprType>::RowsAtCompileTime,
|
||||
|
@ -95,8 +95,8 @@ class CwiseBinaryOp :
|
||||
BinaryOp>::ret>::Base Base;
|
||||
EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp)
|
||||
|
||||
typedef typename internal::nested<LhsType>::type LhsNested;
|
||||
typedef typename internal::nested<RhsType>::type RhsNested;
|
||||
typedef typename internal::ref_selector<LhsType>::type LhsNested;
|
||||
typedef typename internal::ref_selector<RhsType>::type RhsNested;
|
||||
typedef typename internal::remove_reference<LhsNested>::type _LhsNested;
|
||||
typedef typename internal::remove_reference<RhsNested>::type _RhsNested;
|
||||
|
||||
|
@ -84,8 +84,7 @@ class CwiseUnaryView : public CwiseUnaryViewImpl<ViewOp, MatrixType, typename in
|
||||
nestedExpression() { return m_matrix.const_cast_derived(); }
|
||||
|
||||
protected:
|
||||
// FIXME changed from MatrixType::Nested because of a weird compilation error with sun CC
|
||||
typename internal::nested<MatrixType>::type m_matrix;
|
||||
typename internal::ref_selector<MatrixType>::type m_matrix;
|
||||
ViewOp m_functor;
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ template<typename MatrixType, int DiagIndex>
|
||||
struct traits<Diagonal<MatrixType,DiagIndex> >
|
||||
: traits<MatrixType>
|
||||
{
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
typedef typename MatrixType::StorageKind StorageKind;
|
||||
enum {
|
||||
|
@ -47,7 +47,7 @@ class Inverse : public InverseImpl<XprType,typename internal::traits<XprType>::S
|
||||
public:
|
||||
typedef typename XprType::StorageIndex StorageIndex;
|
||||
typedef typename XprType::PlainObject PlainObject;
|
||||
typedef typename internal::nested<XprType>::type XprTypeNested;
|
||||
typedef typename internal::ref_selector<XprType>::type XprTypeNested;
|
||||
typedef typename internal::remove_all<XprTypeNested>::type XprTypeNestedCleaned;
|
||||
|
||||
explicit Inverse(const XprType &xpr)
|
||||
|
@ -121,8 +121,8 @@ class Product : public ProductImpl<_Lhs,_Rhs,Option,
|
||||
internal::product_type<Lhs,Rhs>::ret>::ret>::Base Base;
|
||||
EIGEN_GENERIC_PUBLIC_INTERFACE(Product)
|
||||
|
||||
typedef typename internal::nested<Lhs>::type LhsNested;
|
||||
typedef typename internal::nested<Rhs>::type RhsNested;
|
||||
typedef typename internal::ref_selector<Lhs>::type LhsNested;
|
||||
typedef typename internal::ref_selector<Rhs>::type RhsNested;
|
||||
typedef typename internal::remove_all<LhsNested>::type LhsNestedCleaned;
|
||||
typedef typename internal::remove_all<RhsNested>::type RhsNestedCleaned;
|
||||
|
||||
|
@ -35,10 +35,7 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||
typedef typename traits<MatrixType>::XprKind XprKind;
|
||||
enum {
|
||||
Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor
|
||||
};
|
||||
typedef typename nested<MatrixType,Factor>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
enum {
|
||||
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
||||
|
@ -37,7 +37,7 @@ struct traits<Reverse<MatrixType, Direction> >
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||
typedef typename traits<MatrixType>::XprKind XprKind;
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
enum {
|
||||
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
|
||||
|
@ -32,7 +32,7 @@ namespace internal {
|
||||
template<typename MatrixType, unsigned int UpLo>
|
||||
struct traits<SelfAdjointView<MatrixType, UpLo> > : traits<MatrixType>
|
||||
{
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
|
||||
typedef MatrixType ExpressionType;
|
||||
typedef typename MatrixType::PlainObject FullMatrixType;
|
||||
|
@ -31,7 +31,7 @@ namespace internal {
|
||||
template<typename MatrixType>
|
||||
struct traits<Transpose<MatrixType> > : public traits<MatrixType>
|
||||
{
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNestedPlain;
|
||||
enum {
|
||||
RowsAtCompileTime = MatrixType::ColsAtCompileTime,
|
||||
|
@ -164,7 +164,7 @@ namespace internal {
|
||||
template<typename MatrixType, unsigned int _Mode>
|
||||
struct traits<TriangularView<MatrixType, _Mode> > : traits<MatrixType>
|
||||
{
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type MatrixTypeNestedNonRef;
|
||||
typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
|
||||
typedef typename MatrixType::PlainObject FullMatrixType;
|
||||
|
@ -41,7 +41,7 @@ struct traits<PartialReduxExpr<MatrixType, MemberOp, Direction> >
|
||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||
typedef typename traits<MatrixType>::XprKind XprKind;
|
||||
typedef typename MatrixType::Scalar InputScalar;
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
enum {
|
||||
RowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::RowsAtCompileTime,
|
||||
|
@ -685,7 +685,7 @@ namespace Eigen {
|
||||
typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; /*!< \brief Numeric type, e.g. float, double, int or std::complex<float>. */ \
|
||||
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; /*!< \brief The underlying numeric type for composed scalar types. \details In cases where Scalar is e.g. std::complex<T>, T were corresponding to RealScalar. */ \
|
||||
typedef typename Base::CoeffReturnType CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' or simply 'Scalar' for objects that do not allow direct coefficient access. */ \
|
||||
typedef typename Eigen::internal::nested<Derived>::type Nested; \
|
||||
typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
|
||||
typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
|
||||
typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
|
||||
enum { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
|
||||
|
@ -312,7 +312,7 @@ template<typename T> struct plain_matrix_type_row_major
|
||||
> type;
|
||||
};
|
||||
|
||||
// we should be able to get rid of this one too
|
||||
// TODO we should be able to get rid of this one too
|
||||
template<typename T> struct must_nest_by_value { enum { ret = false }; };
|
||||
|
||||
/** \internal The reference selector for template expressions. The idea is that we don't
|
||||
@ -340,13 +340,6 @@ struct transfer_constness
|
||||
};
|
||||
|
||||
|
||||
// When using evaluators, we never evaluate when assembling the expression!!
|
||||
// TODO: get rid of this nested class since it's just an alias for ref_selector.
|
||||
template<typename T, int n=1, typename PlainObject = void> struct nested
|
||||
{
|
||||
typedef typename ref_selector<T>::type type;
|
||||
};
|
||||
|
||||
// However, we still need a mechanism to detect whether an expression which is evaluated multiple time
|
||||
// has to be evaluated into a temporary.
|
||||
// That's the purpose of this new nested_eval helper:
|
||||
|
@ -34,7 +34,7 @@ struct traits<Homogeneous<MatrixType,Direction> >
|
||||
: traits<MatrixType>
|
||||
{
|
||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
enum {
|
||||
RowsPlusOne = (MatrixType::RowsAtCompileTime != Dynamic) ?
|
||||
|
@ -60,7 +60,7 @@ template<typename _Scalar, int _Options, typename _Index, int DiagIndex>
|
||||
struct traits<Diagonal<SparseMatrix<_Scalar, _Options, _Index>, DiagIndex> >
|
||||
{
|
||||
typedef SparseMatrix<_Scalar, _Options, _Index> MatrixType;
|
||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
|
||||
typedef _Scalar Scalar;
|
||||
|
@ -47,7 +47,7 @@ EIGEN_SPARSE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
|
||||
#define _EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \
|
||||
typedef typename Eigen::internal::traits<Derived >::Scalar Scalar; \
|
||||
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
|
||||
typedef typename Eigen::internal::nested<Derived >::type Nested; \
|
||||
typedef typename Eigen::internal::ref_selector<Derived >::type Nested; \
|
||||
typedef typename Eigen::internal::traits<Derived >::StorageKind StorageKind; \
|
||||
typedef typename Eigen::internal::traits<Derived >::StorageIndex StorageIndex; \
|
||||
enum { RowsAtCompileTime = Eigen::internal::traits<Derived >::RowsAtCompileTime, \
|
||||
|
@ -155,6 +155,11 @@ struct eval<const TensorRef<PlainObjectType>, Eigen::Dense>
|
||||
typedef const TensorRef<PlainObjectType>& type;
|
||||
};
|
||||
|
||||
// TODO nested<> does not exist anymore in Eigen/Core, and it thus has to be removed in favor of ref_selector.
|
||||
template<typename T, int n=1, typename PlainObject = void> struct nested
|
||||
{
|
||||
typedef typename ref_selector<T>::type type;
|
||||
};
|
||||
|
||||
template <typename Scalar_, std::size_t NumIndices_, int Options_, typename IndexType_>
|
||||
struct nested<Tensor<Scalar_, NumIndices_, Options_, IndexType_> >
|
||||
|
@ -400,7 +400,7 @@ template<typename Derived> struct MatrixExponentialReturnValue
|
||||
Index cols() const { return m_src.cols(); }
|
||||
|
||||
protected:
|
||||
const typename internal::nested<Derived>::type m_src;
|
||||
const typename internal::ref_selector<Derived>::type m_src;
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
@ -485,7 +485,7 @@ template<typename Derived> class MatrixFunctionReturnValue
|
||||
typedef typename internal::stem_function<Scalar>::type StemFunction;
|
||||
|
||||
protected:
|
||||
typedef typename internal::nested<Derived>::type DerivedNested;
|
||||
typedef typename internal::ref_selector<Derived>::type DerivedNested;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -315,7 +315,7 @@ public:
|
||||
typedef typename Derived::Index Index;
|
||||
|
||||
protected:
|
||||
typedef typename internal::nested<Derived>::type DerivedNested;
|
||||
typedef typename internal::ref_selector<Derived>::type DerivedNested;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -320,7 +320,7 @@ template<typename Derived> class MatrixSquareRootReturnValue
|
||||
{
|
||||
protected:
|
||||
typedef typename Derived::Index Index;
|
||||
typedef typename internal::nested<Derived>::type DerivedNested;
|
||||
typedef typename internal::ref_selector<Derived>::type DerivedNested;
|
||||
|
||||
public:
|
||||
/** \brief Constructor.
|
||||
|
@ -14,8 +14,8 @@ namespace Eigen {
|
||||
|
||||
template<typename Lhs, typename Rhs, int ProductMode>
|
||||
struct SkylineProductReturnType {
|
||||
typedef const typename internal::nested<Lhs, Rhs::RowsAtCompileTime>::type LhsNested;
|
||||
typedef const typename internal::nested<Rhs, Lhs::RowsAtCompileTime>::type RhsNested;
|
||||
typedef const typename internal::nested_eval<Lhs, Rhs::RowsAtCompileTime>::type LhsNested;
|
||||
typedef const typename internal::nested_eval<Rhs, Lhs::RowsAtCompileTime>::type RhsNested;
|
||||
|
||||
typedef SkylineProduct<LhsNested, RhsNested, ProductMode> Type;
|
||||
};
|
||||
|
@ -287,7 +287,7 @@ class BlockSparseMatrix : public SparseMatrixBase<BlockSparseMatrix<_Scalar,_Blo
|
||||
typedef _Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
typedef _StorageIndex StorageIndex;
|
||||
typedef typename internal::nested<BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex> >::type Nested;
|
||||
typedef typename internal::ref_selector<BlockSparseMatrix<_Scalar, _BlockAtCompileTime, _Options, _StorageIndex> >::type Nested;
|
||||
|
||||
enum {
|
||||
Options = _Options,
|
||||
|
Loading…
Reference in New Issue
Block a user