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

An implementation of the ``abstract'' vctFixedSizeConstVectorBase. More...

#include <vctFixedSizeConstVectorRef.h>

Inheritance diagram for vctFixedSizeConstVectorRef< _elementType, _size, _stride >:
vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, _stride >::pointer >

Public Types

typedef
vctFixedSizeVectorTraits
< _elementType, _size, _stride > 
VectorTraits
 
typedef
vctFixedSizeConstVectorRef
< value_type, _size, _stride > 
ThisType
 
typedef
vctFixedSizeConstVectorBase
< _size, _stride, value_type,
pointer > 
BaseType
 
typedef BaseType::CopyType CopyType
 
- Public Types inherited from vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, _stride >::pointer >
enum  
 
enum  
 
typedef
vctFixedSizeConstVectorBase
< _size, _stride, _elementType,
vctFixedSizeVectorTraits
< _elementType, _size, _stride >
::pointer > 
ThisType
 
typedef
vctFixedSizeVectorTraits
< _elementType, _size, _stride > 
VectorTraits
 
typedef VectorTraits::iterator iterator
 
typedef
VectorTraits::const_iterator 
const_iterator
 
typedef
VectorTraits::reverse_iterator 
reverse_iterator
 
typedef
VectorTraits::const_reverse_iterator 
const_reverse_iterator
 
typedef vctFixedSizeVector
< _elementType, _size > 
VectorValueType
 
typedef vctFixedSizeVector
< _elementType, _size > 
CopyType
 
typedef vctFixedSizeVector
< bool, _size > 
BoolVectorValueType
 
typedef
vctFixedSizeConstMatrixRef
< _elementType, 1, _size,
_stride *_size, _stride > 
RowConstMatrixRefType
 
typedef vctFixedSizeMatrixRef
< _elementType, 1, _size,
_stride *_size, _stride > 
RowMatrixRefType
 
typedef
vctFixedSizeConstMatrixRef
< _elementType, _size,
1, _stride, _stride *_size > 
ColConstMatrixRefType
 
typedef vctFixedSizeMatrixRef
< _elementType, _size,
1, _stride, _stride *_size > 
ColMatrixRefType
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 vctFixedSizeConstVectorRef ()
 
 vctFixedSizeConstVectorRef (pointer p)
 
 vctFixedSizeConstVectorRef (const_pointer p)
 
template<size_type __size, class __dataPtrType >
 vctFixedSizeConstVectorRef (const vctFixedSizeConstVectorBase< __size, _stride, _elementType, __dataPtrType > &otherVector, size_type startPosition=0)
 
template<class __vectorOwnerType >
 vctFixedSizeConstVectorRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition=0)
 
void SetRef (pointer p)
 
void SetRef (const_pointer p)
 
template<size_type __size, class __dataPtrType >
void SetRef (const vctFixedSizeConstVectorBase< __size, _stride, _elementType, __dataPtrType > &otherVector, size_type startPosition=0)
 
template<class __vectorOwnerType >
void SetRef (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition=0)
 
- Public Member Functions inherited from vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, _stride >::pointer >
 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
 
size_type max_size (void) const
 
difference_type stride (void) const
 
bool empty (void) const
 
