|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
| vctDynamicConstVectorRef () |
|
| vctDynamicConstVectorRef (const ThisType &other) |
|
| vctDynamicConstVectorRef (size_type size, pointer data, stride_type stride=1) |
|
| vctDynamicConstVectorRef (size_type size, const_pointer data, stride_type stride=1) |
|
template<size_type __size, stride_type __stride, class __dataPtrType > |
| vctDynamicConstVectorRef (const vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector) |
|
template<size_type __size, stride_type __stride, class __dataPtrType > |
| vctDynamicConstVectorRef (const vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition, size_type length) |
|
template<class __vectorOwnerType > |
| vctDynamicConstVectorRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) |
|
template<class __vectorOwnerType > |
| vctDynamicConstVectorRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition, size_type length) |
|
void | SetRef (size_type size, const_pointer p, stride_type stride=1) |
|
template<size_type __size, stride_type __stride, class __dataPtrType > |
void | SetRef (const vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector) |
|
template<size_type __size, stride_type __stride, class __dataPtrType > |
void | SetRef (const vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition, size_type length) throw (std::out_of_range) |
|
template<class __vectorOwnerType > |
void | SetRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) |
|
template<class __vectorOwnerType > |
void | SetRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition, size_type length) throw (std::out_of_range) |
|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
const_iterator | begin (void) const |
|
const_iterator | end (void) const |
|
const_reverse_iterator | rbegin (void) const |
|
const_reverse_iterator | rend (void) const |
|
size_type | size (void) const |
|
difference_type | stride () const |
|
bool | empty () const |
|
const_reference | operator[] (index_type index) const |
|
const_reference | at (size_type index) const throw (std::out_of_range) |
|
const_reference | operator() (size_type index) const throw (std::out_of_range) |
|
const_reference | Element (size_type index) const |
|
const OwnerType & | Owner (void) const |
|
const_pointer | Pointer (index_type index=0) const |
|
bool | ValidIndex (size_type index) const |
|
vctDynamicConstVectorRef
< _elementType > | Ref (const size_type size, const size_type startPosition=0) const throw (std::out_of_range) |
|
value_type | DotProduct (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
std::string | ToString (void) const |
|
void | ToStream (std::ostream &outputStream) const |
|
void | ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const |
|
void | SerializeRaw (std::ostream &outputStream) const |
|
const value_type & | X (void) const |
|
const value_type & | Y (void) const |
|
const value_type & | Z (void) const |
|
const value_type & | W (void) const |
|
vctDynamicConstVectorRef
< _elementType > | XY (void) const |
|
vctDynamicConstVectorRef
< _elementType > | XZ (void) const |
|
vctDynamicConstVectorRef
< _elementType > | XW (void) const |
|
vctDynamicConstVectorRef
< _elementType > | YZ (void) const |
|
vctDynamicConstVectorRef
< _elementType > | YW (void) const |
|
vctDynamicConstVectorRef
< _elementType > | ZW (void) const |
|
vctDynamicConstVectorRef
< _elementType > | XYZ (void) const |
|
vctDynamicConstVectorRef
< _elementType > | YZW (void) const |
|
vctDynamicConstVectorRef
< _elementType > | XYZW (void) const |
|
value_type | SumOfElements (void) const |
|
value_type | ProductOfElements (void) const |
|
value_type | NormSquare (void) const |
|
NormType | Norm (void) const |
|
bool | IsNormalized (void) const |
|
bool | IsNormalized (_elementType tolerance) const |
|
value_type | L1Norm (void) const |
|
value_type | LinfNorm (void) const |
|
value_type | MaxElement (void) const |
|
value_type | MinElement (void) const |
|
value_type | MaxAbsElement (void) const |
|
value_type | MinAbsElement (void) const |
|
void | MinAndMaxElement (value_type &minElement, value_type &maxElement) const |
|
bool | IsPositive (void) const |
|
bool | IsNonNegative (void) const |
|
bool | IsNonPositive (void) const |
|
bool | IsNegative (void) const |
|
bool | All (void) const |
|
bool | Any (void) const |
|
bool | IsFinite (void) const |
|
bool | HasNaN (void) const |
|
bool | IsCompact (void) const |
|
bool | IsFortran (void) const |
|
bool | FastCopyCompatible (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const |
|
bool | FastCopyCompatible (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source) const |
|
bool | Equal (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | operator== (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, value_type tolerance) const |
|
bool | AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | NotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | operator!= (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | Lesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | LesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | Greater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | GreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseNotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseLesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseLesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseGreater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
BoolVectorReturnType | ElementwiseGreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const |
|
bool | Equal (const value_type &scalar) const |
|
bool | operator== (const value_type &scalar) const |
|
bool | NotEqual (const value_type &scalar) const |
|
bool | operator!= (const value_type &scalar) const |
|
bool | Lesser (const value_type &scalar) const |
|
bool | LesserOrEqual (const value_type &scalar) const |
|
bool | Greater (const value_type &scalar) const |
|
bool | GreaterOrEqual (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseEqual (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseNotEqual (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseLesser (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseLesserOrEqual (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseGreater (const value_type &scalar) const |
|
BoolVectorReturnType | ElementwiseGreaterOrEqual (const value_type &scalar) const |
|
VectorReturnType | Abs (void) const |
|
VectorReturnType | Negation (void) const |
|
VectorReturnType | Floor (void) const |
|
VectorReturnType | Ceil (void) const |
|
VectorReturnType | Normalized (void) const throw (std::runtime_error) |
|
template<class _elementType>
class vctDynamicConstVectorRef< _elementType >
Dynamic vector referencing existing memory (const)
The class vctDynamicConstVectorRef allows to create a vector overlaying an existing block of memory. It can be used to manipulate a container created by another toolkit (i.e. OpenGL, vtk, ...) or a cisstVector container using different parameters (different size, storage order or stride).
To setup the overlay, one can use either the constructors or the SetRef methods. When used with a cisst container, the SetRef methods can infer some of the memory layout information (pointer on first element, size, stride). When used to overlay existing memory referenced by a pointer, the user has to provide all the required information. In any case, the Ref object doesn't allocate nor free memory.
Finally, as this overlay is const, it can be used to make sure the referenced content is not modified.
For example to manipulate the first five elements of a vector, one can do:
first5.
SetRef(wholeVector, 0, 5);
std::cout << first5 <<
" " << first5.
SumOfElements() << std::endl;
- Note
- Make sure the underlying memory is not freed after the Ref object is created and before it is used. This would lead to faulty memory access and potential bugs.
-
vctDynamicConstVectorRef only performs const operations even if it stores a non-const
value_type *
. It can be initialized with either value_type *
or const value_type *
. For a non-const Ref, see vctDynamicVectorRef.
- See Also
- vctDynamicVector, vctDynamicVectorRef
- Parameters
-
_elementType | Type of elements referenced. Also defined as value_type . |