|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
| VCT_NARRAY_TRAITS_TYPEDEFS (DIMENSION) |
|
| vctDynamicNArrayRef () |
|
| vctDynamicNArrayRef (const ThisType &other) |
|
| vctDynamicNArrayRef (pointer dataPointer, const nsize_type &sizes, const nstride_type &strides) |
|
template<class __ownerType > |
| vctDynamicNArrayRef (vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray) |
|
template<class __ownerType > |
| vctDynamicNArrayRef (vctDynamicConstVectorBase< __ownerType, _elementType > &vector) |
|
template<size_type __size, stride_type __stride, typename __dataPtrType > |
| vctDynamicNArrayRef (vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &vector) |
|
template<class __ownerType > |
| vctDynamicNArrayRef (vctDynamicConstMatrixBase< __ownerType, _elementType > &matrix) |
|
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, typename __dataPtrType > |
| vctDynamicNArrayRef (vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &matrix) |
|
void | SetRef (pointer dataPointer, const nsize_type &sizes, const nstride_type &strides) |
|
template<class __ownerType > |
void | SetRef (vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray) |
|
template<class __ownerType > |
void | SubarrayOf (vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const nsize_type &startPosition, const nsize_type &lengths) |
|
template<class __ownerType > |
void | PermutationOf (vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION > &otherNArray, const ndimension_type &dimensions) |
|
template<class __ownerType > |
void | SliceOf (vctDynamicNArrayBase< __ownerType, _elementType, DIMENSION+1 > &otherNArray, dimension_type dimension, size_type index) |
|
template<class __ownerType > |
void | SetRef (vctDynamicConstVectorBase< __ownerType, _elementType > &vector) |
|
template<size_type __size, stride_type __stride, typename __dataPtrType > |
void | SetRef (vctFixedSizeConstVectorBase< __size, __stride, _elementType, __dataPtrType > &vector) |
|
template<class __ownerType > |
void | SetRef (vctDynamicConstMatrixBase< __ownerType, _elementType > &matrix) |
|
template<size_type __rows, size_type __cols, stride_type __rowStride, stride_type __colStride, typename __dataPtrType > |
void | SetRef (vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, _elementType, __dataPtrType > &matrix) |
|
ThisType & | operator= (const value_type &value) |
|
|
- Parameters
-
other | the nArray to be copied. |
|
ThisType & | operator= (const ThisType &other) |
|
ThisType & | operator= (const vctDynamicConstNArrayRef< _elementType, DIMENSION > &other) |
|
template<class __nArrayOwnerType , typename __elementType > |
ThisType & | operator= (const vctDynamicNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) |
|
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) |
|
| VCT_NARRAY_TRAITS_TYPEDEFS (_dimension) |
|
iterator | begin (void) |
|
const_iterator | begin (void) const |
|
iterator | end (void) |
|
const_iterator | end (void) const |
|
reverse_iterator | rbegin (void) |
|
const_reverse_iterator | rbegin (void) const |
|
reverse_iterator | rend (void) |
|
const_reverse_iterator | rend (void) const |
|
const OwnerType & | Owner (void) const |
|
OwnerType & | Owner (void) |
|
pointer | Pointer (const nsize_type &indices) |
|
const_pointer | Pointer (const nsize_type &indices) const |
|
pointer | Pointer (void) |
|
const_pointer | Pointer (void) const |
|
reference | at (size_type metaIndex) throw (std::out_of_range) |
|
const_reference | at (size_type metaIndex) const throw (std::out_of_range) |
|
reference | at (const nsize_type &coordinates) throw (std::out_of_range) |
|
const_reference | at (const nsize_type &coordinates) const throw (std::out_of_range) |
|
reference | operator() (const nsize_type &coordinates) throw (std::out_of_range) |
|
const_reference | operator() (const nsize_type &coordinates) const throw (std::out_of_range) |
|
reference | Element (const nsize_type &coordinates) |
|
const_reference | Element (const nsize_type &coordinates) const |
|
SubarrayRefType | Subarray (const nsize_type &startPosition, const nsize_type &lengths) |
|
ConstSubarrayRefType | Subarray (const nsize_type &startPosition, const nsize_type &lengths) const |
|
PermutationRefType | Permutation (const ndimension_type &dimensions) |
|
ConstPermutationRefType | Permutation (const ndimension_type &dimensions) const |
|
SliceRefType | Slice (dimension_type dimension, size_type index) throw (std::runtime_error, std::out_of_range) |
|
ConstSliceRefType | Slice (dimension_type dimension, size_type index) const throw (std::runtime_error, std::out_of_range) |
|
SliceRefType | operator[] (size_type index) |
|
ConstSliceRefType | operator[] (size_type index) const |
|
value_type | SetAll (const value_type value) |
|
bool | Zeros (void) |
|
ThisType & | Assign (const value_type *elements) |
|
ThisType & | ForceAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) |
|
ThisType & | AddProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | AddElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | Assign (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other) |
|
ThisType & | Assign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) |
|
ThisType & | operator= (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) |
|
bool | FastCopyOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source, bool performSafetyChecks=true) throw (std::runtime_error) |
|
ThisType & | SumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | DifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | ElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | ElementwiseRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | ElementwiseMinOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | ElementwiseMaxOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) |
|
ThisType & | Add (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | Subtract (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | ElementwiseMultiply (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | ElementwiseDivide (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | ElementwiseMin (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | ElementwiseMax (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | operator+= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | operator-= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | SumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) |
|
ThisType & | DifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) |
|
ThisType & | ProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) |
|
ThisType & | RatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) |
|
ThisType & | ClippedAboveOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound) |
|
ThisType & | ClippedBelowOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type upperBound) |
|
ThisType & | SumOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | DifferenceOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | ProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | RatioOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | ClippedAboveOf (const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | ClippedBelowOf (const value_type lowerBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) |
|
ThisType & | Add (const value_type scalar) |
|
ThisType & | Subtract (const value_type scalar) |
|
ThisType & | operator+= (const value_type scalar) |
|
ThisType & | operator-= (const value_type scalar) |
|
ThisType & | Multiply (const value_type scalar) |
|
ThisType & | Divide (const value_type scalar) |
|
ThisType & | ClipAbove (const value_type upperBound) |
|
ThisType & | ClipBelow (const value_type lowerBound) |
|
ThisType & | operator*= (const value_type scalar) |
|
ThisType & | operator/= (const value_type scalar) |
|
ThisType & | AbsOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | NegationOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | FloorOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | CeilOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) |
|
ThisType & | AbsSelf (void) |
|
ThisType & | NegationSelf (void) |
|
ThisType & | FloorSelf (void) |
|
ThisType & | CeilSelf (void) |
|
| 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 vctDynamicNArrayRef< _elementType, _dimension >
Dynamic nArray referencing existing memory.
The class vctDynamicNArrayRef 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.
For example to manipulate the first five elements of a nArray, one can do:
- 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.
-
vctDynamicNArrayRef can perform const and non-const operations. It can be initialized with a non-const object only (
value_type *
). For a const Ref, see vctDynamicConstNArrayRef.
- See Also
- vctDynamicNArray, vctDynamicConstNArrayRef
- Parameters
-
_elementType | Type of elements referenced. Also defined as value_type . |
_dimension | Dimension of the nArray ref. |