10#ifndef EIGEN_SELFADJOINTMATRIX_H
11#define EIGEN_SELFADJOINTMATRIX_H
32template<
typename MatrixType,
unsigned int UpLo>
36 typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
37 typedef MatrixType ExpressionType;
38 typedef typename MatrixType::PlainObject FullMatrixType;
42 Flags = MatrixTypeNestedCleaned::Flags & (HereditaryBits|FlagsLvalueBit)
54 typedef _MatrixType MatrixType;
58 typedef MatrixTypeNestedCleaned NestedExpression;
62 typedef typename MatrixType::StorageIndex StorageIndex;
63 typedef typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
71 typedef typename MatrixType::PlainObject PlainObject;
76 EIGEN_STATIC_ASSERT(UpLo==
Lower || UpLo==
Upper,SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY);
79 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
80 inline Index rows() const EIGEN_NOEXCEPT {
return m_matrix.rows(); }
81 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
82 inline Index cols() const EIGEN_NOEXCEPT {
return m_matrix.cols(); }
83 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
84 inline Index outerStride() const EIGEN_NOEXCEPT {
return m_matrix.outerStride(); }
85 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
86 inline Index innerStride() const EIGEN_NOEXCEPT {
return m_matrix.innerStride(); }
94 Base::check_coordinates_internal(row, col);
95 return m_matrix.coeff(row, col);
105 Base::check_coordinates_internal(row, col);
106 return m_matrix.coeffRef(row, col);
111 const MatrixTypeNestedCleaned& _expression()
const {
return m_matrix; }
114 const MatrixTypeNestedCleaned& nestedExpression()
const {
return m_matrix; }
116 MatrixTypeNestedCleaned& nestedExpression() {
return m_matrix; }
119 template<
typename OtherDerived>
121 const Product<SelfAdjointView,OtherDerived>
128 template<
typename OtherDerived>
friend
136 friend EIGEN_DEVICE_FUNC
153 template<
typename DerivedU,
typename DerivedV>
167 template<
typename DerivedU>
181 template<
unsigned int TriMode>
224 EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
225 typename MatrixType::TransposeReturnType tmp(m_matrix);
243 typename MatrixType::ConstDiagonalReturnType
diagonal()
const
245 return typename MatrixType::ConstDiagonalReturnType(m_matrix);
266 MatrixTypeNested m_matrix;
284template<
typename MatrixType,
unsigned int Mode>
291template<
int UpLo,
int SetOpposite,
typename DstEvaluatorTypeT,
typename SrcEvaluatorTypeT,
typename Functor,
int Version>
297 typedef typename Base::DstXprType DstXprType;
298 typedef typename Base::SrcXprType SrcXprType;
301 using Base::m_functor;
306 typedef typename Base::Scalar Scalar;
316 eigen_internal_assert(row!=col);
317 Scalar tmp = m_src.coeff(row,col);
318 m_functor.assignCoeff(m_dst.coeffRef(row,col), tmp);
319 m_functor.assignCoeff(m_dst.coeffRef(col,row), numext::conj(tmp));
322 EIGEN_DEVICE_FUNC
void assignDiagonalCoeff(
Index id)
327 EIGEN_DEVICE_FUNC
void assignOppositeCoeff(
Index,
Index)
328 { eigen_internal_assert(
false &&
"should never be called"); }
338template<
typename Derived>
339template<
unsigned int UpLo>
355template<
typename Derived>
356template<
unsigned int UpLo>
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition SelfAdjointView.h:51
friend EIGEN_DEVICE_FUNC const Product< OtherDerived, SelfAdjointView > operator*(const MatrixBase< OtherDerived > &lhs, const SelfAdjointView &rhs)
Efficient vector/matrix times triangular matrix product.
Definition SelfAdjointView.h:131
EIGEN_DEVICE_FUNC internal::conditional<(TriMode &(Upper|Lower))==(UpLo &(Upper|Lower)), TriangularView< MatrixType, TriMode >, TriangularView< typenameMatrixType::AdjointReturnType, TriMode > >::type triangularView() const
Definition SelfAdjointView.h:186
EIGEN_DEVICE_FUNC SelfAdjointView & rankUpdate(const MatrixBase< DerivedU > &u, const MatrixBase< DerivedV > &v, const Scalar &alpha=Scalar(1))
Perform a symmetric rank 2 update of the selfadjoint matrix *this: .
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition SelfAdjointView.h:216
EIGEN_DEVICE_FUNC SelfAdjointView & rankUpdate(const MatrixBase< DerivedU > &u, const Scalar &alpha=Scalar(1))
Perform a symmetric rank K update of the selfadjoint matrix *this: where u is a vector or matrix.
const LLT< PlainObject, UpLo > llt() const
\cholesky_module
Definition LLT.h:551
EIGEN_DEVICE_FUNC const Product< SelfAdjointView, OtherDerived > operator*(const MatrixBase< OtherDerived > &rhs) const
Efficient triangular matrix times vector/matrix product.
Definition SelfAdjointView.h:122
const LDLT< PlainObject, UpLo > ldlt() const
\cholesky_module
Definition LDLT.h:670
EIGEN_DEVICE_FUNC RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition MatrixBaseEigenvalues.h:151
EIGEN_DEVICE_FUNC EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition MatrixBaseEigenvalues.h:88
Matrix< RealScalar, internal::traits< MatrixType >::ColsAtCompileTime, 1 > EigenvaluesReturnType
Return type of eigenvalues()
Definition SelfAdjointView.h:258
EIGEN_DEVICE_FUNC const ConstTransposeReturnType transpose() const
Definition SelfAdjointView.h:232
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index col)
Definition SelfAdjointView.h:102
EIGEN_DEVICE_FUNC internal::conditional< Cond, ConjugateReturnType, ConstSelfAdjointView >::type conjugateIf() const
Definition SelfAdjointView.h:207
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition SelfAdjointView.h:222
EIGEN_DEVICE_FUNC MatrixType::ConstDiagonalReturnType diagonal() const
Definition SelfAdjointView.h:243
EIGEN_DEVICE_FUNC Scalar coeff(Index row, Index col) const
Definition SelfAdjointView.h:92
EIGEN_DEVICE_FUNC const ConjugateReturnType conjugate() const
Definition SelfAdjointView.h:198
internal::traits< SelfAdjointView >::Scalar Scalar
The type of coefficients in this matrix.
Definition SelfAdjointView.h:61
NumTraits< Scalar >::Real RealScalar
Real part of Scalar.
Definition SelfAdjointView.h:256
Base class for triangular part in a matrix.
Definition TriangularMatrix.h:28
Definition AssignEvaluator.h:619
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index row, Index col)
Assign src(row,col) to dst(row,col) through the assignment functor.
Definition AssignEvaluator.h:652
Definition TriangularMatrix.h:748
@ SelfAdjoint
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition Constants.h:225
@ Lower
View matrix as a lower triangular matrix.
Definition Constants.h:209
@ Upper
View matrix as an upper triangular matrix.
Definition Constants.h:211
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition Constants.h:94
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition Constants.h:130
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array.
Definition Constants.h:155
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition Constants.h:144
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Eigen::Index Index
The interface type of indices.
Definition EigenBase.h:39
Definition Constants.h:534
Definition Constants.h:542
Definition CoreEvaluators.h:80
Definition XprHelper.h:660
Definition ForwardDeclarations.h:17