ERC CISST - cisst software

vctBarycentricVector< _elementType, _size > Class Template Reference
[Vectors]

#include <vctBarycentricVector.h>

Inheritance diagram for vctBarycentricVector< _elementType, _size >:

Inheritance graph
[legend]
Collaboration diagram for vctBarycentricVector< _elementType, _size >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class _elementType, vct::size_type _size>
class vctBarycentricVector< _elementType, _size >

class vctBarycentricVector is derived from vctFixedSizeVector and has the same basic functionality. It contains a few additional functions meant to simplify dealing with vectors of barycentric coordinates. For our general definition, a set of coordinates is barycentric if it sums to 1. When a barycentric vector is used to parametrize a simplex geometrical object, all interior points have all-positive coordinates. All member points (including the boundary) have non-negative coordinates. A boundary point has one or more of its coordinates zero. A vertex has one coordinate equal to 1, and the others zero.

I have decided to derive this class from vctFixedSizeVector, which means that the operations can only be performed on locally owned memory (as opposed to a referenced vector). The reason was that it would be too hard to regenerate this set of operations as a subclass for each vector type. In addition, most of the operations here are const methods, and in the case of computing a new set of coordinates, they return it by value. Therefore, vctBarycentricVector is safer to use than other library objects, but on the other hand the operations may be somewhat slower.

I did not provide the full set of constructors as I have with vctFixedSizeVector, and therefore the use of a vctBarycentricVector should be more explicit in terms of type conversions than vctFixedSizeVector.

Many operations on vctBarycentricVector require a tolerance argument, which is given with a default value. The tolerance argument must be non-negative, or else the result is undefined. The current implementation does not test for it, but assumes it. In most cases, we compare absolute values of numbers to the tolerance.

Definition at line 70 of file vctBarycentricVector.h.

Public Types

Public Member Functions

Public Attributes


Member Typedef Documentation

template<class _elementType, vct::size_type _size>
typedef vctFixedSizeVector<_elementType, _size> vctBarycentricVector< _elementType, _size >::BaseType

Type of the base class.

Reimplemented from vctFixedSizeVector< _elementType, _size >.

Definition at line 73 of file vctBarycentricVector.h.

template<class _elementType, vct::size_type _size>
typedef vctBarycentricVector<_elementType, _size> vctBarycentricVector< _elementType, _size >::ThisType

Type of the vector itself.

Reimplemented from vctFixedSizeVector< _elementType, _size >.

Definition at line 74 of file vctBarycentricVector.h.

template<class _elementType, vct::size_type _size>
typedef class cmnTypeTraits< value_type > vctBarycentricVector< _elementType, _size >::TypeTraits

Type traits for the elements of the vector.

Reimplemented from vctFixedSizeVector< _elementType, _size >.

Definition at line 77 of file vctBarycentricVector.h.


Constructor & Destructor Documentation

template<class _elementType, vct::size_type _size>
vctBarycentricVector< _elementType, _size >::vctBarycentricVector (  )  [inline]

Default constructor -- call base class def. ctor

Definition at line 80 of file vctBarycentricVector.h.

template<class _elementType, vct::size_type _size>
vctBarycentricVector< _elementType, _size >::vctBarycentricVector ( const ThisType other  )  [inline]

copy constructor for vctBarycentricVector object

Definition at line 85 of file vctBarycentricVector.h.

template<class _elementType, vct::size_type _size>
vctBarycentricVector< _elementType, _size >::vctBarycentricVector ( const BaseType other  )  [inline]

copy constructor for vctFixedSizeVector object

Definition at line 90 of file vctBarycentricVector.h.

template<class _elementType, vct::size_type _size>
template<stride_type __stride, class __dataPtrType>
vctBarycentricVector< _elementType, _size >::vctBarycentricVector ( const vctFixedSizeVectorBase< _size, __stride, _elementType, __dataPtrType > &  other  )  [inline]

copy constructor from a general vector

Definition at line 96 of file vctBarycentricVector.h.


Member Function Documentation

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::IsBarycentric ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return true iff the sum of elements of this vector is equal to 1 up to the given tolerance. See class documentation.

Definition at line 137 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::_elementType, and vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, 1 >::array >::SumOfElements().

Referenced by vctBarycentricVector< _elementType, _size >::IsInterior(), and vctBarycentricVector< _elementType, _size >::IsMember().

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::IsInterior ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return true iff all the coordinates are greater than or equal to the given tolerance. See class documentation.

Definition at line 145 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::IsBarycentric().

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::IsMember ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return true iff all the coodinates are greater than -tolerance. See class documentation.

Definition at line 155 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::IsBarycentric().

Referenced by vctBarycentricVector< _elementType, _size >::IsBoundary(), and vctBarycentricVector< _elementType, _size >::IsVertex().

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::HasZero ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return true iff one of the coodinates is zero, up to the given tolerance. This is not a membership test.

Definition at line 165 of file vctBarycentricVector.h.

Referenced by vctBarycentricVector< _elementType, _size >::IsBoundary(), and vctBarycentricVector< _elementType, _size >::IsVertex().

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::IsBoundary ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return (IsMember(tolerance) && HasZero(tolerance));

Definition at line 175 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::HasZero(), and vctBarycentricVector< _elementType, _size >::IsMember().

template<class _elementType, vct::size_type _size>
bool vctBarycentricVector< _elementType, _size >::IsVertex ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return true iff a the vector is a member and a coordinate is equal to 1 up to a given tolerance

Definition at line 182 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::_elementType, vctBarycentricVector< _elementType, _size >::HasZero(), and vctBarycentricVector< _elementType, _size >::IsMember().

template<class _elementType, vct::size_type _size>
ThisType vctBarycentricVector< _elementType, _size >::ScaleToBarycentric ( const _elementType  tolerance = TypeTraits::Tolerance()  )  const [inline]

return a barycentric scaled version of this vector, that is, a vector whose sum of elements is 1. If the sum of this vector is zero up to the given tolerance, return a zero vector (which is not barycentric).

Definition at line 195 of file vctBarycentricVector.h.

References vctBarycentricVector< _elementType, _size >::_elementType, and vctFixedSizeConstVectorBase< _size, _stride, _elementType, vctFixedSizeVectorTraits< _elementType, _size, 1 >::array >::SumOfElements().


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu