Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Protected Attributes | Private Types
Eigen::VectorBlock Class Reference

Detailed Description

Expression of a fixed-size or dynamic-size sub-vector.

Parameters:
VectorTypethe type of the object in which we are taking a sub-vector
Sizesize of the sub-vector we are taking at compile time (optional)

This class represents an expression of either a fixed-size or dynamic-size sub-vector. It is the return type of DenseBase::segment(Index,Index) and DenseBase::segment<int>(Index) and most of the time this is the only way it is used.

However, if you want to directly maniputate sub-vector expressions, for instance if you want to write a function returning such an expression, you will need to use this class.

Here is an example illustrating the dynamic case:

Output:

Note:
Even though this expression has dynamic size, in the case where VectorType has fixed size, this expression inherits a fixed maximal size which means that evaluating it does not cause a dynamic memory allocation.

Here is an example illustrating the fixed-size case:

Output:

See also:
class Block, DenseBase::segment(Index,Index,Index,Index), DenseBase::segment(Index,Index)
Inheritance diagram for Eigen::VectorBlock:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 VectorBlock (VectorType &vector, Index start, Index size)
 Dynamic-size constructor.
 VectorBlock (VectorType &vector, Index start)
 Fixed-size constructor.
Index rows () const
Index cols () const
Scalar & coeffRef (Index row, Index col)
const Scalar & coeffRef (Index row, Index col) const
Scalar & coeffRef (Index index)
const Scalar & coeffRef (Index index) const
EIGEN_STRONG_INLINE const
CoeffReturnType 
coeff (Index row, Index col) const
const CoeffReturnType coeff (Index index) const
PacketScalar packet (Index row, Index col) const
PacketScalar packet (Index index) const
void writePacket (Index row, Index col, const PacketScalar &x)
void writePacket (Index index, const PacketScalar &x)
const Scalar * data () const
Index innerStride () const
Index outerStride () const
const internal::remove_all
< typename XprType::Nested >
::type & 
nestedExpression () const
Index startRow () const
Index startCol () const

Protected Attributes

const XprType::Nested m_xpr
const
internal::variable_if_dynamic
< Index,
XprType::RowsAtCompileTime==1?0:Dynamic
m_startRow
const
internal::variable_if_dynamic
< Index,
XprType::ColsAtCompileTime==1?0:Dynamic
m_startCol
const
internal::variable_if_dynamic
< Index, RowsAtCompileTime > 
m_blockRows
const
internal::variable_if_dynamic
< Index, ColsAtCompileTime > 
m_blockCols

Private Types

enum  { IsColVector = !(internal::traits<VectorType>::Flags & RowMajorBit) }
typedef Block< VectorType,
internal::traits< VectorType >
::Flags &RowMajorBit?1:Size,
internal::traits< VectorType >
::Flags &RowMajorBit?Size:1 > 
Base

Member Typedef Documentation

typedef Block<VectorType, internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size, internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1> Eigen::VectorBlock::Base [private]

Member Enumeration Documentation

anonymous enum [private]
Enumerator:
IsColVector 

Definition at line 79 of file Core.


Constructor & Destructor Documentation

Eigen::VectorBlock::VectorBlock ( VectorType &  vector,
Index  start,
Index  size 
) [inline]

Dynamic-size constructor.

Definition at line 89 of file Core.

Eigen::VectorBlock::VectorBlock ( VectorType &  vector,
Index  start 
) [inline]

Fixed-size constructor.

Definition at line 99 of file Core.


Member Function Documentation

EIGEN_STRONG_INLINE const CoeffReturnType Eigen::Block::coeff ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 182 of file Core.

const CoeffReturnType Eigen::Block::coeff ( Index  index) const [inline, inherited]

Definition at line 202 of file Core.

Scalar& Eigen::Block::coeffRef ( Index  row,
Index  col 
) [inline, inherited]

Definition at line 169 of file Core.

const Scalar& Eigen::Block::coeffRef ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 176 of file Core.

Scalar& Eigen::Block::coeffRef ( Index  index) [inline, inherited]

Definition at line 187 of file Core.

const Scalar& Eigen::Block::coeffRef ( Index  index) const [inline, inherited]

Definition at line 195 of file Core.

Index Eigen::Block::cols ( void  ) const [inline, inherited]

Definition at line 167 of file Core.

const Scalar* Eigen::Block::data ( ) const [inline, inherited]
See also:
MapBase::data()
Index Eigen::Block::innerStride ( ) const [inline, inherited]
const internal::remove_all<typename XprType::Nested>::type& Eigen::Block::nestedExpression ( ) const [inline, inherited]

Definition at line 246 of file Core.

Index Eigen::Block::outerStride ( ) const [inline, inherited]
PacketScalar Eigen::Block::packet ( Index  row,
Index  col 
) const [inline, inherited]

Definition at line 210 of file Core.

PacketScalar Eigen::Block::packet ( Index  index) const [inline, inherited]

Definition at line 224 of file Core.

Index Eigen::Block::rows ( void  ) const [inline, inherited]

Definition at line 166 of file Core.

Index Eigen::Block::startCol ( ) const [inline, inherited]

Definition at line 256 of file Core.

Index Eigen::Block::startRow ( ) const [inline, inherited]

Definition at line 251 of file Core.

void Eigen::Block::writePacket ( Index  row,
Index  col,
const PacketScalar &  x 
) [inline, inherited]

Definition at line 217 of file Core.

void Eigen::Block::writePacket ( Index  index,
const PacketScalar &  x 
) [inline, inherited]

Definition at line 232 of file Core.


Member Data Documentation

const internal::variable_if_dynamic<Index, ColsAtCompileTime> Eigen::Block::m_blockCols [protected, inherited]

Definition at line 267 of file Core.

const internal::variable_if_dynamic<Index, RowsAtCompileTime> Eigen::Block::m_blockRows [protected, inherited]

Definition at line 266 of file Core.

const internal::variable_if_dynamic<Index, XprType::ColsAtCompileTime == 1 ? 0 : Dynamic> Eigen::Block::m_startCol [protected, inherited]

Definition at line 265 of file Core.

const internal::variable_if_dynamic<Index, XprType::RowsAtCompileTime == 1 ? 0 : Dynamic> Eigen::Block::m_startRow [protected, inherited]

Definition at line 264 of file Core.

const XprType::Nested Eigen::Block::m_xpr [protected, inherited]

Definition at line 263 of file Core.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011