|
cisst-saw
|
#include <vctDynamicNArrayBase.h>
Public Types | |
| enum | { DIMENSION = OwnerType::DIMENSION } |
| typedef vctDynamicNArrayBase | ThisType |
| typedef vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > | BaseType |
| typedef _nArrayOwnerType | OwnerType |
Iterators on the elements of the nArray | |
| typedef OwnerType::iterator | iterator |
| typedef OwnerType::const_iterator | const_iterator |
| typedef OwnerType::reverse_iterator | reverse_iterator |
| typedef OwnerType::const_reverse_iterator | const_reverse_iterator |
The type of the object representing a subarray of | |
this nArray. Access is by (const and non const) reference. | |
| typedef BaseType::ConstSubarrayRefType | ConstSubarrayRefType |
| typedef BaseType::SubarrayRefType | SubarrayRefType |
The type of the object representing a permutation of | |
this nArray. Access is by (const and non const) reference. | |
| typedef BaseType::ConstPermutationRefType | ConstPermutationRefType |
| typedef BaseType::PermutationRefType | PermutationRefType |
Public Member Functions | |||
| VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType) | |||
| VCT_NARRAY_TRAITS_TYPEDEFS (_dimension) | |||
Assignment operation between arrays containing the same data type but different owners | |||
| |||
| template<class __nArrayOwnerType> | |||
| ThisType & | Assign (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other) | ||
Assignment operation between nArrays of different types. | |||
| |||
| template<class __nArrayOwnerType, typename __elementType> | |||
| ThisType & | Assign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) | ||
| template<class __nArrayOwnerType, typename __elementType> | |||
| ThisType & | operator= (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) | ||
| ThisType & | Assign (const value_type *elements) | ||
| template<class __nArrayOwnerType, typename __elementType> | |||
| ThisType & | ForceAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other) | ||
| template<class __nArrayOwnerType> | |||
| bool | FastCopyOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source, bool performSafetyChecks=true) CISST_THROW(std | ||
Binary elementwise operations between two nArrays. | |||
Store the result of op(this, otherNArray) back to this nArray. | |||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | SumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | DifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | ElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | ElementwiseRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | ElementwiseMinOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | ElementwiseMaxOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | Add (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | Subtract (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ElementwiseMultiply (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ElementwiseDivide (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ElementwiseMin (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ElementwiseMax (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | operator+= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | operator-= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
Binary elementwise operations an nArray and a scalar. | |||
Store the result of op(nArray, scalar) to a third nArray. | |||
| template<class __nArrayOwnerType> | |||
| ThisType & | SumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | DifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | RatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ClippedAboveOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ClippedBelowOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type upperBound) | ||
Binary elementwise operations a scalar and an nArray. | |||
Store the result of op(scalar, nArray) to a third nArray. | |||
| template<class __nArrayOwnerType> | |||
| ThisType & | SumOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | DifferenceOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | RatioOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ClippedAboveOf (const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | ClippedBelowOf (const value_type lowerBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray) | ||
Binary elementwise operations between an nArray and a scalar. | |||
Store the result of op(this, scalar) back to this nArray. | |||
| ThisType & | Add (const value_type scalar) | ||
| ThisType & | Subtract (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 & | operator*= (const value_type scalar) | ||
| ThisType & | operator/= (const value_type scalar) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | AddProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType1, class __nArrayOwnerType2> | |||
| ThisType & | AddElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2) | ||
Unary elementwise operations. | |||
Store the result of op(nArray) to another nArray. | |||
| template<class __nArrayOwnerType> | |||
| ThisType & | AbsOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | NegationOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | FloorOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
| template<class __nArrayOwnerType> | |||
| ThisType & | CeilOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) | ||
Store back unary elementwise operations. | |||
Store the result of op(this) to this nArray. | |||
| ThisType & | AbsSelf (void) | ||
| ThisType & | NegationSelf (void) | ||
| ThisType & | FloorSelf (void) | ||
| ThisType & | CeilSelf (void) | ||
The type of the object representing a slice of this | |
nArray. Access is by (const and non const) reference. | |
| typedef BaseType::SlicesTypes | SlicesTypes |
| typedef BaseType::ConstSliceRefType | ConstSliceRefType |
| typedef BaseType::SliceRefType | SliceRefType |
| 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) CISST_THROW(std |
| const_reference | at (size_type metaIndex) const CISST_THROW(std |
| reference | at (const nsize_type &coordinates) CISST_THROW(std |
| const_reference | at (const nsize_type &coordinates) const CISST_THROW(std |
| reference | operator() (const nsize_type &coordinates) CISST_THROW(std |
| const_reference | operator() (const nsize_type &coordinates) const CISST_THROW(std |
| 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) |
| ConstSliceRefType | Slice (dimension_type dimension, size_type index) const |
| SliceRefType | operator[] (size_type index) |
| ConstSliceRefType | operator[] (size_type index) const |
| value_type | SetAll (const value_type value) |
| bool | Zeros (void) |
This class provides all the const methods inherited from vctDynamicConstNArrayBase, and extends them with non const methods, such as SumOf.
| typedef vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension> vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::BaseType |
Type of the base class
| typedef OwnerType::const_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_iterator |
| typedef OwnerType::const_reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_reverse_iterator |
| typedef BaseType::ConstPermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstPermutationRefType |
| typedef BaseType::ConstSliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSliceRefType |
| typedef BaseType::ConstSubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSubarrayRefType |
| typedef OwnerType::iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::iterator |
| typedef _nArrayOwnerType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::OwnerType |
Type of the data owner (dynamic array or pointer)
| typedef BaseType::PermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::PermutationRefType |
| typedef OwnerType::reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::reverse_iterator |
| typedef BaseType::SliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SliceRefType |
| typedef BaseType::SlicesTypes vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SlicesTypes |
| typedef BaseType::SubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SubarrayRefType |
| typedef vctDynamicNArrayBase vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ThisType |
Type of the nArray itself
| anonymous enum |
|
inline |
Unary elementwise operations on an nArray. For each element of the nArray "this", performs \( this[i] \leftarrow op(otherNArray[i])\) where \(op\) can calculate the absolute value (AbsOf) or the opposite (NegationOf).
| otherNArray | The operand of the unary operation. |
|
inline |
Unary elementwise operations on an nArray. For each element of the nArray "this", performs \( this[i] \leftarrow op(this[i])\) where \(op\) can calculate the absolute value (AbsSelf) or the opposite (NegationSelf).
|
inline |
Store back binary elementwise operations between an nArray and a scalar. For each element of the nArray "this", performs \(this[i] \leftarrow op(this[i], scalar)\) where \(op\) is either an addition (Add), a subtraction (Subtract), a multiplication (Multiply), a division (Divide), a minimum (ClipAbove) or a maximum (ClipBelow).
| scalar | The second operand of the binary operation (this[i] is the first operand). |
|
inline |
Store back binary elementwise operations between two nArrays. For each element of the nArrays, performs \(this[i] \leftarrow op(this[i], otherNArray[i])\) where \(op\) is either an addition (Add), a subtraction (Subtraction), a multiplication (ElementwiseMultiply) a division (ElementwiseDivide), a minimization (ElementwiseMin) or a maximisation (ElementwiseMax).
| otherNArray | The second operand of the binary operation (this[i] is the first operand) |
|
inline |
|
inline |
|
inline |
Assign to this nArray values from a C array given as a pointer to value_type. The purpose of this method is to simplify the syntax by not necessitating the creation of an explicit nArray for the given array. However, we only provide this method for an array of value_type. For arrays of other types an nArray still needs to be declared.
| elements | a pointer to a C array of elements to be assigned to this nArray |
|
inline |
|
inline |
|
inline |
Access an element by index. Compare with std::vector::at(). This method can be a handy substitute for the overloaded operator () when operator overloading is unavailable or inconvenient.
|
inline |
|
inline |
Access an element by index (non const). Compare with std::vector::at(). This method can be a handy substitute for the overloaded operator () when operator overloading is unavailable or inconvenient.
|
inline |
|
inline |
Returns an iterator on the first element (STL compatibility).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Access an element by indices (non const). This method allows to access an element without any bounds checking. It doesn't create any temporary references as a nArray[][]...[] would do.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns an iterator on the last element (STL compatibility).
|
inline |
|
inline |
Fast copy. This method uses memcpy whenever it is possible to perform a fast copy from another array to this array.
std::runtime_error). See cmnThrow for details.false. If both narrays are compact and have the same strides, a memcpy is performed and the method returns true.performSafetyChecks to false. This should be used only when the programmer knows for sure that the source and destination are compatible (sizes, strides and compactness).The basic and safe use of this method for an array would be:
If the method is to be called many times (in a loop for example), it is recommended to check that the source and destination are compatible once and then use the option to turn off the different safety checks for each FastCopyOf.
| source | NArray used to set the content of this array. |
| performSafetyChecks | Flag set to false to avoid safety checks, use with extreme caution. |
|
inline |
|
inline |
|
inline |
Forced assignment operation between arrays of different types. This method will use SetSize on the destination array (this nArray) to make sure the assignment will work. It is important to note that if the sizes don't match, memory for this array will be re-allocated. If the program has previously created some references (as in vctDynamic{Const}NArrayRef) on this array, they will become invalid.
| other | The array to be copied. |
|
inline |
|
inline |
|
inline |
|
inline |
Overloaded operator () for simplified (non const) element access with bounds checking
|
inline |
documented in base class
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Reference an (n-1)-dimension slice of this nArray by index (non-const).
|
inline |
documented in base class
|
inline |
|
inline |
|
inline |
Create a non-const reference to this nArray with the strides permuted.
| dimensions | a sequence of dimension numbers representing the permuted order of strides |
|
inline |
documented in base class
|
inline |
Return a non const pointer to an element of the container, specified by its indices. Addition to the STL requirements.
|
inline |
|
inline |
Returns a non const pointer to the first element of the container. Addition to the STL requirements.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a reverse iterator on the last element (STL compatibility).
|
inline |
|
inline |
Returns a reverse iterator on the element before first (STL compatibility).
|
inline |
|
inline |
Assign the given value to all the elements.
| value | the value used to set all the elements of the nArray |
|
inline |
Create a non-const reference to a slice of dimension n-1, where n is the dimension of this nArray.
| dimension | the dimension number of the direction by which to reduce |
| slice | the index number in the dimension specified by which to set the reference |
|
inline |
documented in base class
|
inline |
Create a non-const reference to a subarray of this nArray.
| startPosition | vector of indices of the element position where the reference will start |
| lengths | the number of elements to reference in each dimension |
|
inline |
documented in base class
|
inline |
|
inline |
|
inline |
Binary elementwise operations between a scalar and an nArray. For each element of the nArray "this", performs \( this[i] \leftarrow op(scalar, nArray[i])\) where \(op\) is either an addition (SumOf), a subtraction (DifferenceOf), a multiplication (ProductOf), a division (RatioOf), a minimum (ClippedAboveOf) or a maximum (ClippedBelowOf).
| scalar | The first operand of the binary operation. |
| nArray | The second operand of the binary operation. |
|
inline |
Binary elementwise operations between an nArray and a scalar. For each element of the nArray "this", performs \( this[i] \leftarrow op(nArray[i], scalar)\) where \(op\) is either an addition (SumOf), a subtraction (DifferenceOf), a multiplication (ProductOf), a division (RatioOf), a minimum (ClippedAboveOf) or a maximum (ClippedBelowOf).
| nArray | The first operand of the binary operation. |
| scalar | The second operand of the binary operation. |
|
inline |
Binary elementwise operations between two nArrays. For each element of the nArrays, performs \( this[i] \leftarrow op(nArray1[i], nArray2[i])\) where \(op\) is either an addition (SumOf), a subtraction (DifferenceOf), a multiplication (ElementwiseProductOf), a division (ElementwiseRatioOf), a minimum (ElementwiseMinOf) or a maximum (ElementwiseMaxOf).
| nArray1 | The first operand of the binary operation |
| nArray2 | The second operand of the binary operation |
| vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | _elementType | ) |
| vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_NARRAY_TRAITS_TYPEDEFS | ( | _dimension | ) |
|
inline |
Assign zero to all elements. This methods assumes that the element type has a zero and this zero value can be set using memset(0). If the nArray is not compact this method will use SetAll(0) and memset otherwise. This provides a slightly more efficent way to set all elements to zero.