cisst-saw
Loading...
Searching...
No Matches
vctDynamicConstNArrayBase.h File Reference

Declaration of vctDynamicConstNArrayBase. More...

Go to the source code of this file.

Classes

class  vctDynamicNArrayTypes< _dimension >
class  vctDynamicNArrayTypes< _dimension >::SlicesTypes< _elementType >
class  vctDynamicNArrayTypes< 1 >
class  vctDynamicNArrayTypes< 1 >::SlicesTypes

Macros

#define _vctDynamicConstNArrayBase_h

Typedefs

typedef vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > ThisType
typedef _nArrayOwnerType OwnerType
The type of the object representing a subarray of

this nArray. Access is by (const and non const) reference.

typedef vctDynamicConstNArrayRef< value_type, DIMENSIONConstSubarrayRefType
typedef vctDynamicNArrayRef< value_type, DIMENSIONSubarrayRefType
The type of the object representing a permutation of

this nArray. Access is by (const and non const) reference.

typedef vctDynamicConstNArrayRef< value_type, DIMENSIONConstPermutationRefType
typedef vctDynamicNArrayRef< value_type, DIMENSIONPermutationRefType

Enumerations

enum  { DIMENSION = OwnerType::DIMENSION }

Functions

template<class _nArrayOwnerType, class __nArrayOwnerType, class _elementType, class _elementOperationType, vct::size_type _dimension>
vctReturnDynamicNArray< bool, _dimension > vctDynamicNArrayElementwiseCompareNArray (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray1, const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray2)
template<class _nArrayOwnerType, class _elementType, class _elementOperationType, vct::size_type _dimension>
vctReturnDynamicNArray< bool, _dimension > vctDynamicNArrayElementwiseCompareScalar (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray, const _elementType &scalar)
template<class _nArrayOwnerType, class _elementType, vct::size_type _dimension>
vctDynamicNArrayRef< _elementType, _dimension - 1 > vctDynamicNArrayNArraySlice (vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension > &input, vct::size_type dimension, vct::index_type index)
template<class _nArrayOwnerType, class _elementType>
_elementType & vctDynamicNArrayElementSlice (vctDynamicNArrayBase< _nArrayOwnerType, _elementType, 1 > &input, vct::index_type index)
template<class _nArrayOwnerType, class _elementType, vct::size_type _dimension>
vctDynamicConstNArrayRef< _elementType, _dimension - 1 > vctDynamicNArrayConstNArraySlice (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &input, vct::size_type dimension, vct::index_type index)
template<class _nArrayOwnerType, class _elementType>
const _elementType & vctDynamicNArrayConstElementSlice (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, 1 > &input, vct::index_type index)
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 VCT_NARRAY_TRAITS_TYPEDEFS (_dimension)
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
template<class __nArrayOwnerType>
bool FastCopyCompatible (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source) 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
std::string ToString (void)
void ToStream (std::ostream &outputStream) const
template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
bool vctAll (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray)
template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
bool vctAny (const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray)
template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
std::ostream & operator<< (std::ostream &output, const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > &nArray)

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
typedef vctReturnDynamicNArray< value_type, DIMENSIONNArrayValueType
typedef vctDynamicNArray< value_type, DIMENSIONNArrayReturnType
typedef cmnTypeTraits< value_typeTypeTraits
typedef vctReturnDynamicNArray< BoolType, DIMENSIONBoolNArrayReturnType
OwnerType NArray
void ThrowUnlessValidDimensionIndex (dimension_type dimensionIndex) const CISST_THROW(std
void ThrowUnlessValidIndex (size_type index) const CISST_THROW(std
void ThrowUnlessValidIndex (const nsize_type &indices) const CISST_THROW(std
void ThrowUnlessValidIndex (dimension_type dimension, size_type index) const CISST_THROW(std
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 CISST_THROW(std
const_reference at (const nsize_type &coordinates) const CISST_THROW(std
const_reference operator() (const nsize_type &coordinates) const CISST_THROW(std
const OwnerTypeOwner (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
ConstSliceRefType operator[] (size_type index) const

Detailed Description

Declaration of vctDynamicConstNArrayBase.

Macro Definition Documentation

◆ _vctDynamicConstNArrayBase_h

#define _vctDynamicConstNArrayBase_h

Typedef Documentation

◆ BoolNArrayReturnType

The type of an nArray of booleans returned from operations on this object, e.g., ElementwiseEqual.

◆ ConstPermutationRefType

◆ ConstSliceRefType

typedef SlicesTypes::ConstSliceRefType ConstSliceRefType

◆ ConstSubarrayRefType

◆ NArrayReturnType

The type of nArray returned by value from operations on this object

◆ NArrayValueType

The type of nArray used to store by value results of the same type as this object.

◆ OwnerType

typedef _nArrayOwnerType OwnerType

Type of the data owner (dynamic array or pointer)

◆ PermutationRefType

◆ SliceRefType

typedef SlicesTypes::SliceRefType SliceRefType

◆ SlicesTypes

typedef vctDynamicNArrayTypes<DIMENSION>::template SlicesTypes<_elementType> SlicesTypes

◆ SubarrayRefType

◆ ThisType

typedef vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension> ThisType

Type of the nArray itself.

◆ TypeTraits

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIMENSION 

Function Documentation

◆ Abs()

NArrayReturnType Abs ( void ) const
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 (Abs) or the opposite (Negation).

Returns
A new nArray.

◆ All()

bool All ( void ) const
inline

Return true if all the elements of this nArray are nonzero, false otherwise

◆ AlmostEqual() [1/2]

template<class __nArrayOwnerType>
bool AlmostEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ AlmostEqual() [2/2]

template<class __nArrayOwnerType>
bool AlmostEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray,
value_type tolerance ) const
inline

◆ Any()

bool Any ( void ) const
inline

Return true if any element of this nArray is nonzero, false otherwise

◆ at() [1/2]

const_reference at ( const nsize_type & coordinates) const

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.

Returns
a const reference to the element at indices

◆ at() [2/2]

const_reference at ( size_type metaIndex) const

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.

Returns
a const reference to element[index]

◆ begin()

const_iterator begin ( void ) const

Returns a const iterator on the first element (STL compatibility).

◆ Ceil()

NArrayReturnType Ceil ( void ) const
inline

◆ dimension()

dimension_type dimension ( void ) const

Not required by STL but provided for completeness

◆ Element()

const_reference Element ( const nsize_type & coordinates) const

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.

Returns
a reference to the element at the specified indices

◆ ElementwiseEqual() [1/2]

BoolNArrayReturnType ElementwiseEqual ( const value_type & scalar) const

Comparison between an nArray and a scalar, containing the same type of elements. The comparison ( \( = \neq < \leq > \geq \)) 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.

Returns
An nArray of booleans.

◆ ElementwiseEqual() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
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 ( \( = \neq < \leq > \geq \)) 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.

Returns
An nArray of booleans.

◆ ElementwiseGreater() [1/2]

BoolNArrayReturnType ElementwiseGreater ( const value_type & scalar) const

◆ ElementwiseGreater() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseGreater ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ ElementwiseGreaterOrEqual() [1/2]

BoolNArrayReturnType ElementwiseGreaterOrEqual ( const value_type & scalar) const

◆ ElementwiseGreaterOrEqual() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseGreaterOrEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ ElementwiseLesser() [1/2]

BoolNArrayReturnType ElementwiseLesser ( const value_type & scalar) const

◆ ElementwiseLesser() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseLesser ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ ElementwiseLesserOrEqual() [1/2]

BoolNArrayReturnType ElementwiseLesserOrEqual ( const value_type & scalar) const

◆ ElementwiseLesserOrEqual() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseLesserOrEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ ElementwiseNotEqual() [1/2]

BoolNArrayReturnType ElementwiseNotEqual ( const value_type & scalar) const

◆ ElementwiseNotEqual() [2/2]

template<class __nArrayOwnerType>
BoolNArrayReturnType ElementwiseNotEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ empty()

bool empty ( void ) const

Tell if the narray is empty (STL compatibility). False unless size is zero.

◆ end()

const_iterator end ( void ) const

Returns a const iterator on the last element (STL compatibility).

◆ Equal() [1/2]

bool Equal ( const value_type & scalar) const
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 ( \( = \neq < \leq > \geq \)) 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.

Returns
A boolean.

◆ Equal() [2/2]

template<class __nArrayOwnerType>
bool Equal ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

Comparison between two nArray of the same size, containing the same type of elements. The strides can be different. The comparaison ( \( = \neq < \leq > \geq \)) 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.

Returns
A boolean.

◆ FastCopyCompatible()

template<class __nArrayOwnerType>
bool FastCopyCompatible ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & source) const
inline

Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.

◆ Floor()

NArrayReturnType Floor ( void ) const
inline

◆ Greater() [1/2]

bool Greater ( const value_type & scalar) const
inline

◆ Greater() [2/2]

template<class __nArrayOwnerType>
bool Greater ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ GreaterOrEqual() [1/2]

bool GreaterOrEqual ( const value_type & scalar) const
inline

◆ GreaterOrEqual() [2/2]

template<class __nArrayOwnerType>
bool GreaterOrEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ HasNaN()

bool HasNaN ( void ) const
inline

Return true if any element of this nArray is NaN, false otherwise

◆ IsCompact()

bool IsCompact ( void ) const
inline

Test if the nArray is compact, i.e. the nArray actually uses a contiguous block of memory.

Note
An empty nArray is considered compact

◆ IsFinite()

bool IsFinite ( void ) const
inline

Return true if all the elements of this nArray are finite, false otherwise

◆ IsNegative()

bool IsNegative ( void ) const
inline

Return true if all the elements of this nArray are strictly negative, false otherwise

◆ IsNonNegative()

bool IsNonNegative ( void ) const
inline

Return true if all the elements of this nArray are non-negative, false otherwise

◆ IsNonPositive()

bool IsNonPositive ( void ) const
inline

Return true if all the elements of this nArray are non-positive, false otherwise

◆ IsPositive()

bool IsPositive ( void ) const
inline

Return true if all the elements of this nArray are strictly positive, false otherwise

◆ L1Norm()

value_type L1Norm ( void ) const
inline

Return the L1 norm of the nArray, i.e. the sum of the absolute values of all the elements.

Returns
The L1 norm.

◆ Lesser() [1/2]

bool Lesser ( const value_type & scalar) const
inline

◆ Lesser() [2/2]

template<class __nArrayOwnerType>
bool Lesser ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ LesserOrEqual() [1/2]

bool LesserOrEqual ( const value_type & scalar) const
inline

◆ LesserOrEqual() [2/2]

template<class __nArrayOwnerType>
bool LesserOrEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ LinfNorm()

value_type LinfNorm ( void ) const
inline

Return the Linf norm of the nArray, i.e. the maximum of the absolute values of all the elements.

Returns
The Linf norm.

◆ MaxAbsElement()

value_type MaxAbsElement ( void ) const
inline

Return the maximum of the absolute values of all the elements.

See also
LinfNorm.
Returns
The maximum of the absolute values.

◆ MaxElement()

value_type MaxElement ( void ) const
inline

Return the maximum element of the nArray.

Returns
The maximum element

◆ MinAbsElement()

value_type MinAbsElement ( void ) const
inline

Return the minimum of the absolute values of all the elements.

Returns
The minimum of the absolute values.

◆ MinAndMaxElement()

void MinAndMaxElement ( value_type & minElement,
value_type & maxElement ) const
inline

Compute the minimum AND maximum elements of the nArray. This method is more runtime-efficient than computing them separately.

Parameters
minElementreference to store the minimum element result.
maxElementreference to store the maximum element result.
Note
If this nArray is empty (null pointer) the result is undefined.

◆ MinElement()

value_type MinElement ( void ) const
inline

Return the minimum element of the nArray.

Returns
The minimum element

◆ Negation()

NArrayReturnType Negation ( void ) const
inline

◆ Norm()

NormType Norm ( void ) const
inline

Return the norm of the nArray.

Returns
The norm.

◆ NormSquare()

value_type NormSquare ( void ) const
inline

Return the square of the norm of the nArray.

Returns
The square of the norm

◆ NotEqual() [1/2]

bool NotEqual ( const value_type & scalar) const
inline

◆ NotEqual() [2/2]

template<class __nArrayOwnerType>
bool NotEqual ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ operator!=() [1/2]

bool operator!= ( const value_type & scalar) const
inline

◆ operator!=() [2/2]

template<class __nArrayOwnerType>
bool operator!= ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ operator()()

const_reference operator() ( const nsize_type & coordinates) const

Overloaded operator () for simplified (const) element access with bounds checking

◆ operator<<()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
std::ostream & operator<< ( std::ostream & output,
const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray )

Stream out operator.

◆ operator==() [1/2]

bool operator== ( const value_type & scalar) const
inline

◆ operator==() [2/2]

template<class __nArrayOwnerType>
bool operator== ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray) const
inline

◆ operator[]()

ConstSliceRefType operator[] ( size_type index) const

Reference an (n-1)-dimension slice of this nArray by index (const).

Returns
a const reference to the given index in the most significant dimension

◆ Owner()

const OwnerType & Owner ( void ) const

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).

◆ Permutation()

ConstPermutationRefType Permutation ( const ndimension_type & dimensions) const

Create a const reference to this nArray with the strides permuted.

Parameters
dimensionsa sequence of dimension numbers representing the permuted order of strides
Note
Preserves the number of dimensions.

◆ Pointer() [1/2]

const_pointer Pointer ( const nsize_type & indices) const

Returns a const pointer to an element of the container, specified by its indices. Addition to the STL requirements.

◆ Pointer() [2/2]

const_pointer Pointer ( void ) const

Returns a const pointer to the first element of the container. Addition to the STL requirements.

◆ ProductOfElements()

value_type ProductOfElements ( void ) const
inline

Return the product of the elements of the nArray.

Returns
The product of all the elements

◆ rbegin()

const_reverse_iterator rbegin ( void ) const

Returns a reverse const iterator on the last element (STL compatibility).

◆ rend()

const_reverse_iterator rend ( void ) const

Returns a reverse const iterator on the element before first (STL compatibility).

◆ size() [1/2]

size_type size ( dimension_type dimension) const

Not required by STL but provided for completeness

◆ size() [2/2]

size_type size ( void ) const

Return the number of elements in the nArray. This is not equivalent to the difference between the end and the beginning.

◆ sizes()

const nsize_type & sizes ( void ) const

Not required by STL but provided for completeness

◆ Slice()

ConstSliceRefType Slice ( dimension_type dimension,
size_type index ) const

Create a const reference to a slice of dimension n-1, where n is the dimension of this nArray.

Parameters
dimensionthe dimension number of the direction by which to reduce
slicethe index number in the dimension specified by which to set the reference
Note
The number of dimensions is reduced by one.

◆ stride()

difference_type stride ( dimension_type dimension) const

Not required by STL but provided for completeness

◆ strides()

const nstride_type & strides ( void ) const

Not required by STL but provided for completeness

◆ Subarray()

ConstSubarrayRefType Subarray ( const nsize_type & startPosition,
const nsize_type & lengths ) const

Create a const reference to a subarray of this nArray.

Parameters
startPositionvector of indices of the element position where the reference will start
lengthsthe number of elements to reference in each dimension
Note
Preserves the number of dimensions.

◆ SumOfElements()

value_type SumOfElements ( void ) const
inline

Return the sum of the elements of the nArray.

Returns
The sum of all the elements

◆ ThrowUnlessValidDimensionIndex()

void ThrowUnlessValidDimensionIndex ( dimension_type dimensionIndex) const
inlineprotected

Check the validity of the given dimension index

◆ ThrowUnlessValidIndex() [1/3]

void ThrowUnlessValidIndex ( const nsize_type & indices) const
inlineprotected

Check the validity of the nArray indices

◆ ThrowUnlessValidIndex() [2/3]

void ThrowUnlessValidIndex ( dimension_type dimension,
size_type index ) const
inlineprotected

Check the validity of the given index in the (dimension)th-dimension

◆ ThrowUnlessValidIndex() [3/3]

void ThrowUnlessValidIndex ( size_type index) const
inlineprotected

Check the validity of an index

◆ ToStream()

void ToStream ( std::ostream & outputStream) const

Print the nArray to a text stream

◆ ToString()

std::string ToString ( void )

Return a string representation of the nArray elements

◆ ValidDimension()

bool ValidDimension ( dimension_type dimension) const
inline

Returns true if the given dimension value is equal to this nArray's dimension.

◆ ValidDimensionIndex()

bool ValidDimensionIndex ( dimension_type dimensionIndex) const
inline

Returns true if the given dimension index is valid.

◆ ValidIndex() [1/3]

bool ValidIndex ( const nsize_type & indices) const
inline

Returns true if all indices are valid indices.

◆ ValidIndex() [2/3]

bool ValidIndex ( dimension_type dimension,
size_type index ) const
inline

Returns true if the given index is a valid index.

◆ ValidIndex() [3/3]

bool ValidIndex ( size_type index) const
inline

Returns true if the index is less than the number of elements of the nArray.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType )

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).

Parameters
_nArrayOwnerTypethe type of nArray owner
_elementTypethe type of elements of the nArray */ template <class _nArrayOwnerType, typename _elementType, vct::size_type _dimension> class vctDynamicConstNArrayBase { public: /* define most types from vctContainerTraits and vctNArrayTraits

◆ VCT_NARRAY_TRAITS_TYPEDEFS()

VCT_NARRAY_TRAITS_TYPEDEFS ( _dimension )

◆ vctAll()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
bool vctAll ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray)
inline

Return true if all the elements of the NArray are nonzero, false otherwise

◆ vctAny()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
bool vctAny ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray)
inline

Return true if any element of the NArray is nonzero, false otherwise

◆ vctDynamicNArrayConstElementSlice()

template<class _nArrayOwnerType, class _elementType>
const _elementType & vctDynamicNArrayConstElementSlice ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, 1 > & input,
vct::index_type index )
inline

◆ vctDynamicNArrayConstNArraySlice()

template<class _nArrayOwnerType, class _elementType, vct::size_type _dimension>
vctDynamicConstNArrayRef< _elementType, _dimension - 1 > vctDynamicNArrayConstNArraySlice ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & input,
vct::size_type dimension,
vct::index_type index )
inline

◆ vctDynamicNArrayElementSlice()

template<class _nArrayOwnerType, class _elementType>
_elementType & vctDynamicNArrayElementSlice ( vctDynamicNArrayBase< _nArrayOwnerType, _elementType, 1 > & input,
vct::index_type index )
inline

◆ vctDynamicNArrayElementwiseCompareNArray()

template<class _nArrayOwnerType, class __nArrayOwnerType, class _elementType, class _elementOperationType, vct::size_type _dimension>
vctReturnDynamicNArray< bool, _dimension > vctDynamicNArrayElementwiseCompareNArray ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray1,
const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray2 )
inline

◆ vctDynamicNArrayElementwiseCompareScalar()

template<class _nArrayOwnerType, class _elementType, class _elementOperationType, vct::size_type _dimension>
vctReturnDynamicNArray< bool, _dimension > vctDynamicNArrayElementwiseCompareScalar ( const vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > & nArray,
const _elementType & scalar )
inline

◆ vctDynamicNArrayNArraySlice()

template<class _nArrayOwnerType, class _elementType, vct::size_type _dimension>
vctDynamicNArrayRef< _elementType, _dimension - 1 > vctDynamicNArrayNArraySlice ( vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension > & input,
vct::size_type dimension,
vct::index_type index )
inline

Variable Documentation

◆ NArray

OwnerType NArray
protected

Declaration of the nArray-defining member object