|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
| VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION) |
|
| vctDynamicConstNArrayRef () |
|
| vctDynamicConstNArrayRef (const ThisType &other) |
|
| vctDynamicConstNArrayRef (const_pointer dataPointer, const nsize_type &sizes, const nstride_type &strides) |
|
| vctDynamicConstNArrayRef (pointer dataPointer, const nsize_type &sizes, const nstride_type &strides) |
|
template<class __ownerType > |
| vctDynamicConstNArrayRef (const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray) |
|
template<class __ownerType > |
| vctDynamicConstNArrayRef (const vctDynamicConstVectorBase< __ownerType, value_type > &vector) |
|
template<size_type __size, stride_type __stride, typename __dataPtrType > |
| vctDynamicConstNArrayRef (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &vector) |
|
template<class __ownerType > |
| vctDynamicConstNArrayRef (const vctDynamicConstMatrixBase< __ownerType, value_type > &matrix) |
|
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, typename __dataPtrType > |
| vctDynamicConstNArrayRef (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix) |
|
void | SetRef (const_pointer dataPointer, const nsize_type &sizes, const nstride_type &strides) |
|
template<class __ownerType > |
void | SetRef (const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray) |
|
template<class __ownerType > |
void | SubarrayOf (const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray, const nsize_type &startPosition, const nsize_type &lengths) |
|
template<class __ownerType > |
void | PermutationOf (const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION > &otherNArray, const ndimension_type &dimensions) |
|
template<class __ownerType > |
void | SliceOf (const vctDynamicConstNArrayBase< __ownerType, value_type, DIMENSION+1 > &otherNArray, dimension_type dimension, size_type index) |
|
template<class __ownerType > |
void | SetRef (const vctDynamicConstVectorBase< __ownerType, value_type > &vector) |
|
template<size_type __size, stride_type __stride, typename __dataPtrType > |
void | SetRef (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &vector) |
|
template<class __ownerType > |
void | SetRef (const vctDynamicConstMatrixBase< __ownerType, value_type > &matrix) |
|
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, typename __dataPtrType > |
void | SetRef (const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix) |
|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
| VCT_NARRAY_TRAITS_TYPEDEFS (_dimension) |
|
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 |
|
size_type | size (dimension_type dimension) const |
|
const nsize_type & | sizes (void) const |
|
const nstride_type & | strides (void) const |
|
difference_type | stride (dimension_type dimension) const |
|
dimension_type | dimension (void) const |
|
bool | empty (void) const |
|
bool | ValidDimension (dimension_type dimension) const |
|
bool | ValidDimensionIndex (dimension_type dimensionIndex) const |
|
bool | ValidIndex (size_type index) const |
|
bool | ValidIndex (const nsize_type &indices) const |
|
bool | ValidIndex (dimension_type dimension, size_type index) const |
|
const_reference | at (size_type metaIndex) const throw (std::out_of_range) |
|
const_reference | at (const nsize_type &coordinates) const throw (std::out_of_range) |
|
const_reference | operator() (const nsize_type &coordinates) const throw (std::out_of_range) |
|
const OwnerType & | Owner (void) const |
|
const_pointer | Pointer (void) const |
|
const_pointer | Pointer (const nsize_type &indices) const |
|
const_reference | Element (const nsize_type &coordinates) const |
|
ConstSubarrayRefType | Subarray (const nsize_type &startPosition, const nsize_type &lengths) const |
|
ConstPermutationRefType | Permutation (const ndimension_type &dimensions) const |
|
ConstSliceRefType | Slice (dimension_type dimension, size_type index) const throw (std::runtime_error, std::out_of_range) |
|
ConstSliceRefType | operator[] (size_type index) const |
|
bool | FastCopyCompatible (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source) const |
|
std::string | ToString (void) |
|
void | ToStream (std::ostream &outputStream) const |
|
value_type | SumOfElements (void) const |
|
value_type | ProductOfElements (void) const |
|
value_type | NormSquare (void) const |
|
NormType | Norm (void) 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 | Equal (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | operator== (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray, value_type tolerance) const |
|
bool | AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | NotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | operator!= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | Lesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | LesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | Greater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
bool | GreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) 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 |
|
BoolNArrayReturnType | ElementwiseEqual (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseNotEqual (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseLesser (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseLesserOrEqual (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseGreater (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseGreaterOrEqual (const value_type &scalar) const |
|
BoolNArrayReturnType | ElementwiseEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
BoolNArrayReturnType | ElementwiseNotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
BoolNArrayReturnType | ElementwiseLesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
BoolNArrayReturnType | ElementwiseLesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
BoolNArrayReturnType | ElementwiseGreater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
BoolNArrayReturnType | ElementwiseGreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
|
NArrayReturnType | Abs (void) const |
|
NArrayReturnType | Negation (void) const |
|
NArrayReturnType | Floor (void) const |
|
NArrayReturnType | Ceil (void) const |
|
template<class _elementType, vct::size_type _dimension>
class vctDynamicConstNArrayRef< _elementType, _dimension >
Dynamic nArray referencing existing memory (const)
The class vctDynamicConstNArrayRef allows to create a nArray 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, sizes, strides). 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 nArray, one can do:
std::cout << first5x5 <<
" " << first5x5.
SumOfElements() << std::endl;
- Note
- On top of the SetRef methods provided for the cisst vectors and matrices (see vctDynamicVectorRef and vctDynamicMatrixRef), the ref classes for nArrays provides the methods SubarrayOf (re-size, same dimension), PermutationOf (same dimension, same sizes but different ordering of dimensions), SliceOf (reduce dimension by 1). By combining different Refs created using a mix of these methods, one can create any desired overlay.
-
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.
-
vctDynamicConstNArrayRef 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 vctDynamicNArrayRef.
- See Also
- vctDynamicNArray, vctDynamicNArrayRef
- Parameters
-
_elementType | Type of elements referenced. Also defined as value_type . |
_dimension | Dimension of the const nArray ref. |