mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Since there is no reason for evaluators to be nested by reference, let's remove the evaluator<>::nestedType indirection.
This commit is contained in:
@@ -89,7 +89,6 @@ template<typename T>
|
||||
struct evaluator<const T>
|
||||
: evaluator<T>
|
||||
{
|
||||
typedef evaluator<const T> nestedType;
|
||||
explicit evaluator(const T& xpr) : evaluator<T>(xpr) {}
|
||||
};
|
||||
|
||||
@@ -98,10 +97,6 @@ struct evaluator<const T>
|
||||
template<typename ExpressionType>
|
||||
struct evaluator_base : public noncopyable
|
||||
{
|
||||
// TODO Check whether nestedType is really needed:
|
||||
// As long as evaluator are non-copyable, there is no reason to make it different.
|
||||
typedef evaluator<ExpressionType> nestedType;
|
||||
|
||||
// FIXME is it really usefull?
|
||||
typedef typename traits<ExpressionType>::StorageIndex StorageIndex;
|
||||
|
||||
@@ -307,7 +302,7 @@ struct unary_evaluator<Transpose<ArgType>, IndexBased>
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
};
|
||||
|
||||
// -------------------- CwiseNullaryOp --------------------
|
||||
@@ -411,7 +406,7 @@ struct unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, IndexBased >
|
||||
|
||||
protected:
|
||||
const UnaryOp m_functor;
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
};
|
||||
|
||||
// -------------------- CwiseBinaryOp --------------------
|
||||
@@ -486,8 +481,8 @@ struct binary_evaluator<CwiseBinaryOp<BinaryOp, Lhs, Rhs>, IndexBased, IndexBase
|
||||
|
||||
protected:
|
||||
const BinaryOp m_functor;
|
||||
typename evaluator<Lhs>::nestedType m_lhsImpl;
|
||||
typename evaluator<Rhs>::nestedType m_rhsImpl;
|
||||
evaluator<Lhs> m_lhsImpl;
|
||||
evaluator<Rhs> m_rhsImpl;
|
||||
};
|
||||
|
||||
// -------------------- CwiseUnaryView --------------------
|
||||
@@ -536,7 +531,7 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType>, IndexBased>
|
||||
|
||||
protected:
|
||||
const UnaryOp m_unaryOp;
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
};
|
||||
|
||||
// -------------------- Map --------------------
|
||||
@@ -810,7 +805,7 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime == 1 ? 0 : Dynamic> m_startRow;
|
||||
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime == 1 ? 0 : Dynamic> m_startCol;
|
||||
};
|
||||
@@ -879,9 +874,9 @@ struct evaluator<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ConditionMatrixType>::nestedType m_conditionImpl;
|
||||
typename evaluator<ThenMatrixType>::nestedType m_thenImpl;
|
||||
typename evaluator<ElseMatrixType>::nestedType m_elseImpl;
|
||||
evaluator<ConditionMatrixType> m_conditionImpl;
|
||||
evaluator<ThenMatrixType> m_thenImpl;
|
||||
evaluator<ElseMatrixType> m_elseImpl;
|
||||
};
|
||||
|
||||
|
||||
@@ -962,7 +957,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
||||
|
||||
protected:
|
||||
const ArgTypeNested m_arg; // FIXME is it OK to store both the argument and its evaluator?? (we have the same situation in evaluator_product)
|
||||
typename evaluator<ArgTypeNestedCleaned>::nestedType m_argImpl;
|
||||
evaluator<ArgTypeNestedCleaned> m_argImpl;
|
||||
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime> m_rows;
|
||||
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
||||
};
|
||||
@@ -1080,7 +1075,7 @@ struct evaluator_wrapper_base
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
};
|
||||
|
||||
template<typename TArgType>
|
||||
@@ -1215,7 +1210,7 @@ struct unary_evaluator<Reverse<ArgType, Direction> >
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
|
||||
// If we do not reverse rows, then we do not need to know the number of rows; same for columns
|
||||
const variable_if_dynamic<Index, ReverseRow ? ArgType::RowsAtCompileTime : 0> m_rows;
|
||||
@@ -1270,7 +1265,7 @@ struct evaluator<Diagonal<ArgType, DiagIndex> >
|
||||
}
|
||||
|
||||
protected:
|
||||
typename evaluator<ArgType>::nestedType m_argImpl;
|
||||
evaluator<ArgType> m_argImpl;
|
||||
const internal::variable_if_dynamicindex<Index, XprType::DiagIndex> m_index;
|
||||
|
||||
private:
|
||||
@@ -1334,8 +1329,6 @@ struct evaluator<EvalToTemp<ArgType> >
|
||||
typedef typename ArgType::PlainObject PlainObject;
|
||||
typedef evaluator<PlainObject> Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
|
||||
: m_result(xpr.rows(), xpr.cols())
|
||||
{
|
||||
|
||||
@@ -106,8 +106,6 @@ struct unary_evaluator<Inverse<ArgType> >
|
||||
typedef typename InverseType::PlainObject PlainObject;
|
||||
typedef evaluator<PlainObject> Base;
|
||||
|
||||
typedef evaluator<InverseType> nestedType;
|
||||
|
||||
enum { Flags = Base::Flags | EvalBeforeNestingBit };
|
||||
|
||||
unary_evaluator(const InverseType& inv_xpr)
|
||||
|
||||
@@ -32,8 +32,6 @@ struct evaluator<Product<Lhs, Rhs, Options> >
|
||||
typedef Product<Lhs, Rhs, Options> XprType;
|
||||
typedef product_evaluator<XprType> Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {}
|
||||
};
|
||||
|
||||
@@ -46,8 +44,6 @@ struct evaluator<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const Produ
|
||||
typedef CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const Product<Lhs, Rhs, DefaultProduct> > XprType;
|
||||
typedef evaluator<Product<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>,const Lhs>, Rhs, DefaultProduct> > Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
|
||||
: Base(xpr.functor().m_other * xpr.nestedExpression().lhs() * xpr.nestedExpression().rhs())
|
||||
{}
|
||||
@@ -61,8 +57,6 @@ struct evaluator<Diagonal<const Product<Lhs, Rhs, DefaultProduct>, DiagIndex> >
|
||||
typedef Diagonal<const Product<Lhs, Rhs, DefaultProduct>, DiagIndex> XprType;
|
||||
typedef evaluator<Diagonal<const Product<Lhs, Rhs, LazyProduct>, DiagIndex> > Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
|
||||
: Base(Diagonal<const Product<Lhs, Rhs, LazyProduct>, DiagIndex>(
|
||||
Product<Lhs, Rhs, LazyProduct>(xpr.nestedExpression().lhs(), xpr.nestedExpression().rhs()),
|
||||
@@ -735,8 +729,8 @@ protected:
|
||||
m_diagImpl.template packet<DiagonalPacketLoadMode,PacketType>(id));
|
||||
}
|
||||
|
||||
typename evaluator<DiagonalType>::nestedType m_diagImpl;
|
||||
typename evaluator<MatrixType>::nestedType m_matImpl;
|
||||
evaluator<DiagonalType> m_diagImpl;
|
||||
evaluator<MatrixType> m_matImpl;
|
||||
};
|
||||
|
||||
// diagonal * dense
|
||||
|
||||
@@ -390,7 +390,7 @@ public:
|
||||
const XprType & nestedExpression() const { return m_xpr; }
|
||||
|
||||
protected:
|
||||
typename internal::evaluator<XprType>::nestedType m_evaluator;
|
||||
internal::evaluator<XprType> m_evaluator;
|
||||
const XprType &m_xpr;
|
||||
};
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ struct evaluator<ReturnByValue<Derived> >
|
||||
typedef typename internal::traits<Derived>::ReturnType PlainObject;
|
||||
typedef evaluator<PlainObject> Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr)
|
||||
: m_result(xpr.rows(), xpr.cols())
|
||||
{
|
||||
|
||||
@@ -119,8 +119,6 @@ struct evaluator<Solve<Decomposition,RhsType> >
|
||||
typedef typename SolveType::PlainObject PlainObject;
|
||||
typedef evaluator<PlainObject> Base;
|
||||
|
||||
typedef evaluator nestedType;
|
||||
|
||||
EIGEN_DEVICE_FUNC explicit evaluator(const SolveType& solve)
|
||||
: m_result(solve.rows(), solve.cols())
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
{ return m_evaluator.coeff(row, col); }
|
||||
|
||||
protected:
|
||||
typename internal::evaluator<XprType>::nestedType m_evaluator;
|
||||
internal::evaluator<XprType> m_evaluator;
|
||||
const XprType &m_xpr;
|
||||
};
|
||||
} // end namespace internal
|
||||
|
||||
Reference in New Issue
Block a user