Public Types | Public Member Functions | Protected Attributes | Friends

SparseSelfAdjointView< MatrixType, UpLo > Class Template Reference

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

#include <SparseSelfAdjointView.h>

Inheritance diagram for SparseSelfAdjointView< MatrixType, UpLo >:
EigenBase< SparseSelfAdjointView< MatrixType, UpLo > >

List of all members.

Public Types

typedef MatrixType::Scalar Scalar
typedef MatrixType::Index Index
typedef Matrix< Index, Dynamic, 1 > VectorI
typedef MatrixType::Nested MatrixTypeNested
typedef internal::remove_all
< MatrixTypeNested >::type 
_MatrixTypeNested

Public Member Functions

 SparseSelfAdjointView (const MatrixType &matrix)
Index rows () const
Index cols () const
const _MatrixTypeNestedmatrix () const
_MatrixTypeNestedmatrix ()
template<typename OtherDerived >
SparseSelfAdjointTimeDenseProduct
< MatrixType, OtherDerived,
UpLo > 
operator* (const MatrixBase< OtherDerived > &rhs) const
template<typename DerivedU >
SparseSelfAdjointViewrankUpdate (const SparseMatrixBase< DerivedU > &u, Scalar alpha=Scalar(1))
template<typename DestScalar >
void evalTo (SparseMatrix< DestScalar > &_dest) const
template<typename DestScalar >
void evalTo (DynamicSparseMatrix< DestScalar > &_dest) const
SparseSymmetricPermutationProduct
< _MatrixTypeNested, UpLo > 
twistedBy (const PermutationMatrix< Dynamic > &perm) const
template<typename SrcMatrixType , int SrcUpLo>
SparseSelfAdjointViewoperator= (const SparseSymmetricPermutationProduct< SrcMatrixType, SrcUpLo > &permutedMatrix)

Protected Attributes

const MatrixType::Nested m_matrix
VectorI m_countPerRow
VectorI m_countPerCol

Friends

template<typename OtherDerived >
DenseTimeSparseSelfAdjointProduct
< OtherDerived, MatrixType,
UpLo > 
operator* (const MatrixBase< OtherDerived > &lhs, const SparseSelfAdjointView &rhs)

Detailed Description

template<typename MatrixType, unsigned int UpLo>
class SparseSelfAdjointView< MatrixType, UpLo >

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

Parameters:
MatrixType the type of the dense matrix storing the coefficients
UpLo can 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

template<typename MatrixType, unsigned int UpLo>
typedef internal::remove_all<MatrixTypeNested>::type SparseSelfAdjointView< MatrixType, UpLo >::_MatrixTypeNested
template<typename MatrixType, unsigned int UpLo>
typedef MatrixType::Index SparseSelfAdjointView< MatrixType, UpLo >::Index
template<typename MatrixType, unsigned int UpLo>
typedef MatrixType::Nested SparseSelfAdjointView< MatrixType, UpLo >::MatrixTypeNested
template<typename MatrixType, unsigned int UpLo>
typedef MatrixType::Scalar SparseSelfAdjointView< MatrixType, UpLo >::Scalar
template<typename MatrixType, unsigned int UpLo>
typedef Matrix<Index,Dynamic,1> SparseSelfAdjointView< MatrixType, UpLo >::VectorI

Constructor & Destructor Documentation

template<typename MatrixType, unsigned int UpLo>
SparseSelfAdjointView< MatrixType, UpLo >::SparseSelfAdjointView ( const MatrixType &  matrix  )  [inline]

Member Function Documentation

template<typename MatrixType, unsigned int UpLo>
Index SparseSelfAdjointView< MatrixType, UpLo >::cols ( void   )  const [inline]
Returns:
the number of columns.
See also:
rows(), ColsAtCompileTime

Reimplemented from EigenBase< SparseSelfAdjointView< MatrixType, UpLo > >.

template<typename MatrixType, unsigned int UpLo>
template<typename DestScalar >
void SparseSelfAdjointView< MatrixType, UpLo >::evalTo ( DynamicSparseMatrix< DestScalar > &  _dest  )  const [inline]
template<typename MatrixType, unsigned int UpLo>
template<typename DestScalar >
void SparseSelfAdjointView< MatrixType, UpLo >::evalTo ( SparseMatrix< DestScalar > &  _dest  )  const [inline]
template<typename MatrixType, unsigned int UpLo>
_MatrixTypeNested& SparseSelfAdjointView< MatrixType, UpLo >::matrix (  )  [inline]
template<typename MatrixType, unsigned int UpLo>
const _MatrixTypeNested& SparseSelfAdjointView< MatrixType, UpLo >::matrix (  )  const [inline]
template<typename MatrixType, unsigned int UpLo>
template<typename OtherDerived >
SparseSelfAdjointTimeDenseProduct<MatrixType,OtherDerived,UpLo> SparseSelfAdjointView< MatrixType, UpLo >::operator* ( const MatrixBase< OtherDerived > &  rhs  )  const [inline]

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

template<typename MatrixType, unsigned int UpLo>
template<typename SrcMatrixType , int SrcUpLo>
SparseSelfAdjointView& SparseSelfAdjointView< MatrixType, UpLo >::operator= ( const SparseSymmetricPermutationProduct< SrcMatrixType, SrcUpLo > &  permutedMatrix  )  [inline]
template<typename MatrixType , unsigned int UpLo>
template<typename DerivedU >
SparseSelfAdjointView< MatrixType, UpLo > & SparseSelfAdjointView< MatrixType, UpLo >::rankUpdate ( const SparseMatrixBase< DerivedU > &  u,
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

Note that it is faster to set alpha=0 than initializing the matrix to zero and then keep the default value alpha=1.

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

template<typename MatrixType, unsigned int UpLo>
Index SparseSelfAdjointView< MatrixType, UpLo >::rows ( void   )  const [inline]
Returns:
the number of rows.
See also:
cols(), RowsAtCompileTime

Reimplemented from EigenBase< SparseSelfAdjointView< MatrixType, UpLo > >.

template<typename MatrixType, unsigned int UpLo>
SparseSymmetricPermutationProduct<_MatrixTypeNested,UpLo> SparseSelfAdjointView< MatrixType, UpLo >::twistedBy ( const PermutationMatrix< Dynamic > &  perm  )  const [inline]
Returns:
an expression of P^-1 H P

Friends And Related Function Documentation

template<typename MatrixType, unsigned int UpLo>
template<typename OtherDerived >
DenseTimeSparseSelfAdjointProduct<OtherDerived,MatrixType,UpLo> operator* ( const MatrixBase< OtherDerived > &  lhs,
const SparseSelfAdjointView< MatrixType, UpLo > &  rhs 
) [friend]

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


Member Data Documentation

template<typename MatrixType, unsigned int UpLo>
VectorI SparseSelfAdjointView< MatrixType, UpLo >::m_countPerCol [mutable, protected]
template<typename MatrixType, unsigned int UpLo>
VectorI SparseSelfAdjointView< MatrixType, UpLo >::m_countPerRow [mutable, protected]
template<typename MatrixType, unsigned int UpLo>
const MatrixType::Nested SparseSelfAdjointView< MatrixType, UpLo >::m_matrix [protected]

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