Logo Search packages:      
Sourcecode: eigen3 version File versions  Download package

Public Member Functions | Protected Attributes | Private Types

VectorBlock< VectorType, Size > Class Template Reference

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

#include <VectorBlock.h>

Inheritance diagram for VectorBlock< VectorType, Size >:
Inheritance graph
[legend]
Collaboration diagram for VectorBlock< VectorType, Size >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

EIGEN_STRONG_INLINE const
CoeffReturnType 
coeff (Index row, Index col) const
const CoeffReturnType coeff (Index index) const
const Scalar & coeffRef (Index index) const
Scalar & coeffRef (Index row, Index col)
const Scalar & coeffRef (Index row, Index col) const
Scalar & coeffRef (Index index)
Index cols () const
PacketScalar packet (Index row, Index col) const
PacketScalar packet (Index index) const
Index rows () const
 VectorBlock (VectorType &vector, Index start)
 VectorBlock (VectorType &vector, Index start, Index size)
void writePacket (Index row, Index col, const PacketScalar &x)
void writePacket (Index index, const PacketScalar &x)

Protected Attributes

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

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

Detailed Description

template<typename VectorType, int Size>
class VectorBlock< VectorType, Size >

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)

Definition at line 70 of file VectorBlock.h.


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

Generated by  Doxygen 1.6.0   Back to index