cisst-saw
|
#include <vctDynamicConstNArrayBase.h>
Public Types | |
enum | { DIMENSION = OwnerType::DIMENSION } |
typedef vctDynamicConstNArrayBase < _nArrayOwnerType, _elementType, _dimension > | ThisType |
typedef _nArrayOwnerType | OwnerType |
typedef vctReturnDynamicNArray < value_type, DIMENSION > | NArrayValueType |
typedef vctDynamicNArray < value_type, DIMENSION > | NArrayReturnType |
typedef cmnTypeTraits< value_type > | TypeTraits |
typedef TypeTraits::BoolType | BoolType |
typedef vctReturnDynamicNArray < BoolType, DIMENSION > | BoolNArrayReturnType |
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 vctDynamicConstNArrayRef < value_type, DIMENSION > | ConstSubarrayRefType |
typedef vctDynamicNArrayRef < value_type, DIMENSION > | SubarrayRefType |
The type of the object representing a permutation of | |
this nArray. Access is by (const and non const) reference. | |
typedef vctDynamicConstNArrayRef < value_type, DIMENSION > | ConstPermutationRefType |
typedef vctDynamicNArrayRef < value_type, DIMENSION > | PermutationRefType |
The type of the object representing a slice of this | |
nArray. Access is by (const and non const) reference. | |
typedef vctDynamicNArrayTypes < DIMENSION >::template SlicesTypes< _elementType > | SlicesTypes |
typedef SlicesTypes::ConstSliceRefType | ConstSliceRefType |
typedef SlicesTypes::SliceRefType | SliceRefType |
Public Member Functions | |
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 |
const nsize_type & | sizes (void) const |
size_type | size (dimension_type dimension) 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 |
template<class __nArrayOwnerType > | |
bool | FastCopyCompatible (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source) const |
std::string | ToString (void) |
void | ToStream (std::ostream &outputStream) const |
Incremental operations returning a scalar. | |
Compute a scalar from all the elements of the nArray. | |
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 |
Storage format. | |
bool | IsCompact (void) const |
Elementwise comparisons between nArray. | |
Returns the result of the comparison. | |
template<class __nArrayOwnerType > | |
bool | Equal (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | operator== (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray, value_type tolerance) const |
template<class __nArrayOwnerType > | |
bool | AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | NotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | operator!= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | Lesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | LesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | Greater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
bool | GreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
Elementwise comparisons between nArrays. | |
Returns the nArray of comparison's results. | |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseNotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseLesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseLesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseGreater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
template<class __nArrayOwnerType > | |
BoolNArrayReturnType | ElementwiseGreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const |
Elementwise comparisons between an nArray and a scalar. | |
Returns the result of the comparison. | |
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 |
Unary elementwise operations. | |
Returns the result of nArray.op(). | |
NArrayReturnType | Abs (void) const |
NArrayReturnType | Negation (void) const |
NArrayReturnType | Floor (void) const |
NArrayReturnType | Ceil (void) const |
Protected Member Functions | |
void | ThrowUnlessValidDimensionIndex (dimension_type dimensionIndex) const throw (std::out_of_range) |
void | ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range) |
void | ThrowUnlessValidIndex (const nsize_type &indices) const throw (std::out_of_range) |
void | ThrowUnlessValidIndex (dimension_type dimension, size_type index) const throw (std::out_of_range) |
Protected Attributes | |
OwnerType | NArray |
This class is templated with the ``nArray owner type'', which may be a vctDynamicNArrayOwner or a vctDynamicNArrayRefOwner. It provides const operations on the nArray, such as SumOfElements etc.
nArray indexing is zero-based.
nArray dimensions are zero-based.
The method provided for the compatibility with the STL containers start with a lower case. Other methods start with a capitalilized letter (see CISST naming convention).
_nArrayOwnerType | the type of nArray owner |
_elementType | the type of elements of the nArray |
typedef vctReturnDynamicNArray<BoolType, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::BoolNArrayReturnType |
The type of an nArray of booleans returned from operations on this object, e.g., ElementwiseEqual.
typedef TypeTraits::BoolType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::BoolType |
Define bool based on the container type to force some compilers (i.e. gcc 4.0) to delay the instantiation of the ElementWiseCompare methods.
typedef OwnerType::const_iterator vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_iterator |
typedef OwnerType::const_reverse_iterator vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_reverse_iterator |
typedef vctDynamicConstNArrayRef<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstPermutationRefType |
typedef SlicesTypes::ConstSliceRefType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSliceRefType |
typedef vctDynamicConstNArrayRef<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSubarrayRefType |
typedef OwnerType::iterator vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::iterator |
typedef vctDynamicNArray<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::NArrayReturnType |
The type of nArray returned by value from operations on this object
typedef vctReturnDynamicNArray<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::NArrayValueType |
The type of nArray used to store by value results of the same type as this object.
typedef _nArrayOwnerType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::OwnerType |
Type of the data owner (dynamic array or pointer)
typedef vctDynamicNArrayRef<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::PermutationRefType |
typedef OwnerType::reverse_iterator vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::reverse_iterator |
typedef SlicesTypes::SliceRefType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SliceRefType |
typedef vctDynamicNArrayTypes<DIMENSION>::template SlicesTypes<_elementType> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SlicesTypes |
typedef vctDynamicNArrayRef<value_type, DIMENSION> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SubarrayRefType |
typedef vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ThisType |
Type of the nArray itself.
typedef cmnTypeTraits<value_type> vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::TypeTraits |
anonymous enum |
|
inline |
Unary elementwise operations on an nArray. For each element of the nArray "this", performs where
can calculate the absolute value (Abs) or the opposite (Negation).
|
inline |
Return true if all the elements of this nArray are nonzero, false otherwise
|
inline |
|
inline |
|
inline |
Return true if any element of this nArray is nonzero, false otherwise
|
inline |
Access an element by index (const). Compare with std::matrix::at(). This method can be a handy substitute for the overloaded operator [] when operator overloading is unavailable or inconvenient.
|
inline |
Access an element by indices (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 |
Returns a const iterator on the first element (STL compatibility).
|
inline |
|
inline |
Not required by STL but provided for completeness
|
inline |
Access an element by indices (const). This method allows to access an element without any bounds checking. It doesn't create any temporary references as nArray[][]...[] would do.
|
inline |
Comparison between two nArrays of the same size, containing the same type of elements. The strides and the internal representation (_nArrayOwnerType) can be different. The comparison ( ) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the two nArrays and stored in a newly created nArray. There is no operator provided since the semantic would be ambiguous.
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseEqual | ( | const value_type & | scalar | ) | const |
Comparison between an nArray and a scalar, containing the same type of elements. The comparison ( ) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the nArray and the scalar and stored in a newly created nArray. There is no operator provided since the semantic would be ambiguous.
|
inline |
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseGreater | ( | const value_type & | scalar | ) | const |
|
inline |
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseGreaterOrEqual | ( | const value_type & | scalar | ) | const |
|
inline |
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseLesser | ( | const value_type & | scalar | ) | const |
|
inline |
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseLesserOrEqual | ( | const value_type & | scalar | ) | const |
|
inline |
BoolNArrayReturnType vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseNotEqual | ( | const value_type & | scalar | ) | const |
|
inline |
Tell if the narray is empty (STL compatibility). False unless size is zero.
|
inline |
Returns a const iterator on the last element (STL compatibility).
|
inline |
Comparison between two nArray of the same size, containing the same type of elements. The strides can be different. The comparaison ( ) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the two nArrays. A logical "and" is performed (except for NotEqual which uses a logical "or") to accumulate the elementwise results. The only operators provided are "==" and "!=" since the semantic is not ambiguous.
|
inline |
Comparison between an nArray and a scalar. The type of the elements of the nArray and the scalar must be the same. The comparison ( ) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the nArray and the scalar. A logical "and" is performed (except for NotEqual which uses a logical "or") to accumulate the elementwise results. The only operators provided are "==" and "!=" since the semantic is not ambiguous.
|
inline |
Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true if any element of this nArray is NaN, false otherwise
|
inline |
Test if the nArray is compact, i.e. the nArray actually uses a contiguous block of memory.
|
inline |
Return true if all the elements of this nArray are finite, false otherwise
|
inline |
Return true if all the elements of this nArray are strictly negative, false otherwise
|
inline |
Return true if all the elements of this nArray are non-negative, false otherwise
|
inline |
Return true if all the elements of this nArray are non-positive, false otherwise
|
inline |
Return true if all the elements of this nArray are strictly positive, false otherwise
|
inline |
Return the L1 norm of the nArray, i.e. the sum of the absolute values of all the elements.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the Linf norm of the nArray, i.e. the maximum of the absolute values of all the elements.
|
inline |
Return the maximum of the absolute values of all the elements.
|
inline |
Return the maximum element of the nArray.
|
inline |
Return the minimum of the absolute values of all the elements.
|
inline |
Compute the minimum AND maximum elements of the nArray. This method is more runtime-efficient than computing them separately.
minElement | reference to store the minimum element result. |
maxElement | reference to store the maximum element result. |
|
inline |
Return the minimum element of the nArray.
|
inline |
|
inline |
Return the norm of the nArray.
|
inline |
Return the square of the norm of the nArray.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Overloaded operator () for simplified (const) element access with bounds checking
|
inline |
|
inline |
|
inline |
Reference an (n-1)-dimension slice of this nArray by index (const).
|
inline |
Access the NArray owner. This method should be used only to access some extra information related to the memory layout. It is used by the engines (vctDynamicNArrayLoopEngines).
|
inline |
Create a const reference to this nArray with the strides permuted.
dimensions | a sequence of dimension numbers representing the permuted order of strides |
|
inline |
Returns a const pointer to the first element of the container. Addition to the STL requirements.
|
inline |
Returns a const pointer to an element of the container, specified by its indices. Addition to the STL requirements.
|
inline |
Return the product of the elements of the nArray.
|
inline |
Returns a reverse const iterator on the last element (STL compatibility).
|
inline |
Returns a reverse const iterator on the element before first (STL compatibility).
|
inline |
Return the number of elements in the nArray. This is not equivalent to the difference between the end and the beginning.
|
inline |
Not required by STL but provided for completeness
|
inline |
Not required by STL but provided for completeness
|
inline |
Create a 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 |
Not required by STL but provided for completeness
|
inline |
Not required by STL but provided for completeness
|
inline |
Create a 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 |
Return the sum of the elements of the nArray.
|
inlineprotected |
Check the validity of the given dimension index
|
inlineprotected |
Check the validity of an index
|
inlineprotected |
Check the validity of the nArray indices
|
inlineprotected |
Check the validity of the given index in the (dimension)th-dimension
|
inline |
Print the nArray to a text stream
|
inline |
Return a string representation of the nArray elements
|
inline |
Returns true if the given dimension value is equal to this nArray's dimension.
|
inline |
Returns true if the given dimension index is valid.
|
inline |
Returns true if the index is less than the number of elements of the nArray.
|
inline |
Returns true if all indices are valid indices.
|
inline |
Returns true if the given index is a valid index.
vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | _elementType | ) |
vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_NARRAY_TRAITS_TYPEDEFS | ( | _dimension | ) |
|
protected |
Declaration of the nArray-defining member object