mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-19 08:09:36 +08:00
* compilation fixes for gcc 3.3
* test Part::swap
This commit is contained in:
parent
23f073625d
commit
1e286464ab
@ -221,7 +221,7 @@ class Block<MatrixType,BlockRows,BlockCols,PacketAccess,HasDirectAccess>
|
||||
|
||||
class InnerIterator;
|
||||
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)
|
||||
|
||||
|
@ -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) const { return Base::col(i); }
|
||||
|
||||
template<typename OtherDerived/*, int OtherMode*/>
|
||||
template<typename OtherDerived>
|
||||
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:
|
||||
|
@ -114,6 +114,14 @@ template<typename MatrixType> void triangular(const MatrixType& m)
|
||||
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user