cisst-saw
Loading...
Searching...
No Matches
vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension > Class Template Reference

#include <vctDynamicNArrayBase.h>

Inheritance diagram for vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >:
vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > vctDynamicNArrayRef< value_type, DIMENSION >

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
Parameters
otherThe array to be copied.
template<class __nArrayOwnerType>
ThisTypeAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other)
Assignment operation between nArrays of different types.
Parameters
otherThe nArray to be copied.
template<class __nArrayOwnerType, typename __elementType>
ThisTypeAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
template<class __nArrayOwnerType, typename __elementType>
ThisTypeoperator= (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
ThisTypeAssign (const value_type *elements)
template<class __nArrayOwnerType, typename __elementType>
ThisTypeForceAssign (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>
ThisTypeSumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeDifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeElementwiseRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeElementwiseMinOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeElementwiseMaxOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
template<class __nArrayOwnerType>
ThisTypeAdd (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeSubtract (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeElementwiseMultiply (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeElementwiseDivide (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeElementwiseMin (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeElementwiseMax (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeoperator+= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeoperator-= (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>
ThisTypeSumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
template<class __nArrayOwnerType>
ThisTypeDifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
template<class __nArrayOwnerType>
ThisTypeProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
template<class __nArrayOwnerType>
ThisTypeRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
template<class __nArrayOwnerType>
ThisTypeClippedAboveOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound)
template<class __nArrayOwnerType>
ThisTypeClippedBelowOf (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>
ThisTypeSumOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
template<class __nArrayOwnerType>
ThisTypeDifferenceOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
template<class __nArrayOwnerType>
ThisTypeProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
template<class __nArrayOwnerType>
ThisTypeRatioOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
template<class __nArrayOwnerType>
ThisTypeClippedAboveOf (const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
template<class __nArrayOwnerType>
ThisTypeClippedBelowOf (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.

ThisTypeAdd (const value_type scalar)
ThisTypeSubtract (const value_type scalar)
ThisTypeMultiply (const value_type scalar)
ThisTypeDivide (const value_type scalar)
ThisTypeClipAbove (const value_type upperBound)
ThisTypeClipBelow (const value_type lowerBound)
ThisTypeoperator+= (const value_type scalar)
ThisTypeoperator-= (const value_type scalar)
ThisTypeoperator*= (const value_type scalar)
ThisTypeoperator/= (const value_type scalar)
template<class __nArrayOwnerType>
ThisTypeAddProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisTypeAddElementwiseProductOf (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>
ThisTypeAbsOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeNegationOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeFloorOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
template<class __nArrayOwnerType>
ThisTypeCeilOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
Store back unary elementwise operations.

Store the result of op(this) to this nArray.

ThisTypeAbsSelf (void)
ThisTypeNegationSelf (void)
ThisTypeFloorSelf (void)
ThisTypeCeilSelf (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 OwnerTypeOwner (void) const
OwnerTypeOwner (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)

Detailed Description

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
class vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >

This class provides all the const methods inherited from vctDynamicConstNArrayBase, and extends them with non const methods, such as SumOf.

See also
vctDynamicConstNArrayBase

Member Typedef Documentation

◆ BaseType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef vctDynamicConstNArrayBase<_nArrayOwnerType, _elementType, _dimension> vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::BaseType

Type of the base class

◆ const_iterator

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef OwnerType::const_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_iterator

◆ const_reverse_iterator

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef OwnerType::const_reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::const_reverse_iterator

◆ ConstPermutationRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::ConstPermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstPermutationRefType

◆ ConstSliceRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::ConstSliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSliceRefType

◆ ConstSubarrayRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::ConstSubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ConstSubarrayRefType

◆ iterator

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef OwnerType::iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::iterator

◆ OwnerType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef _nArrayOwnerType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::OwnerType

Type of the data owner (dynamic array or pointer)

◆ PermutationRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::PermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::PermutationRefType

◆ reverse_iterator

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef OwnerType::reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::reverse_iterator

◆ SliceRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::SliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SliceRefType

◆ SlicesTypes

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::SlicesTypes vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SlicesTypes

◆ SubarrayRefType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef BaseType::SubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SubarrayRefType

◆ ThisType

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
typedef vctDynamicNArrayBase vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ThisType

Type of the nArray itself

Member Enumeration Documentation

◆ anonymous enum

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
anonymous enum
Enumerator
DIMENSION 

Member Function Documentation

◆ AbsOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::AbsOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
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).

Parameters
otherNArrayThe operand of the unary operation.
Returns
The nArray "this" modified.

◆ AbsSelf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::AbsSelf ( void )
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).

Returns
The nArray "this" modified.

◆ Add() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Add ( const value_type scalar)
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).

Parameters
scalarThe second operand of the binary operation (this[i] is the first operand).
Returns
The nArray "this" modified.

◆ Add() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Add ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
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).

Parameters
otherNArrayThe second operand of the binary operation (this[i] is the first operand)
Returns
The nArray "this" modified.

◆ AddElementwiseProductOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::AddElementwiseProductOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ AddProductOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::AddProductOf ( const value_type scalar,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray )
inline

◆ Assign() [1/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Assign ( const value_type * elements)
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.

Parameters
elementsa pointer to a C array of elements to be assigned to this nArray
Note
This method assumes two things: (1) that the input array is packed, that is, that all the elements are stored in a contiguous memory block with no gaps; and (2) that the storage order of the input array matches the storage order of this nArray.
Returns
a reference to this object.

◆ Assign() [2/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType, typename __elementType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Assign ( const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > & other)
inline

◆ Assign() [3/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Assign ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & other)
inline

◆ at() [1/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::at ( const nsize_type & coordinates)
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.

Returns
a reference to the element at indices

◆ at() [2/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::at ( const nsize_type & coordinates) const
inline

◆ at() [3/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::at ( size_type metaIndex)
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.

Returns
a const reference to the element at indices

◆ at() [4/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::at ( size_type metaIndex) const
inline

◆ begin() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::begin ( void )
inline

Returns an iterator on the first element (STL compatibility).

◆ begin() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::begin ( void ) const
inline

◆ CeilOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::CeilOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ CeilSelf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::CeilSelf ( void )
inline

◆ ClipAbove()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClipAbove ( const value_type upperBound)
inline

◆ ClipBelow()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClipBelow ( const value_type lowerBound)
inline

◆ ClippedAboveOf() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClippedAboveOf ( const value_type upperBound,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
inline

◆ ClippedAboveOf() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClippedAboveOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type lowerBound )
inline

◆ ClippedBelowOf() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClippedBelowOf ( const value_type lowerBound,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
inline

◆ ClippedBelowOf() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ClippedBelowOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type upperBound )
inline

◆ DifferenceOf() [1/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::DifferenceOf ( const value_type scalar,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
inline

◆ DifferenceOf() [2/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::DifferenceOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type scalar )
inline

◆ DifferenceOf() [3/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::DifferenceOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ Divide()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Divide ( const value_type scalar)
inline

◆ Element() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Element ( const nsize_type & coordinates)
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.

Returns
a reference to the element at the specified indices

◆ Element() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Element ( const nsize_type & coordinates) const
inline

◆ ElementwiseDivide()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseDivide ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ ElementwiseMax()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseMax ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ ElementwiseMaxOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseMaxOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ ElementwiseMin()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseMin ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ ElementwiseMinOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseMinOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ ElementwiseMultiply()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseMultiply ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ ElementwiseProductOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseProductOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ ElementwiseRatioOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ElementwiseRatioOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
inline

◆ end() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::end ( void )
inline

Returns an iterator on the last element (STL compatibility).

◆ end() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::end ( void ) const
inline

◆ FastCopyOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
bool vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::FastCopyOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & source,
bool performSafetyChecks = true )
inline

Fast copy. This method uses memcpy whenever it is possible to perform a fast copy from another array to this array.

  • The method will first verify that the source and destination have the same sizes and throws an exception otherwise (std::runtime_error). See cmnThrow for details.
  • If any of the two narray is not compact or if the two narray use a different layout (different strides), this method will return false. If both narrays are compact and have the same strides, a memcpy is performed and the method returns true.
  • To avoid the tests above, one can set the parameter 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).
  • As opposed to Assign, this method doesn't perform any type conversion.
  • Since no constructor is called for the contained elements, this function performs a "shallow copy". If the contained objects have a pointer as data member, the copied object will carry on the same pointer (hence pointing at the same memory block which could easily lead to bugs).

The basic and safe use of this method for an array would be:

if (!destination.FastCopyOf(source)) {
destination.Assign(source);
}

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.

bool canUseFastCopy = destination.FastCopyPossible(source);
for (index = 0; index < 1000; index++) {
DoSomethingUseful(source);
if (canUseFastCopy) {
destination.FastCopyOf(source, false); // Do not check again
} else {
destination.Assign(source);
}
}
size_t index_type
Definition vctContainerTraits.h:36
Parameters
sourceNArray used to set the content of this array.
performSafetyChecksFlag set to false to avoid safety checks, use with extreme caution.

◆ FloorOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::FloorOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ FloorSelf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::FloorSelf ( void )
inline

◆ ForceAssign()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType, typename __elementType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ForceAssign ( const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > & other)
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.

Note
For a non-reallocating Assign, it is recommended to use the Assign() methods.
If the destination array doesn't have the same size as the source and can not be resized, an exception will be thrown by the Assign method called internally.
Parameters
otherThe array to be copied.

◆ Multiply()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Multiply ( const value_type scalar)
inline

◆ NegationOf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::NegationOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ NegationSelf()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::NegationSelf ( void )
inline

◆ operator()() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator() ( const nsize_type & coordinates)
inline

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

◆ operator()() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reference vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator() ( const nsize_type & coordinates) const
inline

documented in base class

◆ operator*=()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator*= ( const value_type scalar)
inline

◆ operator+=() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator+= ( const value_type scalar)
inline

◆ operator+=() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator+= ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ operator-=() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator-= ( const value_type scalar)
inline

◆ operator-=() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator-= ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ operator/=()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator/= ( const value_type scalar)
inline

◆ operator=()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType, typename __elementType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator= ( const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > & other)
inline

◆ operator[]() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
SliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator[] ( size_type index)
inline

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

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

◆ operator[]() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ConstSliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::operator[] ( size_type index) const
inline

documented in base class

◆ Owner() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
OwnerType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Owner ( void )
inline

◆ Owner() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const OwnerType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Owner ( void ) const
inline

◆ Permutation() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
PermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Permutation ( const ndimension_type & dimensions)
inline

Create a non-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.

◆ Permutation() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ConstPermutationRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Permutation ( const ndimension_type & dimensions) const
inline

documented in base class

◆ Pointer() [1/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
pointer vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Pointer ( const nsize_type & indices)
inline

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

◆ Pointer() [2/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_pointer vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Pointer ( const nsize_type & indices) const
inline

◆ Pointer() [3/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
pointer vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Pointer ( void )
inline

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

◆ Pointer() [4/4]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_pointer vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Pointer ( void ) const
inline

◆ ProductOf() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ProductOf ( const value_type scalar,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
inline

◆ ProductOf() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::ProductOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type scalar )
inline

◆ RatioOf() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::RatioOf ( const value_type scalar,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
inline

◆ RatioOf() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::RatioOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type scalar )
inline

◆ rbegin() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::rbegin ( void )
inline

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

◆ rbegin() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::rbegin ( void ) const
inline

◆ rend() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::rend ( void )
inline

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

◆ rend() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
const_reverse_iterator vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::rend ( void ) const
inline

◆ SetAll()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
value_type vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SetAll ( const value_type value)
inline

Assign the given value to all the elements.

Parameters
valuethe value used to set all the elements of the nArray
Returns
The value used to set all the elements

◆ Slice() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
SliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Slice ( dimension_type dimension,
size_type index )
inline

Create a non-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.

◆ Slice() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ConstSliceRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Slice ( dimension_type dimension,
size_type index ) const
inline

documented in base class

◆ Subarray() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
SubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Subarray ( const nsize_type & startPosition,
const nsize_type & lengths )
inline

Create a non-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.

◆ Subarray() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ConstSubarrayRefType vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Subarray ( const nsize_type & startPosition,
const nsize_type & lengths ) const
inline

documented in base class

◆ Subtract() [1/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Subtract ( const value_type scalar)
inline

◆ Subtract() [2/2]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Subtract ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & otherNArray)
inline

◆ SumOf() [1/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SumOf ( const value_type scalar,
const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray )
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).

Parameters
scalarThe first operand of the binary operation.
nArrayThe second operand of the binary operation.
Returns
The nArray "this" modified.

◆ SumOf() [2/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SumOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > & nArray,
const value_type scalar )
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).

Parameters
nArrayThe first operand of the binary operation.
scalarThe second operand of the binary operation.
Returns
The nArray "this" modified.

◆ SumOf() [3/3]

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType1, class __nArrayOwnerType2>
ThisType & vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::SumOf ( const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > & nArray1,
const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > & nArray2 )
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).

Parameters
nArray1The first operand of the binary operation
nArray2The second operand of the binary operation
Returns
The nArray "this" modified.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType )

◆ VCT_NARRAY_TRAITS_TYPEDEFS()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::VCT_NARRAY_TRAITS_TYPEDEFS ( _dimension )

◆ Zeros()

template<class _nArrayOwnerType, typename _elementType, vct::size_type _dimension>
bool vctDynamicNArrayBase< _nArrayOwnerType, _elementType, _dimension >::Zeros ( void )
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.

Returns
true if the nArray is compact and memset was used, false otherwise.

The documentation for this class was generated from the following file: