MOAB  4.9.3pre
Eigen::SparseSelfAdjointView< MatrixType, _Mode > Class Template Reference

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

#include <SparseSelfAdjointView.h>

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

List of all members.

Public Types

enum  { Mode = _Mode, RowsAtCompileTime = internal::traits<SparseSelfAdjointView>::RowsAtCompileTime, ColsAtCompileTime = internal::traits<SparseSelfAdjointView>::ColsAtCompileTime }
typedef EigenBase
< SparseSelfAdjointView
Base
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

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, Mode
twistedBy (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)

Protected Attributes

MatrixTypeNested m_matrix

Private Member Functions

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

Friends

template<typename OtherDerived >
Product< OtherDerived,
SparseSelfAdjointView
operator* (const SparseMatrixBase< OtherDerived > &lhs, const SparseSelfAdjointView &rhs)
template<typename OtherDerived >
Product< OtherDerived,
SparseSelfAdjointView
operator* (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()

Definition at line 43 of file SparseSelfAdjointView.h.


Member Typedef Documentation

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

Definition at line 59 of file SparseSelfAdjointView.h.

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

Definition at line 54 of file SparseSelfAdjointView.h.

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

Definition at line 58 of file SparseSelfAdjointView.h.

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

Definition at line 55 of file SparseSelfAdjointView.h.

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

Definition at line 56 of file SparseSelfAdjointView.h.

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

Definition at line 57 of file SparseSelfAdjointView.h.


Member Enumeration Documentation

template<typename MatrixType, unsigned int _Mode>
anonymous enum
Enumerator:
Mode 
RowsAtCompileTime 
ColsAtCompileTime 

Definition at line 48 of file SparseSelfAdjointView.h.

         {
      Mode = _Mode,
      RowsAtCompileTime = internal::traits<SparseSelfAdjointView>::RowsAtCompileTime,
      ColsAtCompileTime = internal::traits<SparseSelfAdjointView>::ColsAtCompileTime
    };

Constructor & Destructor Documentation

template<typename MatrixType, unsigned int _Mode>
Eigen::SparseSelfAdjointView< MatrixType, _Mode >::SparseSelfAdjointView ( MatrixType &  matrix) [inline, explicit]

Definition at line 61 of file SparseSelfAdjointView.h.

                                                              : m_matrix(matrix)
    {
      eigen_assert(rows()==cols() && "SelfAdjointView is only for squared matrices");
    }

Member Function Documentation

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

Reimplemented from Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >.

Definition at line 67 of file SparseSelfAdjointView.h.

{ return m_matrix.cols(); }
template<typename MatrixType, unsigned int _Mode>
template<typename Dest >
void Eigen::SparseSelfAdjointView< MatrixType, _Mode >::evalTo ( Dest &  dst) const [private]

Don't use it, but do the equivalent:

 dst = *this; 

Reimplemented from Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >.

template<typename MatrixType, unsigned int _Mode>
const _MatrixTypeNested& Eigen::SparseSelfAdjointView< MatrixType, _Mode >::matrix ( ) const [inline]
Returns:
a reference to the nested matrix

Definition at line 70 of file SparseSelfAdjointView.h.

{ return m_matrix; }
template<typename MatrixType, unsigned int _Mode>
internal::remove_reference<MatrixTypeNested>::type& Eigen::SparseSelfAdjointView< MatrixType, _Mode >::matrix ( ) [inline]

Definition at line 71 of file SparseSelfAdjointView.h.

{ return m_matrix; }
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.

Definition at line 80 of file SparseSelfAdjointView.h.

    {
      return Product<SparseSelfAdjointView, OtherDerived>(*this, rhs.derived());
    }
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

Definition at line 100 of file SparseSelfAdjointView.h.

    {
      return Product<SparseSelfAdjointView,OtherDerived>(*this, rhs.derived());
    }
template<typename MatrixType, unsigned int _Mode>
template<typename SrcMatrixType , int SrcMode>
SparseSelfAdjointView& Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator= ( const SparseSymmetricPermutationProduct< SrcMatrixType, SrcMode > &  permutedMatrix) [inline]

Definition at line 132 of file SparseSelfAdjointView.h.

    {
      internal::call_assignment_no_alias_no_transpose(*this, permutedMatrix);
      return *this;
    }
template<typename MatrixType, unsigned int _Mode>
SparseSelfAdjointView& Eigen::SparseSelfAdjointView< MatrixType, _Mode >::operator= ( const SparseSelfAdjointView< MatrixType, _Mode > &  src) [inline]

Definition at line 138 of file SparseSelfAdjointView.h.

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

Definition at line 145 of file SparseSelfAdjointView.h.

    {
      PermutationMatrix<Dynamic,Dynamic,StorageIndex> pnull;
      return *this = src.twistedBy(pnull);
    }
template<typename MatrixType , unsigned int Mode>
template<typename DerivedU >
SparseSelfAdjointView< MatrixType, Mode > & 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().

Definition at line 193 of file SparseSelfAdjointView.h.

{
  SparseMatrix<Scalar,(MatrixType::Flags&RowMajorBit)?RowMajor:ColMajor> tmp = u * u.adjoint();
  if(alpha==Scalar(0))
    m_matrix = tmp.template triangularView<Mode>();
  else
    m_matrix += alpha * tmp.template triangularView<Mode>();

  return *this;
}
template<typename MatrixType, unsigned int _Mode>
void Eigen::SparseSelfAdjointView< MatrixType, _Mode >::resize ( Index  rows,
Index  cols 
) [inline]

Definition at line 151 of file SparseSelfAdjointView.h.

    {
      EIGEN_ONLY_USED_FOR_DEBUG(rows);
      EIGEN_ONLY_USED_FOR_DEBUG(cols);
      eigen_assert(rows == this->rows() && cols == this->cols()
                && "SparseSelfadjointView::resize() does not actually allow to resize.");
    }
template<typename MatrixType, unsigned int _Mode>
Index Eigen::SparseSelfAdjointView< MatrixType, _Mode >::rows ( void  ) const [inline]
Returns:
the number of rows.
See also:
cols(), RowsAtCompileTime

Reimplemented from Eigen::EigenBase< SparseSelfAdjointView< MatrixType, _Mode > >.

Definition at line 66 of file SparseSelfAdjointView.h.

{ return m_matrix.rows(); }
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

Definition at line 126 of file SparseSelfAdjointView.h.

    {
      return SparseSymmetricPermutationProduct<_MatrixTypeNested,Mode>(m_matrix, perm);
    }

Friends And Related Function Documentation

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.

Definition at line 92 of file SparseSelfAdjointView.h.

    {
      return Product<OtherDerived, SparseSelfAdjointView>(lhs.derived(), rhs);
    }
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

Definition at line 108 of file SparseSelfAdjointView.h.

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

Member Data Documentation

template<typename MatrixType, unsigned int _Mode>
MatrixTypeNested Eigen::SparseSelfAdjointView< MatrixType, _Mode >::m_matrix [protected]

Definition at line 161 of file SparseSelfAdjointView.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines