Public Types | Public Member Functions | Protected Member Functions | List of all members
DenseCoeffsBase< Derived, ReadOnlyAccessors > Class Template Reference

Base class providing read-only coefficient access to matrices and arrays. More...

#include <DenseCoeffsBase.h>

+ Inheritance diagram for DenseCoeffsBase< Derived, ReadOnlyAccessors >:

Public Types

typedef EigenBase< Derived > Base
typedef internal::conditional
< bool(internal::traits
< Derived >::Flags &LvalueBit),
const Scalar &, typename
internal::conditional
< internal::is_arithmetic
< Scalar >::value, Scalar,
const Scalar >::type >::type 
CoeffReturnType
typedef internal::traits
< Derived >::Index 
Index
typedef
internal::add_const_on_value_type_if_arithmetic
< typename
internal::packet_traits
< Scalar >::type >::type 
PacketReturnType
typedef
internal::packet_traits
< Scalar >::type 
PacketScalar
typedef internal::traits
< Derived >::Scalar 
Scalar
typedef internal::traits
< Derived >::StorageKind 
StorageKind

Public Member Functions

template<typename Dest >
void addTo (Dest &dst) const
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
CoeffReturnType coeff (Index row, Index col) const
CoeffReturnType coeff (Index index) const
CoeffReturnType coeffByOuterInner (Index outer, Index inner) const
Index colIndexByOuterInner (Index outer, Index inner) const
Index cols () const
Derived & const_cast_derived () const
const Derived & const_derived () const
Derived & derived ()
const Derived & derived () const
template<typename Dest >
void evalTo (Dest &dst) const
CoeffReturnType operator() (Index row, Index col) const
CoeffReturnType operator() (Index index) const
CoeffReturnType operator[] (Index index) const
template<int LoadMode>
PacketReturnType packet (Index row, Index col) const
template<int LoadMode>
PacketReturnType packet (Index index) const
template<int LoadMode>
PacketReturnType packetByOuterInner (Index outer, Index inner) const
Index rowIndexByOuterInner (Index outer, Index inner) const
Index rows () const
Index size () const
template<typename Dest >
void subTo (Dest &dst) const
CoeffReturnType w () const
CoeffReturnType x () const
CoeffReturnType y () const
CoeffReturnType z () const

Protected Member Functions

void coeffRef ()
void coeffRefByOuterInner ()
void colStride ()
void copyCoeff ()
void copyCoeffByOuterInner ()
void copyPacket ()
void copyPacketByOuterInner ()
void innerStride ()
void outerStride ()
void rowStride ()
void stride ()
void writePacket ()
void writePacketByOuterInner ()

Detailed Description

template<typename Derived>
class Eigen::DenseCoeffsBase< Derived, ReadOnlyAccessors >

Base class providing read-only coefficient access to matrices and arrays.

Template Parameters
DerivedType of the derived class
ReadOnlyAccessorsConstant indicating read-only access

This class defines the operator() const function and friends, which can be used to read specific entries of a matrix or array.

See Also
DenseCoeffsBase<Derived, WriteAccessors>, DenseCoeffsBase<Derived, DirectAccessors>, The class hierarchy

Member Typedef Documentation

typedef EigenBase<Derived> Base
typedef internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit), const Scalar&, typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type >::type CoeffReturnType
typedef internal::traits<Derived>::Index Index
typedef internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits<Scalar>::type >::type PacketReturnType
typedef internal::packet_traits<Scalar>::type PacketScalar
typedef internal::traits<Derived>::Scalar Scalar
typedef internal::traits<Derived>::StorageKind StorageKind

Member Function Documentation

void addTo ( Dest &  dst) const
inlineinherited
void applyThisOnTheLeft ( Dest &  dst) const
inlineinherited
void applyThisOnTheRight ( Dest &  dst) const
inlineinherited
CoeffReturnType coeff ( Index  row,
Index  col 
) const
inline

Short version: don't use this function, use operator()(Index,Index) const instead.

Long version: this function is similar to operator()(Index,Index) const , but without the assertion. Use this for limiting the performance cost of debugging code when doing repeated coefficient access. Only use this when it is guaranteed that the parameters row and col are in range.

If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this function equivalent to operator()(Index,Index) const .

See Also
operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const

References eigen_internal_assert.

CoeffReturnType coeff ( Index  index) const
inline

Short version: don't use this function, use operator[](Index) const instead.

Long version: this function is similar to operator[](Index) const , but without the assertion. Use this for limiting the performance cost of debugging code when doing repeated coefficient access. Only use this when it is guaranteed that the parameter index is in range.

If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this function equivalent to operator[](Index) const .

See Also
operator[](Index) const, coeffRef(Index), coeff(Index,Index) const

References eigen_internal_assert.

CoeffReturnType coeffByOuterInner ( Index  outer,
Index  inner 
) const
inline
void coeffRef ( )
protected
void coeffRefByOuterInner ( )
protected
Index colIndexByOuterInner ( Index  outer,
Index  inner 
) const
inline

References Eigen::RowMajorBit.

Index cols ( void  ) const
inlineinherited
Returns
the number of columns.
See Also
rows(), ColsAtCompileTime

Reimplemented in Transpose< PermutationBase< Derived > >, SparseSymmetricPermutationProduct< MatrixType, UpLo >, SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size >, TriangularView< _MatrixType, _Mode >, HouseholderSequence< VectorsType, CoeffsType, Side >, SparseMatrixBase< Derived >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, SparseMatrixBase< Transpose< MatrixType > >, SparseMatrixBase< SparseDiagonalProduct< Lhs, Rhs > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, _Index > >, SparseMatrixBase< CwiseUnaryView< ViewOp, MatrixType > >, SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseDenseOuterProduct< Lhs, Rhs, Tr > >, SparseMatrixBase< SparseInnerVectorSet< MatrixType, Size > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >, SparseMatrix< _Scalar, _Options, _Index >, SparseMatrix< Scalar >, SparseMatrix< Scalar, ColMajor, Index >, SparseMatrix< Scalar, ColMajor >, SparseMatrix< Scalar, ColMajor, int >, SparseMatrix< Scalar, RowMajor, Index >, SparseMatrix< Scalar, RowMajor >, PermutationBase< Derived >, PermutationBase< PermutationWrapper< _IndicesType > >, PermutationBase< Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >, SparseDenseOuterProduct< Lhs, Rhs, Tr >, SparseVector< _Scalar, _Options, _Index >, SelfAdjointView< MatrixType, UpLo >, SparseSelfAdjointView< MatrixType, UpLo >, TriangularBase< Derived >, MappedSparseMatrix< _Scalar, _Flags, _Index >, TriangularBase< TriangularView< _MatrixType, _Mode > >, TriangularBase< SelfAdjointView< MatrixType, UpLo > >, SparseView< MatrixType >, and SparseTriangularView< MatrixType, Mode >.

Referenced by PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_resize_to_match(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::addTo(), Array< Index, 64, 1 >::Array(), Matrix< Index, 1, ColsAtCompileTime, RowMajor, 1, MaxColsAtCompileTime >::Matrix(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::size(), and EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::subTo().

void colStride ( )
protected
Derived& const_cast_derived ( ) const
inlineinherited
const Derived& const_derived ( ) const
inlineinherited
void copyCoeff ( )
protected
void copyCoeffByOuterInner ( )
protected
void copyPacket ( )
protected
void copyPacketByOuterInner ( )
protected
Derived& derived ( )
inlineinherited
Returns
a reference to the derived object

Referenced by MatrixBase< Derived >::applyOnTheLeft(), MatrixBase< Derived >::applyOnTheRight(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyThisOnTheLeft(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyThisOnTheRight(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheRight(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::assign(), SparseVector< _Scalar, _Options, _Index >::assign(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::assignGeneric(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::binaryExpr(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::coeff(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::coeffRef(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::cols(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::cols(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::cols(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::copyCoeff(), SparseMatrixBase< Derived >::dot(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::eval(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::evalTo(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::evalTo(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::indices(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::innerStride(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::inverse(), TriangularView< _MatrixType, _Mode >::lazyAssign(), SluMatrix::Map(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::markAsRValue(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::nonZeros(), RotationBase< Derived, 3 >::operator*(), Translation< _Scalar, _Dim >::operator*(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator*(), SparseMatrixBase< Derived >::operator*(), Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::operator*(), MatrixBase< Derived >::operator*=(), DenseBase< Derived >::operator+=(), SparseMatrixBase< Derived >::operator+=(), DenseBase< Derived >::operator-=(), SparseMatrixBase< Derived >::operator-=(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), MatrixBase< Derived >::operator=(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::operator=(), TriangularView< _MatrixType, _Mode >::operator=(), DenseBase< Derived >::operator=(), Transform< _Scalar, _Dim, _Mode, _Options >::operator=(), Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >::operator=(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::operator=(), SparseMatrix< Scalar, RowMajor >::operator=(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::outerStride(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PlainObjectBase(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::rows(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::rows(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::rows(), SimplicialCholeskyBase< SimplicialLDLT< _MatrixType, _UpLo > >::solve(), PardisoImpl< PardisoLU< MatrixType > >::solve(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve(), CholmodBase< _MatrixType, _UpLo, CholmodSimplicialLLT< _MatrixType, _UpLo > >::solve(), PastixBase< PastixLU< _MatrixType > >::solve(), SparseTriangularView< MatrixType, Mode >::solveInPlace(), SparseMatrix< Scalar, RowMajor >::SparseMatrix(), SparseVector< _Scalar, _Options, _Index >::SparseVector(), TriangularView< _MatrixType, _Mode >::swap(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::toDense(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::toDenseMatrix(), Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::transpose(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::transpose(), and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::twistedBy().

const Derived& derived ( ) const
inlineinherited
Returns
a const reference to the derived object
void evalTo ( Dest &  dst) const
inlineinherited
void innerStride ( )
protected
CoeffReturnType operator() ( Index  row,
Index  col 
) const
inline
Returns
the coefficient at given the given row and column.
See Also
operator()(Index,Index), operator[](Index)

References eigen_assert.

CoeffReturnType operator() ( Index  index) const
inline
Returns
the coefficient at given index.

This is synonymous to operator[](Index) const.

This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit.

See Also
operator[](Index), operator()(Index,Index) const, x() const, y() const, z() const, w() const

References eigen_assert.

CoeffReturnType operator[] ( Index  index) const
inline
Returns
the coefficient at given index.

This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit.

See Also
operator[](Index), operator()(Index,Index) const, x() const, y() const, z() const, w() const

References eigen_assert, and EIGEN_STATIC_ASSERT.

void outerStride ( )
protected
PacketReturnType packet ( Index  row,
Index  col 
) const
inline

References col(), eigen_internal_assert, and row().

PacketReturnType packet ( Index  index) const
inline

References eigen_internal_assert.

PacketReturnType packetByOuterInner ( Index  outer,
Index  inner 
) const
inline
Index rowIndexByOuterInner ( Index  outer,
Index  inner 
) const
inline

References Eigen::RowMajorBit.

Index rows ( void  ) const
inlineinherited
Returns
the number of rows.
See Also
cols(), RowsAtCompileTime

Reimplemented in Transpose< PermutationBase< Derived > >, SparseSymmetricPermutationProduct< MatrixType, UpLo >, SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size >, TriangularView< _MatrixType, _Mode >, HouseholderSequence< VectorsType, CoeffsType, Side >, SparseMatrixBase< Derived >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, SparseMatrixBase< Transpose< MatrixType > >, SparseMatrixBase< SparseDiagonalProduct< Lhs, Rhs > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, _Index > >, SparseMatrixBase< CwiseUnaryView< ViewOp, MatrixType > >, SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseDenseOuterProduct< Lhs, Rhs, Tr > >, SparseMatrixBase< SparseInnerVectorSet< MatrixType, Size > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >, SparseMatrix< _Scalar, _Options, _Index >, SparseMatrix< Scalar >, SparseMatrix< Scalar, ColMajor, Index >, SparseMatrix< Scalar, ColMajor >, SparseMatrix< Scalar, ColMajor, int >, SparseMatrix< Scalar, RowMajor, Index >, SparseMatrix< Scalar, RowMajor >, PermutationBase< Derived >, PermutationBase< PermutationWrapper< _IndicesType > >, PermutationBase< Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >, SparseDenseOuterProduct< Lhs, Rhs, Tr >, SparseVector< _Scalar, _Options, _Index >, SelfAdjointView< MatrixType, UpLo >, SparseSelfAdjointView< MatrixType, UpLo >, TriangularBase< Derived >, MappedSparseMatrix< _Scalar, _Flags, _Index >, TriangularBase< TriangularView< _MatrixType, _Mode > >, TriangularBase< SelfAdjointView< MatrixType, UpLo > >, SparseView< MatrixType >, and SparseTriangularView< MatrixType, Mode >.

Referenced by PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_resize_to_match(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::addTo(), Array< Index, 64, 1 >::Array(), Matrix< Index, 1, ColsAtCompileTime, RowMajor, 1, MaxColsAtCompileTime >::Matrix(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::size(), and EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::subTo().

void rowStride ( )
protected
Index size ( ) const
inlineinherited
Returns
the number of coefficients, which is rows()*cols().
See Also
rows(), cols(), SizeAtCompileTime.

Reimplemented in SparseMatrixBase< Derived >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, SparseMatrixBase< Transpose< MatrixType > >, SparseMatrixBase< SparseDiagonalProduct< Lhs, Rhs > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, _Index > >, SparseMatrixBase< CwiseUnaryView< ViewOp, MatrixType > >, SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseDenseOuterProduct< Lhs, Rhs, Tr > >, SparseMatrixBase< SparseInnerVectorSet< MatrixType, Size > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >, PermutationBase< Derived >, PermutationBase< PermutationWrapper< _IndicesType > >, PermutationBase< Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >, and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >.

Referenced by PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_resize_to_match().

void stride ( )
protected
void subTo ( Dest &  dst) const
inlineinherited
CoeffReturnType w ( ) const
inline

equivalent to operator[](3).

void writePacket ( )
protected
void writePacketByOuterInner ( )
protected
CoeffReturnType x ( ) const
inline

equivalent to operator[](0).

CoeffReturnType y ( ) const
inline

equivalent to operator[](1).

CoeffReturnType z ( ) const
inline

equivalent to operator[](2).


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