cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vctDynamicConstVectorBase< _vectorOwnerType, _elementType > Class Template Reference

#include <vctDynamicConstVectorBase.h>

Inheritance diagram for vctDynamicConstVectorBase< _vectorOwnerType, _elementType >:
vctDynamicVectorBase< _vectorOwnerType, _elementType > vctDynamicVectorBase< vctDynamicVectorOwner< _elementType >, _elementType > vctDynamicVector< bool > vctDynamicVector< char > vctDynamicVector< CiA301::Object::Data > vctDynamicVector< CISSTNETLIB_DOUBLE > vctDynamicVector< CISSTNETLIB_INTEGER > vctDynamicVector< cmnClassServicesBase * > vctDynamicVector< cmnGenericObject * > vctDynamicVector< CvHistogram * > vctDynamicVector< CvRect > vctDynamicVector< double > vctDynamicVector< float > vctDynamicVector< int > vctDynamicVector< mtsFunctionWrite * > vctDynamicVector< mtsNovintHDL::DeviceData * > vctDynamicVector< mtsNovintHDLHandle * > vctDynamicVector< mtsSensableHD::DeviceData * > vctDynamicVector< mtsSensableHDHandle * > vctDynamicVector< oniPlane > vctDynamicVector< osaThread * > vctDynamicVector< PlatformType > vctDynamicVector< prmJointType > vctDynamicVector< QListWidgetItem * > vctDynamicVector< short > vctDynamicVector< std::ifstream * > vctDynamicVector< std::string > vctDynamicVector< svlCameraGeometry::_Extrinsics > vctDynamicVector< svlCameraGeometry::_Intrinsics > vctDynamicVector< svlColorSpace > vctDynamicVector< svlDraw::Internals > vctDynamicVector< svlDraw::svlDraw::Internals > vctDynamicVector< svlEllipse > vctDynamicVector< svlFile * > vctDynamicVector< svlFilterImageCenterFinderInterface * > vctDynamicVector< svlFilterOutput * > vctDynamicVector< svlImageCodecBase * > vctDynamicVector< svlImageProcessing::DI_Algorithm > vctDynamicVector< svlImageProcessing::Internals > vctDynamicVector< svlImageTracker * > vctDynamicVector< svlOverlay * > vctDynamicVector< svlPoint2D > vctDynamicVector< svlQuad > vctDynamicVector< svlRect > vctDynamicVector< svlRenderTargetBase * > vctDynamicVector< svlSampleCameraGeometry::Extrinsics > vctDynamicVector< svlSampleCameraGeometry::Intrinsics > vctDynamicVector< svlStreamProc * > vctDynamicVector< svlStreamType > vctDynamicVector< svlTarget2D > vctDynamicVector< svlVidCapSrcBase * > vctDynamicVector< svlVideoCodecBase * > vctDynamicVector< svlVideoIO::Compression * > vctDynamicVector< unsigned char > vctDynamicVector< unsigned int > vctDynamicVector< value_type > vctDynamicVector< vctDynamicMatrix< int > > vctDynamicVector< vctDynamicMatrix< unsigned char > > vctDynamicVector< vctDynamicVector< bool > > vctDynamicVector< vctDynamicVector< double > > vctDynamicVector< vctDynamicVector< int > > vctDynamicVector< vctDynamicVector< svlBlob > > vctDynamicVector< vctDynamicVector< svlImageCodecBase * > > vctDynamicVector< vctDynamicVector< svlVideoCodecBase * > > vctDynamicVector< vctDynamicVector< unsigned char > > vctDynamicVector< vctDynamicVector< unsigned int > > vctDynamicVector< vctDynamicVector< unsigned short > > vctDynamicVector< vctDynamicVector< vctFixedSizeVector > > vctDynamicVector< vctFixedSizeMatrix< double, 3, 3 > > vctDynamicVector< vctFixedSizeVector > vctDynamicVector< vctFixedSizeVector< double, 9 > > vctDynamicVector< vctFixedSizeVectorRef > vctDynamicVectorRef< CISSTNETLIB_DOUBLE > vctDynamicVectorRef< CISSTNETLIB_INTEGER > vctDynamicVectorRef< double > vctDynamicVector< _elementType >

