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

Declaration of vctDynamicConstVectorBase. More...

Go to the source code of this file.

Classes

class  ConstSubvector

Macros

#define _vctDynamicConstVectorBase_h

Typedefs

typedef vctDynamicConstVectorBase< _vectorOwnerType, _elementType > ThisType
typedef _vectorOwnerType OwnerType
typedef vctDynamicVector< _elementType > CopyType
typedef vctDynamicVector< _elementType > VectorValueType
typedef vctDynamicVector< _elementType > VectorReturnType
typedef cmnTypeTraits< value_typeTypeTraits
typedef vctReturnDynamicVector< BoolTypeBoolVectorReturnType

Functions

template<class _vectorOwnerType, class __vectorOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector (const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector2)
template<class _vectorOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar (const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const _elementType &scalar)
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
void ThrowUnlessValidIndex (size_type index) const CISST_THROW(std
const_iterator begin (void) const
const_iterator cbegin (void) const
const_iterator end (void) const
const_iterator cend (void) const
const_reverse_iterator rbegin (void) const
const_reverse_iterator crbegin (void) const
const_reverse_iterator rend (void) const
const_reverse_iterator crend (void) const
size_type size (void) const
difference_type stride () const
bool empty () const
const_reference operator[] (index_type index) const
const_reference at (size_type index) const CISST_THROW(std
const_reference operator() (size_type index) const CISST_THROW(std
const_reference Element (size_type index) const
const OwnerTypeOwner (void) const
const_pointer Pointer (index_type index=0) const
bool ValidIndex (size_type index) const
Size dependant methods.

The following methods are size dependant, i.e. don't necessarily mean anything for all sizes of vector. For example, using the Z() method on a vector of size 2 shouldn't be allowed. Therefore, we are using CMN_ASSERT to check that the size is valid.

const value_typeX (void) const
const value_typeY (void) const
const value_typeZ (void) const
const value_typeW (void) const
vctDynamicConstVectorRef< _elementType > XY (void) const
vctDynamicConstVectorRef< _elementType > XZ (void) const
vctDynamicConstVectorRef< _elementType > XW (void) const
vctDynamicConstVectorRef< _elementType > YZ (void) const
vctDynamicConstVectorRef< _elementType > YW (void) const
vctDynamicConstVectorRef< _elementType > ZW (void) const
vctDynamicConstVectorRef< _elementType > XYZ (void) const
vctDynamicConstVectorRef< _elementType > YZW (void) const
vctDynamicConstVectorRef< _elementType > XYZW (void) const
vctDynamicConstVectorRef< _elementType > Ref (const size_type size, const size_type startPosition=0) const CISST_THROW(std
Incremental operations returning a scalar.

Compute a scalar from all the elements of the vector.

value_type SumOfElements (void) const
value_type ProductOfElements (void) const
value_type NormSquare (void) const
NormType Norm (void) const
bool IsNormalized (void) const
bool IsNormalized (_elementType tolerance) 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
bool IsFortran (void) const
template<class __vectorOwnerType>
bool FastCopyCompatible (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const
template<size_type __size, stride_type __stride, class __dataPtrType>
bool FastCopyCompatible (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source) const
template<class __vectorOwnerType>
value_type DotProduct (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Elementwise comparisons between vectors.

Returns the vector of comparison's results.

template<class __vectorOwnerType>
bool Equal (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool operator== (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, value_type tolerance) const
template<class __vectorOwnerType>
bool AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool NotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool operator!= (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool Lesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool LesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool Greater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
bool GreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseNotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseLesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseLesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseGreater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseGreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
Elementwise comparisons between a vector and a scalar.

Returns the vector of comparison's results.

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
BoolVectorReturnType ElementwiseEqual (const value_type &scalar) const
BoolVectorReturnType ElementwiseNotEqual (const value_type &scalar) const
BoolVectorReturnType ElementwiseLesser (const value_type &scalar) const
BoolVectorReturnType ElementwiseLesserOrEqual (const value_type &scalar) const
BoolVectorReturnType ElementwiseGreater (const value_type &scalar) const
BoolVectorReturnType ElementwiseGreaterOrEqual (const value_type &scalar) const
Unary elementwise operations.

Returns the result of vector.op().

VectorReturnType Abs (void) const
VectorReturnType Negation (void) const
VectorReturnType Floor (void) const
VectorReturnType Ceil (void) const
VectorReturnType Normalized(void) const CISST_THROW(std std::string ToString (void) const
void ToStream (std::ostream &outputStream) const
void ToStreamRaw (std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const
void SerializeRaw (std::ostream &outputStream) const
template<class _vector1OwnerType, class _vector2OwnerType, class _elementType>
_elementType vctDotProduct (const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
template<class _vector1OwnerType, class _vector2OwnerType, class _elementType>
_elementType operator* (const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
template<class _vectorOwnerType, typename _elementType>
bool vctAll (const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
template<class _vectorOwnerType, typename _elementType>
bool vctAny (const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
template<class _vectorOwnerType, typename _elementType>
std::ostream & operator<< (std::ostream &output, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector)
template<vct::size_type __size, class _vectorOwnerType, class __elementType>
std::ostream & operator<< (std::ostream &output, const vctDynamicConstVectorBase< _vectorOwnerType, vctFixedSizeVector< __elementType, __size > > &vector)
template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType, class _vectorOwnerType>
void vctFixedSizeVectorBaseAssignDynamicConstVectorBase (vctFixedSizeVectorBase< _size, _stride, _elementType, _dataPtrType > &fixedSizeVector, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &dynamicVector)

Variables

OwnerType Vector

Detailed Description

Declaration of vctDynamicConstVectorBase.

Macro Definition Documentation

◆ _vctDynamicConstVectorBase_h

#define _vctDynamicConstVectorBase_h

Typedef Documentation

◆ BoolVectorReturnType

The type of a vector of booleans returned from operations on this object, e.g., ElementwiseEqual.

◆ CopyType

typedef vctDynamicVector<_elementType> CopyType

The type used to create a copy.

◆ OwnerType

typedef _vectorOwnerType OwnerType

Type of the data owner (dynamic array or pointer)

◆ ThisType

typedef vctDynamicConstVectorBase<_vectorOwnerType, _elementType> ThisType

Type of the vector itself.

◆ TypeTraits

◆ VectorReturnType

typedef vctDynamicVector<_elementType> VectorReturnType

The type of a vector returned by value from operations on this object

◆ VectorValueType

typedef vctDynamicVector<_elementType> VectorValueType

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

Function Documentation

◆ Abs()

VectorReturnType Abs ( void ) const
inline

Unary elementwise operations on a vector. For each element of the vector "this", performs \( this[i] \leftarrow op(otherVector[i])\) where \(op\) can calculate the absolute value (Abs), the opposite (Negation) or the normalized version (Normalized).

Returns
A new vector.

◆ All()

bool All ( void ) const
inline

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

◆ AlmostEqual() [1/2]

template<class __vectorOwnerType>
bool AlmostEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ AlmostEqual() [2/2]

template<class __vectorOwnerType>
bool AlmostEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector,
value_type tolerance ) const
inline

◆ Any()

bool Any ( void ) const
inline

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

◆ at()

const_reference at ( size_type index) const

Access an element by index (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 element[index]

◆ begin()

const_iterator begin ( void ) const

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

◆ cbegin()

const_iterator cbegin ( void ) const

◆ Ceil()

VectorReturnType Ceil ( void ) const
inline

◆ cend()

const_iterator cend ( void ) const

◆ crbegin()

const_reverse_iterator crbegin ( void ) const

◆ crend()

const_reverse_iterator crend ( void ) const

◆ DotProduct()

template<class __vectorOwnerType>
value_type DotProduct ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

Dot product with another vector of the same type and size

Parameters
otherVectorsecond operand of the dot product ("this" is the first operand)
Returns
The dot product of this and otherVector.

◆ Element()

const_reference Element ( size_type index) const

Access an element by index (const). This method allows to access an element without any bounds checking.

Returns
a reference to the element at index

◆ ElementwiseEqual() [1/2]

BoolVectorReturnType ElementwiseEqual ( const value_type & scalar) const

Comparison between a vector and a scalar, containing the same type of elements. The comparaison ( \( = \neq < \leq > \geq \)) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the vector and the scalar and stored in a newly created vector. There is no operator provided since the semantic would be ambiguous.

Returns
A vector of booleans.

◆ ElementwiseEqual() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

Comparison between two vectors of the same size, containing the same type of elements. The strides and the internal representation (_vectorOwnerType) can be different. The comparaison ( \( = \neq < \leq > \geq \)) for ElementwiseEqual(), ElementwiseNotEqual(), ElementwiseLesser(), ElementwiseLesserOrEqual(), ElementwiseGreater() or ElementwiseGreaterOrEqual() is performed elementwise between the two vectors and stored in a newly created vector. There is no operator provided since the semantic would be ambiguous.

Returns
A vector of booleans.

◆ ElementwiseGreater() [1/2]

BoolVectorReturnType ElementwiseGreater ( const value_type & scalar) const

◆ ElementwiseGreater() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseGreater ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

◆ ElementwiseGreaterOrEqual() [1/2]

BoolVectorReturnType ElementwiseGreaterOrEqual ( const value_type & scalar) const

◆ ElementwiseGreaterOrEqual() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseGreaterOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

◆ ElementwiseLesser() [1/2]

BoolVectorReturnType ElementwiseLesser ( const value_type & scalar) const

◆ ElementwiseLesser() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseLesser ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

◆ ElementwiseLesserOrEqual() [1/2]

BoolVectorReturnType ElementwiseLesserOrEqual ( const value_type & scalar) const

◆ ElementwiseLesserOrEqual() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseLesserOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

◆ ElementwiseNotEqual() [1/2]

BoolVectorReturnType ElementwiseNotEqual ( const value_type & scalar) const

◆ ElementwiseNotEqual() [2/2]

template<class __vectorOwnerType>
BoolVectorReturnType ElementwiseNotEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const

◆ empty()

bool empty ( void ) const

Tell is the vector 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 a vector and a scalar. The type of the elements of the vector and the scalar must be the same. The comparaison ( \( = \neq < \leq > \geq \)) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the vector 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 __vectorOwnerType>
bool Equal ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

Comparison between two vectors of the same size, containing the same type of elements. The stride can be different. The comparaison ( \( = \neq < \leq > \geq \)) for Equal(), NotEqual(), Lesser(), LesserOrEqual(), Greater() or GreaterOrEqual() is performed elementwise between the two vectors. 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() [1/2]

template<class __vectorOwnerType>
bool FastCopyCompatible ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > & source) const
inline

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

◆ FastCopyCompatible() [2/2]

template<size_type __size, stride_type __stride, class __dataPtrType>
bool FastCopyCompatible ( const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > & source) const
inline

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

◆ Floor()

VectorReturnType Floor ( void ) const
inline

◆ Greater() [1/2]

bool Greater ( const value_type & scalar) const
inline

◆ Greater() [2/2]

template<class __vectorOwnerType>
bool Greater ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ GreaterOrEqual() [1/2]

bool GreaterOrEqual ( const value_type & scalar) const
inline

◆ GreaterOrEqual() [2/2]

template<class __vectorOwnerType>
bool GreaterOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ HasNaN()

bool HasNaN ( void ) const
inline

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

◆ IsCompact()

bool IsCompact ( void ) const
inline

Test if the vector is compact, i.e. a vector of length l actually uses a contiguous block of memory or size l. A compact vector has a stride equal to 1.

◆ IsFinite()

bool IsFinite ( void ) const
inline

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

◆ IsFortran()

bool IsFortran ( void ) const
inline

Test if the vector is "Fortran" compatible, i.e. is compact.

See also
IsCompact

◆ IsNegative()

bool IsNegative ( void ) const
inline

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

◆ IsNonNegative()

bool IsNonNegative ( void ) const
inline

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

◆ IsNonPositive()

bool IsNonPositive ( void ) const
inline

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

◆ IsNormalized() [1/2]

bool IsNormalized ( _elementType tolerance) const
inline

Test if this vector is normalized. This method uses the tolerance provided by the user.

Parameters
toleranceThe maximum difference between the norm and 1 to consider the vector normalized.
Note
This method has been overloaded instead of using a default value for the tolerance parameter to allow the use of vctDynamicVector with types for which don't have a tolerance defined via cmnTypeTraits. Otherwise, some compilers will try to expand the signature and will not be able to set the default tolerance.

◆ IsNormalized() [2/2]

bool IsNormalized ( void ) const
inline

Test if this vector is normalized. This method will use the default tolerance defined in cmnTypeTraits as the maximum difference between the norm and 1 to consider the vector normalized.

◆ IsPositive()

bool IsPositive ( void ) const
inline

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

◆ L1Norm()

value_type L1Norm ( void ) const
inline

Return the L1 norm of the vector, 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 __vectorOwnerType>
bool Lesser ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ LesserOrEqual() [1/2]

bool LesserOrEqual ( const value_type & scalar) const
inline

◆ LesserOrEqual() [2/2]

template<class __vectorOwnerType>
bool LesserOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ LinfNorm()

value_type LinfNorm ( void ) const
inline

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

See also
MaxAbsElement
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 vector.

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 vector. 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 vector is empty (null pointer) the result is undefined.

◆ MinElement()

value_type MinElement ( void ) const
inline

Return the minimum element of the vector.

Returns
The minimum element

◆ Negation()

VectorReturnType Negation ( void ) const
inline

◆ Norm()

NormType Norm ( void ) const
inline

Return the norm of the vector.

Returns
The norm.

◆ NormSquare()

value_type NormSquare ( void ) const
inline

Return the square of the norm of the vector.

Returns
The square of the norm

◆ NotEqual() [1/2]

bool NotEqual ( const value_type & scalar) const
inline

◆ NotEqual() [2/2]

template<class __vectorOwnerType>
bool NotEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ operator!=() [1/2]

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

◆ operator!=() [2/2]

template<class __vectorOwnerType>
bool operator!= ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ operator()()

const_reference operator() ( size_type index) const
inline

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

◆ operator*()

template<class _vector1OwnerType, class _vector2OwnerType, class _elementType>
_elementType operator* ( const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > & vector1,
const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > & vector2 )
inline

Dot product of two vectors of the same type and size.

Parameters
vector1first operand of the dot product.
vector2second operand of the dot product.
Returns
The dot product of vector1 and vector2.

◆ operator<<() [1/2]

template<class _vectorOwnerType, typename _elementType>
std::ostream & operator<< ( std::ostream & output,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector )

Stream out operator.

◆ operator<<() [2/2]

template<vct::size_type __size, class _vectorOwnerType, class __elementType>
std::ostream & operator<< ( std::ostream & output,
const vctDynamicConstVectorBase< _vectorOwnerType, vctFixedSizeVector< __elementType, __size > > & vector )

◆ operator==() [1/2]

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

◆ operator==() [2/2]

template<class __vectorOwnerType>
bool operator== ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > & otherVector) const
inline

◆ operator[]()

const_reference operator[] ( index_type index) const

Access an element by index (const).

Returns
a const reference to the element[index]

◆ Owner()

const OwnerType & Owner ( void ) const

Access the vector owner. This method should be used only to access some extra information related to the memory layout. It is used by the engines (vctDynamicVectorLoopEngines).

◆ Pointer()

const_pointer Pointer ( index_type index = 0) const

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

◆ ProductOfElements()

value_type ProductOfElements ( void ) const
inline

Return the product of the elements of the vector.

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

◆ Ref()

vctDynamicConstVectorRef< _elementType > Ref ( const size_type size,
const size_type startPosition = 0 ) const

Create a const reference to a sub vector

◆ rend()

const_reverse_iterator rend ( void ) const

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

◆ SerializeRaw()

void SerializeRaw ( std::ostream & outputStream) const

Binary serialization

◆ size()

size_type size ( void ) const

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

◆ stride()

difference_type stride ( ) const

Not required by STL but provided for completeness

◆ SumOfElements()

value_type SumOfElements ( void ) const
inline

Return the sum of the elements of the vector.

Returns
The sum of all the elements

◆ ThrowUnlessValidIndex()

void ThrowUnlessValidIndex ( size_type index) const
inlineprotected

Check the validity of an index.

◆ ToStream()

void ToStream ( std::ostream & outputStream) const

◆ ToStreamRaw()

void ToStreamRaw ( std::ostream & outputStream,
const char delimiter = ' ',
bool headerOnly = false,
const std::string & headerPrefix = "" ) const

◆ ToString()

VectorReturnType Normalized(void) const CISST_THROW(std std::string ToString ( void ) const
inline

◆ ValidIndex()

bool ValidIndex ( size_type index) const
inline

Returns true if this index is valid.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType )

This class is templated with the ``vector owner type'', which may be a vctDynamicVectorOwner or a vctVectorRefOwner. It provides const operations on the dynamic vector, such as SumOfElements etc.

Vector indexing is 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
_vectorOwnerTypethe type of vector owner.
_elementTypethe type of elements of the vector. */ template <class _vectorOwnerType, typename _elementType> class vctDynamicConstVectorBase { public: /* define most types from vctContainerTraits

◆ vctAll()

template<class _vectorOwnerType, typename _elementType>
bool vctAll ( const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector)
inline

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

◆ vctAny()

template<class _vectorOwnerType, typename _elementType>
bool vctAny ( const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector)
inline

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

◆ vctDotProduct()

template<class _vector1OwnerType, class _vector2OwnerType, class _elementType>
_elementType vctDotProduct ( const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > & vector1,
const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > & vector2 )
inline

Dot product of two vectors of the same type and size.

Parameters
vector1first operand of the dot product.
vector2second operand of the dot product.
Returns
The dot product of vector1 and vector2.

◆ vctDynamicVectorElementwiseCompareScalar()

template<class _vectorOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar ( const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector,
const _elementType & scalar )
inline

◆ vctDynamicVectorElementwiseCompareVector()

template<class _vectorOwnerType, class __vectorOwnerType, class _elementType, class _elementOperationType>
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector ( const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector1,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & vector2 )
inline

◆ vctFixedSizeVectorBaseAssignDynamicConstVectorBase()

template<vct::size_type _size, vct::stride_type _stride, class _elementType, class _dataPtrType, class _vectorOwnerType>
void vctFixedSizeVectorBaseAssignDynamicConstVectorBase ( vctFixedSizeVectorBase< _size, _stride, _elementType, _dataPtrType > & fixedSizeVector,
const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > & dynamicVector )
inline

◆ W()

const value_type & W ( void ) const

Returns the fourth element of the vector. This method uses CMN_ASSERT to check that the size is at least 4.

◆ X()

const value_type & X ( void ) const

Returns the first element of the vector. This method uses CMN_ASSERT to check that the size is at least 1.

◆ XW()

vctDynamicConstVectorRef< _elementType > XW ( void ) const

Return a (const) vector reference for the first and fourth elements of this vector.

◆ XY()

vctDynamicConstVectorRef< _elementType > XY ( void ) const

Return a (const) vector reference for the first two elements of this vector. May be used when switching from homogeneous coordinates to normal. (shadowed from base class).

◆ XYZ()

vctDynamicConstVectorRef< _elementType > XYZ ( void ) const

Return a (const) vector reference for the first three elements of this vector. May be used when switching from homogeneous coordinates to normal, or when refering to a subvector of a row or a column inside a small matrix. (shadowed from base class).

◆ XYZW()

vctDynamicConstVectorRef< _elementType > XYZW ( void ) const

Return a (const) vector reference for the first four elements of this vector. May be used when switching from homogeneous coordinates to normal, or when refering to a subvector of a row or a column inside a small matrix. (shadowed from base class).

◆ XZ()

vctDynamicConstVectorRef< _elementType > XZ ( void ) const

Return a (const) vector reference for the first and third elements of this vector.

◆ Y()

const value_type & Y ( void ) const

Returns the second element of the vector. This method uses CMN_ASSERT to check that the size is at least 2.

◆ YW()

vctDynamicConstVectorRef< _elementType > YW ( void ) const

Return a (const) vector reference for the two elements of this vector beginning on the second.

◆ YZ()

vctDynamicConstVectorRef< _elementType > YZ ( void ) const

Return a (const) vector reference for the two elements of this vector beginning on the second.

◆ YZW()

vctDynamicConstVectorRef< _elementType > YZW ( void ) const

Return a (const) vector reference for the second, third and fourth elements of this vector.

◆ Z()

const value_type & Z ( void ) const

Returns the third element of the vector. This method uses CMN_ASSERT to check that the size is at least 3.

◆ ZW()

vctDynamicConstVectorRef< _elementType > ZW ( void ) const

Return a (const) vector reference for the two elements of this vector beginning on the third.

Variable Documentation

◆ Vector

OwnerType Vector
protected

Declaration of the vector-defining member object