pass eigen2's triangular test

This commit is contained in:
Benoit Jacob
2011-01-23 21:53:28 -05:00
parent 5c82fd7f40
commit 1dabd133cc
4 changed files with 54 additions and 5 deletions

View File

@@ -245,7 +245,13 @@ template<typename Derived> class MatrixBase
#ifdef EIGEN2_SUPPORT
template<unsigned int Mode> TriangularView<Derived, Mode> part();
template<unsigned int Mode> const TriangularView<Derived, Mode> part() const;
#endif
// huuuge hack. make Eigen2's matrix.part<Diagonal>() work in eigen3. Problem: Diagonal is now a class template instead
// of an integer constant. Solution: overload the part() method template wrt template parameters list.
template<template<typename T, int n> class U>
const DiagonalWrapper<ConstDiagonalReturnType> part() const
{ return diagonal().asDiagonal(); }
#endif // EIGEN2_SUPPORT
template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
@@ -270,7 +276,7 @@ template<typename Derived> class MatrixBase
static const BasisReturnType UnitZ();
static const BasisReturnType UnitW();
const DiagonalWrapper<Derived> asDiagonal() const;
const DiagonalWrapper<const Derived> asDiagonal() const;
Derived& setIdentity();
Derived& setIdentity(Index rows, Index cols);