mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-30 17:40:05 +08:00
add TriangularMatrix::conjugate to be consistent since we have adjoint
This commit is contained in:
parent
474c2996bd
commit
6261f4629f
@ -154,11 +154,17 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
|
||||
typedef TriangularBase<TriangularView> Base;
|
||||
typedef typename ei_traits<TriangularView>::Scalar Scalar;
|
||||
|
||||
protected:
|
||||
typedef _MatrixType MatrixType;
|
||||
typedef typename MatrixType::PlainObject DenseMatrixType;
|
||||
typedef typename MatrixType::Nested MatrixTypeNested;
|
||||
typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
typedef typename ei_cleantype<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
|
||||
|
||||
public:
|
||||
using Base::evalToLazy;
|
||||
|
||||
|
||||
typedef typename ei_traits<TriangularView>::StorageKind StorageKind;
|
||||
typedef typename ei_traits<TriangularView>::Index Index;
|
||||
@ -235,6 +241,12 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
template<typename OtherDerived>
|
||||
void lazyAssign(const MatrixBase<OtherDerived>& other);
|
||||
|
||||
/** \sa MatrixBase::conjugate() */
|
||||
inline TriangularView<MatrixConjugateReturnType,Mode> conjugate()
|
||||
{ return m_matrix.conjugate(); }
|
||||
/** \sa MatrixBase::conjugate() const */
|
||||
inline const TriangularView<MatrixConjugateReturnType,Mode> conjugate() const
|
||||
{ return m_matrix.conjugate(); }
|
||||
|
||||
/** \sa MatrixBase::adjoint() */
|
||||
inline TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint()
|
||||
|
@ -83,6 +83,9 @@ template<typename MatrixType> void triangular_square(const MatrixType& m)
|
||||
m1.template triangularView<Lower>() = m2.transpose() + m2;
|
||||
VERIFY_IS_APPROX(m3.template triangularView<Lower>().toDenseMatrix(), m1);
|
||||
|
||||
VERIFY_IS_APPROX(m3.template triangularView<Lower>().conjugate().toDenseMatrix(),
|
||||
m3.conjugate().template triangularView<Lower>().toDenseMatrix());
|
||||
|
||||
m1 = MatrixType::Random(rows, cols);
|
||||
for (int i=0; i<rows; ++i)
|
||||
while (ei_abs2(m1(i,i))<1e-1) m1(i,i) = ei_random<Scalar>();
|
||||
|
Loading…
Reference in New Issue
Block a user