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:
Benoit Jacob
2008-03-12 17:17:36 +00:00
parent 01572b9f54
commit 2ee68a074e
38 changed files with 507 additions and 457 deletions

View File

@@ -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(); }