mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add a DenseBase class for MAtrixBase and ArrayBase and more code factorisation
This commit is contained in:
@@ -65,6 +65,7 @@ template<typename MatrixType, unsigned int Mode> class SelfAdjointView;
|
||||
template<typename ExpressionType> class WithFormat;
|
||||
template<typename MatrixType> struct CommaInitializer;
|
||||
template<typename Derived> class ReturnByValue;
|
||||
template<typename ExpressionType> class ArrayWrapper;
|
||||
|
||||
template<typename DecompositionType, typename Rhs> struct ei_solve_retval_base;
|
||||
template<typename DecompositionType, typename Rhs> struct ei_solve_retval;
|
||||
|
||||
@@ -281,8 +281,7 @@ using Eigen::ei_cos;
|
||||
using Base::operator /=; \
|
||||
EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived)
|
||||
|
||||
#define _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, BaseClass) \
|
||||
typedef BaseClass Base; \
|
||||
#define _EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
|
||||
typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \
|
||||
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
|
||||
typedef typename Base::PacketScalar PacketScalar; \
|
||||
@@ -299,7 +298,8 @@ using Eigen::ei_cos;
|
||||
IsVectorAtCompileTime = Base::IsVectorAtCompileTime };
|
||||
|
||||
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
|
||||
_EIGEN_GENERIC_PUBLIC_INTERFACE(Derived, Eigen::MatrixBase<Derived>)
|
||||
typedef Eigen::MatrixBase<Derived> Base; \
|
||||
_EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
|
||||
|
||||
#define EIGEN_GENERIC_PUBLIC_INTERFACE_NEW(Derived) \
|
||||
typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \
|
||||
@@ -315,8 +315,7 @@ using Eigen::ei_cos;
|
||||
IsVectorAtCompileTime = Base::IsVectorAtCompileTime };
|
||||
|
||||
|
||||
#define _EIGEN_DENSE_PUBLIC_INTERFACE(Derived, BaseClass) \
|
||||
typedef BaseClass Base; \
|
||||
#define _EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \
|
||||
typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \
|
||||
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
|
||||
typedef typename Base::PacketScalar PacketScalar; \
|
||||
@@ -334,7 +333,8 @@ using Eigen::ei_cos;
|
||||
using Base::derived;
|
||||
|
||||
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \
|
||||
_EIGEN_DENSE_PUBLIC_INTERFACE(Derived, Eigen::MatrixBase<Derived>)
|
||||
typedef Eigen::MatrixBase<Derived> Base; \
|
||||
_EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
|
||||
|
||||
|
||||
#define EIGEN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
|
||||
@@ -344,4 +344,13 @@ using Eigen::ei_cos;
|
||||
#define EIGEN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
|
||||
#define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b)))
|
||||
|
||||
|
||||
#define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,FUNCTOR) \
|
||||
template<typename OtherDerived> \
|
||||
inline const CwiseBinaryOp<FUNCTOR<Scalar>, Derived, OtherDerived> \
|
||||
METHOD(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
|
||||
{ \
|
||||
return CwiseBinaryOp<FUNCTOR<Scalar>, Derived, OtherDerived>(derived(), other.derived()); \
|
||||
}
|
||||
|
||||
#endif // EIGEN_MACROS_H
|
||||
|
||||
@@ -133,6 +133,7 @@ struct ei_eval<Matrix<_Scalar, _Rows, _Cols, _StorageOrder, _MaxRows, _MaxCols>,
|
||||
*/
|
||||
template<typename T> struct ei_plain_matrix_type
|
||||
{
|
||||
// typedef typename T::PlainMatrixType type;
|
||||
typedef Matrix<typename ei_traits<T>::Scalar,
|
||||
ei_traits<T>::RowsAtCompileTime,
|
||||
ei_traits<T>::ColsAtCompileTime,
|
||||
|
||||
Reference in New Issue
Block a user