10 #ifndef EIGEN_SELFADJOINTMATRIX_H 11 #define EIGEN_SELFADJOINTMATRIX_H 32 template<
typename MatrixType,
unsigned int UpLo>
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;
68 typedef typename MatrixType::PlainObject PlainObject;
75 inline Index rows()
const {
return m_matrix.rows(); }
77 inline Index cols()
const {
return m_matrix.cols(); }
79 inline Index outerStride()
const {
return m_matrix.outerStride(); }
81 inline Index innerStride()
const {
return m_matrix.innerStride(); }
89 Base::check_coordinates_internal(row, col);
90 return m_matrix.coeff(row, col);
99 EIGEN_STATIC_ASSERT_LVALUE(SelfAdjointView);
100 Base::check_coordinates_internal(row, col);
101 return m_matrix.coeffRef(row, col);
106 const MatrixTypeNestedCleaned& _expression()
const {
return m_matrix; }
109 const MatrixTypeNestedCleaned& nestedExpression()
const {
return m_matrix; }
111 MatrixTypeNestedCleaned& nestedExpression() {
return m_matrix; }
114 template<
typename OtherDerived>
123 template<
typename OtherDerived>
friend 131 friend EIGEN_DEVICE_FUNC
133 operator*(
const Scalar& s,
const SelfAdjointView& mat)
135 return (s*mat.nestedExpression()).
template selfadjointView<UpLo>();
148 template<
typename DerivedU,
typename DerivedV>
162 template<
typename DerivedU>
176 template<
unsigned int TriMode>
196 typename MatrixType::ConstDiagonalReturnType
diagonal()
const 198 return typename MatrixType::ConstDiagonalReturnType(m_matrix);
214 EigenvaluesReturnType eigenvalues()
const;
216 RealScalar operatorNorm()
const;
219 MatrixTypeNested m_matrix;
237 template<
typename MatrixType,
unsigned int Mode>
244 template<
int UpLo,
int SetOpposite,
typename DstEvaluatorTypeT,
typename SrcEvaluatorTypeT,
typename Functor,
int Version>
250 typedef typename Base::DstXprType DstXprType;
251 typedef typename Base::SrcXprType SrcXprType;
254 using Base::m_functor;
257 typedef typename Base::DstEvaluatorType DstEvaluatorType;
258 typedef typename Base::SrcEvaluatorType SrcEvaluatorType;
259 typedef typename Base::Scalar Scalar;
264 : Base(dst, src, func, dstExpr)
267 EIGEN_DEVICE_FUNC
void assignCoeff(
Index row,
Index col)
269 eigen_internal_assert(row!=col);
270 Scalar tmp = m_src.coeff(row,col);
271 m_functor.assignCoeff(m_dst.coeffRef(row,col), tmp);
272 m_functor.assignCoeff(m_dst.coeffRef(col,row), numext::conj(tmp));
275 EIGEN_DEVICE_FUNC
void assignDiagonalCoeff(
Index id)
277 Base::assignCoeff(
id,
id);
280 EIGEN_DEVICE_FUNC
void assignOppositeCoeff(
Index,
Index)
281 { eigen_internal_assert(
false &&
"should never be called"); }
290 template<
typename Derived>
291 template<
unsigned int UpLo>
295 return typename ConstSelfAdjointViewReturnType<UpLo>::Type(derived());
298 template<
typename Derived>
299 template<
unsigned int UpLo>
303 return typename SelfAdjointViewReturnType<UpLo>::Type(derived());
308 #endif // EIGEN_SELFADJOINTMATRIX_H Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:50
Matrix< RealScalar, internal::traits< MatrixType >::ColsAtCompileTime, 1 > EigenvaluesReturnType
Return type of eigenvalues()
Definition: SelfAdjointView.h:211
Definition: NonLinearOptimization.cpp:108
Definition: AssignEvaluator.h:28
Definition: Constants.h:526
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
Base class for triangular part in a matrix.
Definition: TriangularMatrix.h:27
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:150
EIGEN_DEVICE_FUNC MatrixType::ConstDiagonalReturnType diagonal() const
Definition: SelfAdjointView.h:196
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:139
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
NumTraits< Scalar >::Real RealScalar
Real part of Scalar.
Definition: SelfAdjointView.h:209
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:37
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition: Constants.h:89
internal::traits< SelfAdjointView >::Scalar Scalar
The type of coefficients in this matrix.
Definition: SelfAdjointView.h:61
View matrix as a lower triangular matrix.
Definition: Constants.h:204
Definition: Constants.h:518
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:52
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:49
Definition: XprHelper.h:396
Definition: TriangularMatrix.h:730
View matrix as an upper triangular matrix.
Definition: Constants.h:206
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Definition: CoreEvaluators.h:79
Used in BandMatrix and SelfAdjointView to indicate that the matrix is self-adjoint.
Definition: Constants.h:220
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:186
Definition: AssignEvaluator.h:596
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
EIGEN_DEVICE_FUNC internal::conditional<(TriMode &(Upper|Lower))==(UpLo &(Upper|Lower)), TriangularView< MatrixType, TriMode >, TriangularView< typename MatrixType::AdjointReturnType, TriMode > >::type triangularView() const
Definition: SelfAdjointView.h:181
EIGEN_DEVICE_FUNC const Product< SelfAdjointView, OtherDerived > operator*(const MatrixBase< OtherDerived > &rhs) const
Efficient triangular matrix times vector/matrix product.
Definition: SelfAdjointView.h:117
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:125
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:126
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:630
EIGEN_DEVICE_FUNC Scalar coeff(Index row, Index col) const
Definition: SelfAdjointView.h:87
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index col)
Definition: SelfAdjointView.h:97