Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::SparseSelfAdjointView< MatrixType, _Mode > Class Template Reference

Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix. More...

#include <src/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h>

+ Inheritance diagram for Eigen::SparseSelfAdjointView< MatrixType, _Mode >:
+ Collaboration diagram for Eigen::SparseSelfAdjointView< MatrixType, _Mode >:

Public Types

enum  { Mode = _Mode , TransposeMode = ((Mode & Upper) ? Lower : 0) | ((Mode & Lower) ? Upper : 0) , RowsAtCompileTime = internal::traits<SparseSelfAdjointView>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<SparseSelfAdjointView>::ColsAtCompileTime }
 
typedef EigenBase< SparseSelfAdjointViewBase
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef Matrix< StorageIndex, Dynamic, 1 > VectorI
 
typedef internal::ref_selector< MatrixType >::non_const_type MatrixTypeNested
 
typedef internal::remove_all< MatrixTypeNested >::type _MatrixTypeNested
 
typedef Eigen::Index Index
 The interface type of indices.
 
typedef internal::traits< SparseSelfAdjointView< MatrixType, _Mode > >::StorageKind StorageKind
 

Public Member Functions

 SparseSelfAdjointView (MatrixType &matrix)
 
Index rows () const
 
Index cols () const
 
const _MatrixTypeNestedmatrix () const
 
internal::remove_reference< MatrixTypeNested >::type & matrix ()
 
template<typename OtherDerived >
Product< SparseSelfAdjointView, OtherDerived > operator* (const SparseMatrixBase< OtherDerived > &rhs) const
 
template<typename OtherDerived >
Product< SparseSelfAdjointView, OtherDerived > operator* (const MatrixBase< OtherDerived > &rhs) const
 
template<typename DerivedU >
SparseSelfAdjointViewrankUpdate (const SparseMatrixBase< DerivedU > &u, const Scalar &alpha=Scalar(1))
 
SparseSymmetricPermutationProduct< _MatrixTypeNested, ModetwistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
 
template<typename SrcMatrixType , int SrcMode>
SparseSelfAdjointViewoperator= (const SparseSymmetricPermutationProduct< SrcMatrixType, SrcMode > &permutedMatrix)
 
SparseSelfAdjointViewoperator= (const SparseSelfAdjointView &src)
 
template<typename SrcMatrixType , unsigned int SrcMode>
SparseSelfAdjointViewoperator= (const SparseSelfAdjointView< SrcMatrixType, SrcMode > &src)
 
void resize (Index rows, Index cols)
 
template<typename DerivedU >
SparseSelfAdjointView< MatrixType, Mode > & rankUpdate (const SparseMatrixBase< DerivedU > &u, const Scalar &alpha)
 
EIGEN_DEVICE_FUNC SparseSelfAdjointView< MatrixType, _Mode > & derived ()
 
EIGEN_DEVICE_FUNC const SparseSelfAdjointView< MatrixType, _Mode > & derived () const
 
EIGEN_DEVICE_FUNC SparseSelfAdjointView< MatrixType, _Mode > & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const SparseSelfAdjointView< MatrixType, _Mode > & const_derived () const
 
EIGEN_DEVICE_FUNC Index size () const
 
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 

Protected Attributes

MatrixTypeNested m_matrix
 

Private Member Functions

template<typename Dest >
void evalTo (Dest &) const
 

Friends

template<typename OtherDerived >
Product< OtherDerived, SparseSelfAdjointViewoperator* (const SparseMatrixBase< OtherDerived > &lhs, const SparseSelfAdjointView &rhs)
 
template<typename OtherDerived >
Product< OtherDerived, SparseSelfAdjointViewoperator* (const MatrixBase< OtherDerived > &lhs, const SparseSelfAdjointView &rhs)
 

Detailed Description

template<typename MatrixType, unsigned int _Mode>
class Eigen::SparseSelfAdjointView< MatrixType, _Mode >

Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.

Parameters
MatrixTypethe type of the dense matrix storing the coefficients
Modecan be either Lower or Upper

This class is an expression of a sefladjoint matrix from a triangular part of a matrix with given dense storage of the coefficients. It is the return type of MatrixBase::selfadjointView() and most of the time this is the only way that it is used.

See also
SparseMatrixBase::selfadjointView()

Member Typedef Documentation

◆ _MatrixTypeNested

template<typename MatrixType , unsigned int _Mode>
typedef internal::remove_all<MatrixTypeNested>::type Eigen::SparseSelfAdjointView< MatrixType, _Mode >::_MatrixTypeNested

◆ Base

