backporting r964165 (gcc 3.3 fixes)

This commit is contained in:
Gael Guennebaud 2009-05-06 09:40:41 +00:00
parent f82d9bdf9a
commit 0104c34b7d
3 changed files with 14 additions and 6 deletions

View File

@ -222,7 +222,7 @@ class Block<MatrixType,BlockRows,BlockCols,PacketAccess,HasDirectAccess>
class InnerIterator; class InnerIterator;
typedef typename ei_traits<Block>::AlignedDerivedType AlignedDerivedType; typedef typename ei_traits<Block>::AlignedDerivedType AlignedDerivedType;
friend class Block<MatrixType,BlockRows,BlockCols,AsRequested,HasDirectAccess>; friend class Block<MatrixType,BlockRows,BlockCols,PacketAccess==AsRequested?ForceAligned:AsRequested,HasDirectAccess>;
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)

View File

@ -26,7 +26,7 @@
#ifndef EIGEN_PART_H #ifndef EIGEN_PART_H
#define EIGEN_PART_H #define EIGEN_PART_H
/** \nonstableyet /** \nonstableyet
* \class Part * \class Part
* *
* \brief Expression of a triangular matrix extracted from a given matrix * \brief Expression of a triangular matrix extracted from a given matrix
@ -117,10 +117,10 @@ template<typename MatrixType, unsigned int Mode> class Part
const Block<Part, RowsAtCompileTime, 1> col(int i) { return Base::col(i); } const Block<Part, RowsAtCompileTime, 1> col(int i) { return Base::col(i); }
const Block<Part, RowsAtCompileTime, 1> col(int i) const { return Base::col(i); } const Block<Part, RowsAtCompileTime, 1> col(int i) const { return Base::col(i); }
template<typename OtherDerived/*, int OtherMode*/> template<typename OtherDerived>
void swap(const MatrixBase<OtherDerived>& other) void swap(const MatrixBase<OtherDerived>& other)
{ {
Part<SwapWrapper<MatrixType>,Mode>(SwapWrapper<MatrixType>(const_cast<MatrixType&>(m_matrix))).lazyAssign(other.derived()); Part<SwapWrapper<MatrixType>,Mode>(const_cast<MatrixType&>(m_matrix)).lazyAssign(other.derived());
} }
protected: protected:
@ -128,7 +128,7 @@ template<typename MatrixType, unsigned int Mode> class Part
const typename MatrixType::Nested m_matrix; const typename MatrixType::Nested m_matrix;
}; };
/** \nonstableyet /** \nonstableyet
* \returns an expression of a triangular matrix extracted from the current matrix * \returns an expression of a triangular matrix extracted from the current matrix
* *
* The parameter \a Mode can have the following values: \c UpperTriangular, \c StrictlyUpperTriangular, \c UnitUpperTriangular, * The parameter \a Mode can have the following values: \c UpperTriangular, \c StrictlyUpperTriangular, \c UnitUpperTriangular,
@ -280,7 +280,7 @@ void Part<MatrixType, Mode>::lazyAssign(const Other& other)
>::run(m_matrix.const_cast_derived(), other.derived()); >::run(m_matrix.const_cast_derived(), other.derived());
} }
/** \nonstableyet /** \nonstableyet
* \returns a lvalue pseudo-expression allowing to perform special operations on \c *this. * \returns a lvalue pseudo-expression allowing to perform special operations on \c *this.
* *
* The \a Mode parameter can have the following values: \c UpperTriangular, \c StrictlyUpperTriangular, \c LowerTriangular, * The \a Mode parameter can have the following values: \c UpperTriangular, \c StrictlyUpperTriangular, \c LowerTriangular,

View File

@ -114,6 +114,14 @@ template<typename MatrixType> void triangular(const MatrixType& m)
VERIFY((m1.template part<Eigen::UpperTriangular>() * m2.template part<Eigen::UpperTriangular>()).isUpperTriangular()); VERIFY((m1.template part<Eigen::UpperTriangular>() * m2.template part<Eigen::UpperTriangular>()).isUpperTriangular());
// test swap
m1.setOnes();
m2.setZero();
m2.template part<Eigen::UpperTriangular>().swap(m1);
m3.setZero();
m3.template part<Eigen::UpperTriangular>().setOnes();
VERIFY_IS_APPROX(m2,m3);
} }
void test_triangular() void test_triangular()