const_reference operator[] (size_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_pointer Pointer (size_type index=0) const
 
bool ValidIndex (size_type index) const
 
vctFixedSizeConstVectorRef
< _elementType, __subSize,
_stride > 
Ref (const size_type startPosition=0) const throw (std::out_of_range)
 
value_type DotProduct (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &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
 
const value_type & X (void) const
 
const value_type & Y (void) const
 
const value_type & Z (void) const
 
const value_type & W (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, _stride > 
XY (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, 2 *_stride > 
XZ (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, 3 *_stride > 
XW (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, _stride > 
YZ (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, 2 *_stride > 
YW (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 2, _stride > 
ZW (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 3, _stride > 
XYZ (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 3, _stride > 
YZW (void) const
 
vctFixedSizeConstVectorRef
< _elementType, 4, _stride > 
XYZW (void) const
 
RowConstMatrixRefType AsRowMatrix (void) const
 
ColConstMatrixRefType AsColMatrix (void) const
 
value_type SumOfElements (void) const
 
value_type ProductOfElements (void) const
 
value_type NormSquare (void) const
 
NormType Norm (void) const
 
bool IsNormalized (_elementType tolerance=cmnTypeTraits< _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
 
bool IsCompact (void) const
 
bool IsFortran (void) const
 
bool FastCopyCompatible (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source) const
 
bool FastCopyCompatible (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const
 
bool Equal (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool operator== (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool AlmostEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector, value_type tolerance) const
 
bool AlmostEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool NotEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool operator!= (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool Lesser (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool LesserOrEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool Greater (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
bool GreaterOrEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseNotEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseLesser (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseLesserOrEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseGreater (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
BoolVectorValueType ElementwiseGreaterOrEqual (const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector) const
 
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
 
BoolVectorValueType ElementwiseEqual (const value_type &scalar) const
 
BoolVectorValueType ElementwiseNotEqual (const value_type &scalar) const
 
BoolVectorValueType ElementwiseLesser (const value_type &scalar) const
 
BoolVectorValueType ElementwiseLesserOrEqual (const value_type &scalar) const
 
BoolVectorValueType ElementwiseGreater (const value_type &scalar) const
 
BoolVectorValueType ElementwiseGreaterOrEqual (const value_type &scalar) const
 
VectorValueType Abs (void) const
 
VectorValueType Negation (void) const
 
VectorValueType Floor (void) const
 
VectorValueType Ceil (void) const
 
VectorValueType Normalized (void) const throw (std::runtime_error)
 

Additional Inherited Members

- Protected Member Functions inherited from vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, _stride >::pointer >
void ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range)
 
- Protected Attributes inherited from vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, _stride >::pointer >
vctFixedSizeVectorTraits
< _elementType, _size, _stride >
::pointer 
Data
 

Detailed Description

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
class vctFixedSizeConstVectorRef< _elementType, _size, _stride >

An implementation of the ``abstract'' vctFixedSizeConstVectorBase.

This implementations uses a pointer to the vector beginning as the vector defining data member. An instantiation of this type can be used as a subsequence with GetConstSubsequence().

Note that the class provides only const operations, except for assigning the vector start, which does not affect the vector. This is despite the fact that the stored pointer is non-const.

See the base class (vctFixedSizeConstVectorBase) for template parameter details.

Member Typedef Documentation

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
typedef vctFixedSizeConstVectorBase<_size, _stride, value_type, pointer> vctFixedSizeConstVectorRef< _elementType, _size, _stride >::BaseType
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
typedef BaseType::CopyType vctFixedSizeConstVectorRef< _elementType, _size, _stride >::CopyType
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
typedef vctFixedSizeConstVectorRef<value_type, _size, _stride> vctFixedSizeConstVectorRef< _elementType, _size, _stride >::ThisType
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
typedef vctFixedSizeVectorTraits<_elementType, _size, _stride> vctFixedSizeConstVectorRef< _elementType, _size, _stride >::VectorTraits

Constructor & Destructor Documentation

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::vctFixedSizeConstVectorRef ( )
inline

Default constructor: create an uninitialized vector

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::vctFixedSizeConstVectorRef ( pointer  p)
inline

Initialize the vector with a (non-const) pointer

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::vctFixedSizeConstVectorRef ( const_pointer  p)
inline

Initialize the vector with a const pointer. This requires const_cast.

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
template<size_type __size, class __dataPtrType >
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::vctFixedSizeConstVectorRef ( const vctFixedSizeConstVectorBase< __size, _stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition = 0 
)
inline

Initialize a fixed size reference to a fixed-size vector.

Note
There is no need to declare this constructor as explicit, because a vctFixedSizeConstVectorRef protects the content.
The stride values are taken from the fixed size vector.
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
template<class __vectorOwnerType >
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::vctFixedSizeConstVectorRef ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector,
size_type  startPosition = 0 
)
inlineexplicit

Initialize a fixed size reference to a dynamic vector.

Note
This constructor is declared as explicit, since it is atypical.

Member Function Documentation

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
void vctFixedSizeConstVectorRef< _elementType, _size, _stride >::SetRef ( pointer  p)
inline

Assign the vector start with a (non-const) pointer

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
void vctFixedSizeConstVectorRef< _elementType, _size, _stride >::SetRef ( const_pointer  p)
inline

Assign the vector start with a const pointer. This requires const_cast.

template<class _elementType, vct::size_type _size, vct::stride_type _stride>
template<size_type __size, class __dataPtrType >
void vctFixedSizeConstVectorRef< _elementType, _size, _stride >::SetRef ( const vctFixedSizeConstVectorBase< __size, _stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition = 0 
)
inline

Set a fixed size reference to a fixed-size vector.

Note
the stride of the input vector must be identical to the stride of this vector (this is enforced by the template parameters).
this vector must be contained in the input vector, that is, startPos+_size <= __size (otherwise cmnThrow is used to throw std::out_of_range).
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
template<class __vectorOwnerType >
void vctFixedSizeConstVectorRef< _elementType, _size, _stride >::SetRef ( const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &  otherVector,
size_type  startPosition = 0 
)
inline

Set a fixed size reference to a dynamic vector.

Note
the stride of the input vector must be identical to the stride of this vector (otherwise cmnThrow is used to throw std::runtime_error).
this vector must be contained in the input vector, that is, startPos+_size <= __size (otherwise cmnThrow is used to throw std::out_of_range).
template<class _elementType, vct::size_type _size, vct::stride_type _stride>
vctFixedSizeConstVectorRef< _elementType, _size, _stride >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )

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