template<typename MatrixType , unsigned int _Mode>
typedef EigenBase<SparseSelfAdjointView> Eigen::SparseSelfAdjointView< MatrixType, _Mode >::Base

◆ Index

typedef Eigen::Index Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::Index
inherited

The interface type of indices.

To change this, #define the preprocessor symbol EIGEN_DEFAULT_DENSE_INDEX_TYPE.

See also
StorageIndex, TopicPreprocessorDirectives.

◆ MatrixTypeNested

template<typename MatrixType , unsigned int _Mode>
typedef internal::ref_selector<MatrixType>::non_const_type Eigen::SparseSelfAdjointView< MatrixType, _Mode >::MatrixTypeNested

◆ Scalar

template<typename MatrixType , unsigned int _Mode>
typedef MatrixType::Scalar Eigen::SparseSelfAdjointView< MatrixType, _Mode >::Scalar

◆ StorageIndex

template<typename MatrixType , unsigned int _Mode>
typedef MatrixType::StorageIndex Eigen::SparseSelfAdjointView< MatrixType, _Mode >::StorageIndex

◆ StorageKind

typedef internal::traits<SparseSelfAdjointView< MatrixType, _Mode > >::StorageKind Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::StorageKind
inherited

◆ VectorI

template<typename MatrixType , unsigned int _Mode>
typedef Matrix<StorageIndex,Dynamic,1> Eigen::SparseSelfAdjointView< MatrixType, _Mode >::VectorI

Member Enumeration Documentation

◆ anonymous enum

template<typename MatrixType , unsigned int _Mode>
anonymous enum
Enumerator
Mode 
TransposeMode 
RowsAtCompileTime 
ColsAtCompileTime 
48 {
49 Mode = _Mode,
50 TransposeMode = ((Mode & Upper) ? Lower : 0) | ((Mode & Lower) ? Upper : 0),
53 };
@ Mode
Definition SparseSelfAdjointView.h:49
@ TransposeMode
Definition SparseSelfAdjointView.h:50
@ ColsAtCompileTime
Definition SparseSelfAdjointView.h:52
@ RowsAtCompileTime
Definition SparseSelfAdjointView.h:51
SparseSelfAdjointView(MatrixType &matrix)
Definition SparseSelfAdjointView.h:62
@ Lower
Definition Constants.h:204
@ Upper
Definition Constants.h:206
Definition Eigen_Colamd.h:50

Constructor & Destructor Documentation

◆ SparseSelfAdjointView()

template<typename MatrixType , unsigned int _Mode>
Eigen::SparseSelfAdjointView< MatrixType, _Mode >::SparseSelfAdjointView ( MatrixType &  matrix)
inlineexplicit
63 {
64 eigen_assert(rows()==cols() && "SelfAdjointView is only for squared matrices");
65 }
#define eigen_assert(x)
Definition Macros.h:579
const _MatrixTypeNested & matrix() const
Definition SparseSelfAdjointView.h:71
MatrixTypeNested m_matrix
Definition SparseSelfAdjointView.h:162
Index rows() const
Definition SparseSelfAdjointView.h:67
Index cols() const
Definition SparseSelfAdjointView.h:68

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::cols(), eigen_assert, and Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rows().

+ Here is the call graph for this function:

Member Function Documentation

◆ addTo()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::addTo ( Dest &  dst) const
inlineinherited
78 {
79 // This is the default implementation,
80 // derived class can reimplement it in a more optimized way.
81 typename Dest::PlainObject res(rows(),cols());
82 evalTo(res);
83 dst += res;
84 }
EIGEN_DEVICE_FUNC Index cols() const
Definition EigenBase.h:62
EIGEN_DEVICE_FUNC Index rows() const
Definition EigenBase.h:59
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition EigenBase.h:71

◆ applyThisOnTheLeft()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::applyThisOnTheLeft ( Dest &  dst) const
inlineinherited
110 {
111 // This is the default implementation,
112 // derived class can reimplement it in a more optimized way.
113 dst = this->derived() * dst;
114 }
EIGEN_DEVICE_FUNC SparseSelfAdjointView< MatrixType, _Mode > & derived()
Definition EigenBase.h:45

◆ applyThisOnTheRight()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::applyThisOnTheRight ( Dest &  dst) const
inlineinherited
101 {
102 // This is the default implementation,
103 // derived class can reimplement it in a more optimized way.
104 dst = dst * this->derived();
105 }

◆ cols()

template<typename MatrixType , unsigned int _Mode>
Index Eigen::SparseSelfAdjointView< MatrixType, _Mode >::cols ( ) const
inline
68{ return m_matrix.cols(); }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix.

