Expression of a fixed-size or dynamic-size sub-vector. More...
Public Member Functions | |
VectorBlock (VectorType &vector, Index start) | |
VectorBlock (VectorType &vector, Index start, Index size) | |
Private Types | |
enum | { IsColVector } |
typedef Block< VectorType, internal::traits< VectorType >::Flags &RowMajorBit ? 1 :Size, internal::traits< VectorType >::Flags &RowMajorBit ? Size :1 > | Base |
Expression of a fixed-size or dynamic-size sub-vector.
VectorType | the type of the object in which we are taking a sub-vector |
Size | size 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 manipulate 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:
6 8 Now the vector v is: 1 10 15 4 5 6
Here is an example illustrating the fixed-size case:
Output:
4 8 Now the vector v is: 2 4 3 4 5 6
Definition at line 58 of file VectorBlock.h.
|
private |
Definition at line 65 of file VectorBlock.h.
|
private |
|
inline |
Dynamic-size constructor
Definition at line 77 of file VectorBlock.h.
|
inline |