Classes

class  ConstSubvector
 

Public Types

typedef
vctDynamicConstVectorBase
< _vectorOwnerType,
_elementType > 
ThisType
 
typedef _vectorOwnerType OwnerType
 
typedef OwnerType::iterator iterator
 
typedef OwnerType::const_iterator const_iterator
 
typedef OwnerType::reverse_iterator reverse_iterator
 
typedef
OwnerType::const_reverse_iterator 
const_reverse_iterator
 
typedef vctDynamicVector
< _elementType > 
CopyType
 
typedef vctDynamicVector
< _elementType > 
VectorValueType
 
typedef vctDynamicVector
< _elementType > 
VectorReturnType
 
typedef cmnTypeTraits< value_type > TypeTraits
 
typedef TypeTraits::BoolType BoolType
 
typedef vctReturnDynamicVector
< BoolType
BoolVectorReturnType
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
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
 
difference_type stride () const
 
bool empty () const
 
const_reference operator[] (index_type index) const
 
const_reference at (size_type index) const throw (std::out_of_range)
 
const_reference operator() (size_type index) const throw (std::out_of_range)
 
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
 
vctDynamicConstVectorRef
< _elementType > 
Ref (const size_type size, const size_type startPosition=0) const throw (std::out_of_range)
 
template<class __vectorOwnerType >
value_type DotProduct (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
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
 
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_type & X (void) const
 
const value_type & Y (void) const
 
const value_type & Z (void) const
 
const value_type & W (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
 
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
 
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 throw (std::runtime_error)
 

Protected Member Functions

void ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range)
 

Protected Attributes

OwnerType Vector
 

Detailed Description

template<class _vectorOwnerType, typename _elementType>
class vctDynamicConstVectorBase< _vectorOwnerType, _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.

Member Typedef Documentation

template<class _vectorOwnerType, typename _elementType>
typedef TypeTraits::BoolType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolType

Define bool based on the container type to force some compilers (i.e. gcc 4.0) to delay the instantiation of the ElementWiseCompare methods.

template<class _vectorOwnerType, typename _elementType>
typedef vctReturnDynamicVector<BoolType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType

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

template<class _vectorOwnerType, typename _elementType>
typedef OwnerType::const_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::const_iterator

Const iterator on the elements of the vector.

template<class _vectorOwnerType, typename _elementType>
typedef OwnerType::const_reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::const_reverse_iterator

Const reverse iterator on the elements of the vector.

template<class _vectorOwnerType, typename _elementType>
typedef vctDynamicVector<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::CopyType

The type used to create a copy.

template<class _vectorOwnerType, typename _elementType>
typedef OwnerType::iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::iterator

Iterator on the elements of the vector.

template<class _vectorOwnerType, typename _elementType>
typedef _vectorOwnerType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::OwnerType

Type of the data owner (dynamic array or pointer)

template<class _vectorOwnerType, typename _elementType>
typedef OwnerType::reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::reverse_iterator

Reverse iterator on the elements of the vector.

template<class _vectorOwnerType, typename _elementType>
typedef vctDynamicConstVectorBase<_vectorOwnerType, _elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ThisType

Type of the vector itself.

template<class _vectorOwnerType, typename _elementType>
typedef cmnTypeTraits<value_type> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::TypeTraits
template<class _vectorOwnerType, typename _elementType>
typedef vctDynamicVector<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType

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

template<class _vectorOwnerType, typename _elementType>
typedef vctDynamicVector<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorValueType

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

Member Function Documentation

template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::All ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::AlmostEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector,
value_type  tolerance 
) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::AlmostEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Any ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const_reference vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::at ( size_type  index) const
throw (std::out_of_range
)
inline

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]
template<class _vectorOwnerType, typename _elementType>
const_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::begin ( void  ) const
inline

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

template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Ceil ( void  ) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
const_reference vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Element ( size_type  index) const
inline

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
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline

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.
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseEqual ( const value_type &  scalar) const
inline

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.
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseGreater ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseGreater ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseGreaterOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseGreaterOrEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseLesser ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseLesser ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseLesserOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseLesserOrEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseNotEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ElementwiseNotEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::empty ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::end ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.

