mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
generalized ei_traits<>.
Finally the importing macro is named EIGEN_BASIC_PUBLIC_INTERFACE because it does not only import the ei_traits, it also makes the base class a friend, etc.
This commit is contained in:
@@ -38,30 +38,31 @@
|
||||
* \sa MatrixBase::transpose(), MatrixBase::adjoint()
|
||||
*/
|
||||
template<typename MatrixType>
|
||||
struct Scalar<Transpose<MatrixType> >
|
||||
{ typedef typename Scalar<MatrixType>::Type Type; };
|
||||
struct ei_traits<Transpose<MatrixType> >
|
||||
{
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
enum {
|
||||
RowsAtCompileTime = MatrixType::ColsAtCompileTime,
|
||||
ColsAtCompileTime = MatrixType::RowsAtCompileTime,
|
||||
MaxRowsAtCompileTime = MatrixType::MaxColsAtCompileTime,
|
||||
MaxColsAtCompileTime = MatrixType::MaxRowsAtCompileTime
|
||||
};
|
||||
};
|
||||
|
||||
template<typename MatrixType> class Transpose
|
||||
: public MatrixBase<Transpose<MatrixType> >
|
||||
{
|
||||
public:
|
||||
typedef typename Scalar<MatrixType>::Type Scalar;
|
||||
|
||||
EIGEN_BASIC_PUBLIC_INTERFACE(Transpose)
|
||||
|
||||
typedef typename MatrixType::AsArg MatRef;
|
||||
friend class MatrixBase<Transpose>;
|
||||
friend class MatrixBase<Transpose>::Traits;
|
||||
typedef MatrixBase<Transpose> Base;
|
||||
|
||||
Transpose(const MatRef& matrix) : m_matrix(matrix) {}
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
|
||||
|
||||
private:
|
||||
enum {
|
||||
RowsAtCompileTime = MatrixType::Traits::ColsAtCompileTime,
|
||||
ColsAtCompileTime = MatrixType::Traits::RowsAtCompileTime,
|
||||
MaxRowsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime,
|
||||
MaxColsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime
|
||||
};
|
||||
|
||||
const Transpose& _asArg() const { return *this; }
|
||||
int _rows() const { return m_matrix.cols(); }
|
||||
|
||||
Reference in New Issue
Block a user