cisst-saw
|
#include <vctDynamicConstVectorBase.h>
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 OwnerType & | Owner (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 |
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).
_vectorOwnerType | the type of vector owner. |
_elementType | the type of elements of the vector. |
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.
typedef vctReturnDynamicVector<BoolType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::BoolVectorReturnType |
The type of a vector of booleans returned from operations on this object, e.g., ElementwiseEqual.
typedef OwnerType::const_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::const_iterator |
Const iterator on the elements of the vector.
typedef OwnerType::const_reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::const_reverse_iterator |
Const reverse iterator on the elements of the vector.
typedef vctDynamicVector<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::CopyType |
The type used to create a copy.
typedef OwnerType::iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::iterator |
Iterator on the elements of the vector.
typedef _vectorOwnerType vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::OwnerType |
Type of the data owner (dynamic array or pointer)
typedef OwnerType::reverse_iterator vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::reverse_iterator |
Reverse iterator on the elements of the vector.
typedef vctDynamicConstVectorBase<_vectorOwnerType, _elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::ThisType |
Type of the vector itself.
typedef cmnTypeTraits<value_type> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::TypeTraits |
typedef vctDynamicVector<_elementType> vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VectorReturnType |
The type of a vector returned by value from operations on this object
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.
|
inline |
Unary elementwise operations on a vector. For each element of the vector "this", performs where
can calculate the absolute value (Abs), the opposite (Negation) or the normalized version (Normalized).
|
inline |
Return true if all the elements of this vector are nonzero, false otherwise
|
inline |
|
inline |
|
inline |
Return true if any element of this vector is nonzero, false otherwise
|
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.
|
inline |
Returns a const iterator on the first element (STL compatibility).
|
inline |
|
inline |
Dot product with another vector of the same type and size
otherVector | second operand of the dot product ("this" is the first operand) |
|
inline |
Access an element by index (const). This method allows to access an element without any bounds checking.
|
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 ( ) 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.
|
inline |
Comparison between a vector and a scalar, containing the same type of elements. The comparaison ( ) 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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tell is the vector is empty (STL compatibility). False unless size is zero.
|
inline |
Returns a const iterator on the last element (STL compatibility).
|
inline |
Comparison between two vectors of the same size, containing the same type of elements. The stride can be different. The comparaison ( ) 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.
|
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 ( ) 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.
|
inline |
Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.
|
inline |
Test if the method FastCopyOf can be used instead of Assign. See FastCopyOf for more details.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return true if any element of this vector is NaN, false otherwise
|
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.
|
inline |
Return true if all the elements of this vector are finite, false otherwise
|
inline |
Test if the vector is "Fortran" compatible, i.e. is compact.
|
inline |
Return true if all the elements of this vector are strictly negative, false otherwise
|
inline |
Return true if all the elements of this vector are non-negative, false otherwise
|
inline |
Return true if all the elements of this vector are non-positive, false otherwise
|
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.
|
inline |
Test if this vector is normalized. This method uses the tolerance provided by the user.
tolerance | The maximum difference between the norm and 1 to consider the vector normalized. |
|
inline |
Return true if all the elements of this vector are strictly positive, false otherwise
|
inline |
Return the L1 norm of the vector, i.e. the sum of the absolute values of all the elements.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the Linf norm of the vector, i.e. the maximum of the absolute values of all the elements.
|
inline |
Return the maximum of the absolute values of all the elements.
|
inline |
Return the maximum element of the vector.
|
inline |
Return the minimum of the absolute values of all the elements.
|
inline |
Compute the minimum AND maximum elements of the vector. This method is more runtime-efficient than computing them separately.
minElement | reference to store the minimum element result. |
maxElement | reference to store the maximum element result. |
|
inline |
Return the minimum element of the vector.
|
inline |
|
inline |
Return the norm of the vector.
|
inline |
|
inline |
Return the square of the norm of the vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Overloaded operator () for simplified (const) element access with bounds checking
|
inline |
|
inline |
|
inline |
Access an element by index (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).
|
inline |
Returns a const pointer to an element of the container, specified by its index. Addition to the STL requirements.
|
inline |
Return the product of the elements of the vector.
|
inline |
Returns a reverse const iterator on the last element (STL compatibility).
|
inline |
Create a const reference to a sub vector
|
inline |
Returns a reverse const iterator on the element before first (STL compatibility).
|
inline |
Binary serialization
|
inline |
Return the number of elements in the vector. This is not equivalent to the difference between the end and the beginning.
|
inline |
Not required by STL but provided for completeness
|
inline |
Return the sum of the elements of the vector.
|
inlineprotected |
Check the validity of an index.
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if this index is valid.
vctDynamicConstVectorBase< _vectorOwnerType, _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | _elementType | ) |
|
inline |
Returns the fourth element of the vector. This method uses CMN_ASSERT to check that the size is at least 4.
|
inline |
Returns the first element of the vector. This method uses CMN_ASSERT to check that the size is at least 1.
|
inline |
Return a (const) vector reference for the first and fourth elements of this vector.
|
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).
|
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).
|
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).
|
inline |
Return a (const) vector reference for the first and third elements of this vector.
|
inline |
Returns the second element of the vector. This method uses CMN_ASSERT to check that the size is at least 2.
|
inline |
Return a (const) vector reference for the two elements of this vector beginning on the second.
|
inline |
Return a (const) vector reference for the two elements of this vector beginning on the second.
|
inline |
Return a (const) vector reference for the second, third and fourth elements of this vector.
|
inline |
Returns the third element of the vector. This method uses CMN_ASSERT to check that the size is at least 3.
|
inline |
Return a (const) vector reference for the two elements of this vector beginning on the third.
|
protected |
Declaration of the vector-defining member object