template<class _vectorOwnerType, typename _elementType>
template<size_type __size, stride_type __stride, class __dataPtrType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.

template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Floor ( void  ) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Greater ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Greater ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::GreaterOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::GreaterOrEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::HasNaN ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsFinite ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsFortran ( void  ) const
inline

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

See Also
IsCompact
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsNegative ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsNonNegative ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsNonPositive ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.

template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::IsPositive ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Lesser ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Lesser ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::LesserOrEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::LesserOrEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::MaxElement ( void  ) const
inline

Return the maximum element of the vector.

Returns
The maximum element
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::MinAbsElement ( void  ) const
inline

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

Returns
The minimum of the absolute values.
template<class _vectorOwnerType, typename _elementType>
void vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::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.
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::MinElement ( void  ) const
inline

Return the minimum element of the vector.

Returns
The minimum element
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Negation ( void  ) const
inline
template<class _vectorOwnerType, typename _elementType>
NormType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Norm ( void  ) const
inline

Return the norm of the vector.

Returns
The norm.
template<class _vectorOwnerType , class _elementType >
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Normalized ( void  ) const
throw (std::runtime_error
)
inline
template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::NormSquare ( void  ) const
inline

Return the square of the norm of the vector.

Returns
The square of the norm
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::NotEqual ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::NotEqual ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator!= ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator!= ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
const_reference vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator() ( size_type  index) const
throw (std::out_of_range
)
inline

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

template<class _vectorOwnerType, typename _elementType>
template<class __vectorOwnerType >
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator== ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator== ( const value_type &  scalar) const
inline
template<class _vectorOwnerType, typename _elementType>
const_reference vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::operator[] ( index_type  index) const
inline

Access an element by index (const).

Returns
a const reference to the element[index]
template<class _vectorOwnerType, typename _elementType>
const OwnerType& vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Owner ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const_pointer vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Pointer ( index_type  index = 0) const
inline

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

template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ProductOfElements ( void  ) const
inline

Return the product of the elements of the vector.

Returns
The product of all the elements
template<class _vectorOwnerType, typename _elementType>
const_reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::rbegin ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Ref ( const size_type  size,
const size_type  startPosition = 0 
) const
throw (std::out_of_range
)
inline

Create a const reference to a sub vector

template<class _vectorOwnerType, typename _elementType>
const_reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::rend ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
void vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::SerializeRaw ( std::ostream &  outputStream) const
inline

Binary serialization

template<class _vectorOwnerType, typename _elementType>
size_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::size ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
difference_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::stride ( ) const
inline

Not required by STL but provided for completeness

template<class _vectorOwnerType, typename _elementType>
value_type vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::SumOfElements ( void  ) const
inline

Return the sum of the elements of the vector.

Returns
The sum of all the elements
template<class _vectorOwnerType, typename _elementType>
void vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ThrowUnlessValidIndex ( size_type  index) const
throw (std::out_of_range
)
inlineprotected

Check the validity of an index.

template<class _vectorOwnerType, typename _elementType>
void vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ToStream ( std::ostream &  outputStream) const
inline
template<class _vectorOwnerType, typename _elementType>
void vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ToStreamRaw ( std::ostream &  outputStream,
const char  delimiter = ' ',
bool  headerOnly = false,
const std::string &  headerPrefix = "" 
) const
inline
template<class _vectorOwnerType, typename _elementType>
std::string vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ToString ( void  ) const
inline
template<class _vectorOwnerType, typename _elementType>
bool vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ValidIndex ( size_type  index) const
inline

Returns true if this index is valid.

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )
template<class _vectorOwnerType, typename _elementType>
const value_type& vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::W ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const value_type& vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::X ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::XW ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::XY ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::XYZ ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::XYZW ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::XZ ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const value_type& vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Y ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::YW ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::YZ ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::YZW ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
const value_type& vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Z ( void  ) const
inline

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

template<class _vectorOwnerType, typename _elementType>
vctDynamicConstVectorRef<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ZW ( void  ) const
inline

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

Member Data Documentation

template<class _vectorOwnerType, typename _elementType>
OwnerType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::Vector
protected

Declaration of the vector-defining member object


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