Referenced by Eigen::SparseSelfAdjointView< MatrixType, _Mode >::SparseSelfAdjointView(), and Eigen::SparseSelfAdjointView< MatrixType, _Mode >::resize().

+ Here is the caller graph for this function:

◆ const_cast_derived()

EIGEN_DEVICE_FUNC SparseSelfAdjointView< MatrixType, _Mode > & Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::const_cast_derived ( ) const
inlineinherited
52 { return *static_cast<Derived*>(const_cast<EigenBase*>(this)); }

◆ const_derived()

EIGEN_DEVICE_FUNC const SparseSelfAdjointView< MatrixType, _Mode > & Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::const_derived ( ) const
inlineinherited
55 { return *static_cast<const Derived*>(this); }

◆ derived() [1/2]

EIGEN_DEVICE_FUNC SparseSelfAdjointView< MatrixType, _Mode > & Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::derived ( )
inlineinherited
Returns
a reference to the derived object
45{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const SparseSelfAdjointView< MatrixType, _Mode > & Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::derived ( ) const
inlineinherited
Returns
a const reference to the derived object
48{ return *static_cast<const Derived*>(this); }

◆ evalTo()

template<typename MatrixType , unsigned int _Mode>
template<typename Dest >
void Eigen::SparseSelfAdjointView< MatrixType, _Mode >::evalTo ( Dest &  ) const
private

◆ matrix() [1/2]

template<typename MatrixType , unsigned int _Mode>
internal::remove_reference< MatrixTypeNested >::type & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::matrix ( )
inline

◆ matrix() [2/2]

template<typename MatrixType , unsigned int _Mode>
const _MatrixTypeNested & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::matrix ( ) const
inline
71{ return m_matrix; }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix.

Referenced by Eigen::internal::Assignment< DstXprType, SparseSymmetricPermutationProduct< MatrixType, Mode >, internal::assign_op< Scalar, typename MatrixType::Scalar >, Sparse2Sparse >::run().

+ Here is the caller graph for this function:

◆ operator*() [1/2]

template<typename MatrixType , unsigned int _Mode>
template<typename OtherDerived >
Product< SparseSelfAdjointView, OtherDerived > Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator* ( const MatrixBase< OtherDerived > &  rhs) const
inline

Efficient sparse self-adjoint matrix times dense vector/matrix product

102 {
103 return Product<SparseSelfAdjointView,OtherDerived>(*this, rhs.derived());
104 }

◆ operator*() [2/2]

template<typename MatrixType , unsigned int _Mode>
template<typename OtherDerived >
Product< SparseSelfAdjointView, OtherDerived > Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator* ( const SparseMatrixBase< OtherDerived > &  rhs) const
inline
Returns
an expression of the matrix product between a sparse self-adjoint matrix *this and a sparse matrix rhs.

Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product. Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.

82 {
83 return Product<SparseSelfAdjointView, OtherDerived>(*this, rhs.derived());
84 }

References Eigen::SparseMatrixBase< Derived >::derived().

+ Here is the call graph for this function:

◆ operator=() [1/3]

template<typename MatrixType , unsigned int _Mode>
SparseSelfAdjointView & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator= ( const SparseSelfAdjointView< MatrixType, _Mode > &  src)
inline
140 {
141 PermutationMatrix<Dynamic,Dynamic,StorageIndex> pnull;
142 return *this = src.twistedBy(pnull);
143 }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::twistedBy().

+ Here is the call graph for this function:

◆ operator=() [2/3]

template<typename MatrixType , unsigned int _Mode>
template<typename SrcMatrixType , unsigned int SrcMode>
SparseSelfAdjointView & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator= ( const SparseSelfAdjointView< SrcMatrixType, SrcMode > &  src)
inline
147 {
148 PermutationMatrix<Dynamic,Dynamic,StorageIndex> pnull;
149 return *this = src.twistedBy(pnull);
150 }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::twistedBy().

+ Here is the call graph for this function:

◆ operator=() [3/3]

template<typename MatrixType , unsigned int _Mode>
template<typename SrcMatrixType , int SrcMode>
SparseSelfAdjointView & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator= ( const SparseSymmetricPermutationProduct< SrcMatrixType, SrcMode > &  permutedMatrix)
inline
134 {
136 return *this;
137 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias_no_transpose(Dst &dst, const Src &src, const Func &func)
Definition AssignEvaluator.h:847

References Eigen::internal::call_assignment_no_alias_no_transpose().

+ Here is the call graph for this function:

◆ rankUpdate() [1/2]

template<typename MatrixType , unsigned int _Mode>
template<typename DerivedU >
SparseSelfAdjointView< MatrixType, Mode > & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rankUpdate ( const SparseMatrixBase< DerivedU > &  u,
const Scalar alpha 
)
195{
196 SparseMatrix<Scalar,(MatrixType::Flags&RowMajorBit)?RowMajor:ColMajor> tmp = u * u.adjoint();
197 if(alpha==Scalar(0))
198 m_matrix = tmp.template triangularView<Mode>();
199 else
200 m_matrix += alpha * tmp.template triangularView<Mode>();
201
202 return *this;
203}
MatrixType::Scalar Scalar
Definition SparseSelfAdjointView.h:56
@ ColMajor
Definition Constants.h:320
@ RowMajor
Definition Constants.h:322
const unsigned int RowMajorBit
Definition Constants.h:61

References Eigen::SparseMatrixBase< Derived >::adjoint(), Eigen::ColMajor, Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix, Eigen::RowMajor, and Eigen::RowMajorBit.

+ Here is the call graph for this function:

◆ rankUpdate() [2/2]

template<typename MatrixType , unsigned int _Mode>
template<typename DerivedU >
SparseSelfAdjointView & Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rankUpdate ( const SparseMatrixBase< DerivedU > &  u,
const Scalar alpha = Scalar(1) 
)

Perform a symmetric rank K update of the selfadjoint matrix *this: $ this = this + \alpha ( u u^* ) $ where u is a vector or matrix.

Returns
a reference to *this

To perform $ this = this + \alpha ( u^* u ) $ you can simply call this function with u.adjoint().

◆ resize()

template<typename MatrixType , unsigned int _Mode>
void Eigen::SparseSelfAdjointView< MatrixType, _Mode >::resize ( Index  rows,
Index  cols 
)
inline
153 {
156 eigen_assert(rows == this->rows() && cols == this->cols()
157 && "SparseSelfadjointView::resize() does not actually allow to resize.");
158 }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition Macros.h:591

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::cols(), eigen_assert, EIGEN_ONLY_USED_FOR_DEBUG, and Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rows().

+ Here is the call graph for this function:

◆ rows()

template<typename MatrixType , unsigned int _Mode>
Index Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rows ( ) const
inline
67{ return m_matrix.rows(); }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix.

Referenced by Eigen::SparseSelfAdjointView< MatrixType, _Mode >::SparseSelfAdjointView(), and Eigen::SparseSelfAdjointView< MatrixType, _Mode >::resize().

+ Here is the caller graph for this function:

◆ size()

EIGEN_DEVICE_FUNC Index Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::size ( ) const
inlineinherited
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols(), SizeAtCompileTime.
66{ return rows() * cols(); }

◆ subTo()

EIGEN_DEVICE_FUNC void Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >::subTo ( Dest &  dst) const
inlineinherited
90 {
91 // This is the default implementation,
92 // derived class can reimplement it in a more optimized way.
93 typename Dest::PlainObject res(rows(),cols());
94 evalTo(res);
95 dst -= res;
96 }

◆ twistedBy()

template<typename MatrixType , unsigned int _Mode>
SparseSymmetricPermutationProduct< _MatrixTypeNested, Mode > Eigen::SparseSelfAdjointView< MatrixType, _Mode >::twistedBy ( const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &  perm) const
inline
Returns
an expression of P H P^-1
128 {
129 return SparseSymmetricPermutationProduct<_MatrixTypeNested,Mode>(m_matrix, perm);
130 }

References Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix.

Referenced by Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator=(), and Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator=().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator* [1/2]

template<typename MatrixType , unsigned int _Mode>
template<typename OtherDerived >
Product< OtherDerived, SparseSelfAdjointView > operator* ( const MatrixBase< OtherDerived > &  lhs,
const SparseSelfAdjointView< MatrixType, _Mode > &  rhs 
)
friend

Efficient dense vector/matrix times sparse self-adjoint matrix product

110 {
111 return Product<OtherDerived,SparseSelfAdjointView>(lhs.derived(), rhs);
112 }

◆ operator* [2/2]

template<typename MatrixType , unsigned int _Mode>
template<typename OtherDerived >
Product< OtherDerived, SparseSelfAdjointView > operator* ( const SparseMatrixBase< OtherDerived > &  lhs,
const SparseSelfAdjointView< MatrixType, _Mode > &  rhs 
)
friend
Returns
an expression of the matrix product between a sparse matrix lhs and a sparse self-adjoint matrix rhs.

Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product. Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product.

94 {
95 return Product<OtherDerived, SparseSelfAdjointView>(lhs.derived(), rhs);
96 }

Member Data Documentation

◆ m_matrix


The documentation for this class was generated from the following file: