Ocean
Ocean::Tracking::CorrespondenceSet< T > Class Template Reference

This class manages a set of element correspondences. More...

Inheritance diagram for Ocean::Tracking::CorrespondenceSet< T >:

Public Types

typedef T Type
 Defines the data type of the individual elements. More...
 
typedef std::vector< T > Elements
 This class defines a vector storing individual elements. More...
 
typedef std::vector< ElementsElementsVector
 This class defines a vector storing vectors of elements. More...
 

Public Member Functions

 CorrespondenceSet ()
 Creates an empty object. More...
 
 CorrespondenceSet (const Elements &elements)
 Creates new object by adding the first elements. More...
 
 CorrespondenceSet (Elements &&elements)
 Creates new object by adding the first elements. More...
 
 CorrespondenceSet (CorrespondenceSet< T > &&correspondenceSet) noexcept
 Move constructor. More...
 
size_t size () const
 Returns the number of correspondences. More...
 
size_t elements () const
 Returns the number of corresponding elements. More...
 
const ElementsVectorcorrespondences () const
 Returns the set of stored correspondences. More...
 
bool setFirstElements (const Elements &elements)
 Changes (or sets) the first set of elements. More...
 
bool setFirstElements (Elements &&elements)
 Changes (or sets) the first set of elements. More...
 
bool setFirstElements (const Elements &elements, const Indices32 &validIndices)
 Changes (or sets) the first set of elements. More...
 
bool setLastElements (const Elements &elements)
 Changes (or sets) the last set of elements. More...
 
bool setLastElements (Elements &&elements)
 Changes (or sets) the last set of elements. More...
 
bool setLastElements (const Elements &elements, const Indices32 &validIndices)
 Changes (or sets) the last set of elements. More...
 
bool addElements (const Elements &elements)
 Adds a new set of elements that corresponds to the stored sets of elements. More...
 
bool addElements (Elements &&elements)
 Adds a new set of elements that corresponds to the stored sets of elements. More...
 
bool addElements (const Elements &elements, const Indices32 &validIndices)
 Adds a new subset of elements that corresponds to a subset of the stored sets of elements. More...
 
bool reduce (const Indices32 &validIndices)
 Reduces the elements within each set of corresponding elements. More...
 
bool isEmpty () const
 Returns whether this object does not hold any set of elements. More...
 
 operator bool () const
 Returns whether this object holds at least one set of elements. More...
 
CorrespondenceSet< T > & operator= (CorrespondenceSet< T > &&right) noexcept
 Move operator. More...
 

Protected Member Functions

bool isValid () const
 Returns whether this object stores sets of elements with same number of elements. More...
 

Protected Attributes

ElementsVector correspondenceElementsSet
 The set of corresponding elements. More...
 

Detailed Description

template<typename T>
class Ocean::Tracking::CorrespondenceSet< T >

This class manages a set of element correspondences.

Template Parameters
TData type of the individual elements for that the set of correspondences will be stored

Member Typedef Documentation

◆ Elements

template<typename T >
typedef std::vector<T> Ocean::Tracking::CorrespondenceSet< T >::Elements

This class defines a vector storing individual elements.

◆ ElementsVector

template<typename T >
typedef std::vector<Elements> Ocean::Tracking::CorrespondenceSet< T >::ElementsVector

This class defines a vector storing vectors of elements.

◆ Type

template<typename T >
typedef T Ocean::Tracking::CorrespondenceSet< T >::Type

Defines the data type of the individual elements.

Constructor & Destructor Documentation

◆ CorrespondenceSet() [1/4]

template<typename T >
Ocean::Tracking::CorrespondenceSet< T >::CorrespondenceSet
inline

Creates an empty object.

◆ CorrespondenceSet() [2/4]

template<typename T >
Ocean::Tracking::CorrespondenceSet< T >::CorrespondenceSet ( const Elements elements)
inlineexplicit

Creates new object by adding the first elements.

Parameters
elementsFirst elements that will be stored as first reference elements

◆ CorrespondenceSet() [3/4]

template<typename T >
Ocean::Tracking::CorrespondenceSet< T >::CorrespondenceSet ( Elements &&  elements)
inlineexplicit

Creates new object by adding the first elements.

Parameters
elementsFirst elements that will be stored as first reference elements

◆ CorrespondenceSet() [4/4]

template<typename T >
Ocean::Tracking::CorrespondenceSet< T >::CorrespondenceSet ( CorrespondenceSet< T > &&  correspondenceSet)
inlinenoexcept

Move constructor.

Parameters
correspondenceSetCorrespondence object to be moved

Member Function Documentation

◆ addElements() [1/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::addElements ( const Elements elements)
inline

Adds a new set of elements that corresponds to the stored sets of elements.

Element correspondence is defined by the index of the given elements.
Beware: The number of provided elements must match to the number of stored elements in each set of this object.

Parameters
elementsElements to be added
Returns
True, if succeeded

◆ addElements() [2/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::addElements ( const Elements elements,
const Indices32 validIndices 
)
inline

Adds a new subset of elements that corresponds to a subset of the stored sets of elements.

Element correspondence is defined by the index of the given elements.
This function takes a set of indices which define the valid subset of the given elements.
Only valid elements will be added while also the already stored sets of elements will be reduced so that only valid elements are stored finally.

Parameters
elementsElements to be added
validIndicesIndices that define a valid subset of the given elements, each index must exist at most once and must lie inside the range [0, elements.size())
Returns
True, if succeeded

◆ addElements() [3/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::addElements ( Elements &&  elements)
inline

Adds a new set of elements that corresponds to the stored sets of elements.

Element correspondence is defined by the index of the given elements.
Beware: The number of provided elements must match to the number of stored elements in each set of this object.

Parameters
elementsElements to be added
Returns
True, if succeeded

◆ correspondences()

template<typename T >
const CorrespondenceSet< T >::ElementsVector & Ocean::Tracking::CorrespondenceSet< T >::correspondences
inline

Returns the set of stored correspondences.

Returns
Set of correspondences

◆ elements()

template<typename T >
size_t Ocean::Tracking::CorrespondenceSet< T >::elements
inline

Returns the number of corresponding elements.

Returns
Number of elements

◆ isEmpty()

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::isEmpty
inline

Returns whether this object does not hold any set of elements.

Beware: This state does not say anything about the number of elements that are stored in the individual sets.
To ensure that this object holds a valid number of sets and a valid number of elements check also elements().

Returns
True, if so
See also
elements().

◆ isValid()

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::isValid
inlineprotected

Returns whether this object stores sets of elements with same number of elements.

Returns
True, if so

◆ operator bool()

template<typename T >
Ocean::Tracking::CorrespondenceSet< T >::operator bool
inlineexplicit

Returns whether this object holds at least one set of elements.

Returns
True, if so

◆ operator=()

template<typename T >
CorrespondenceSet< T > & Ocean::Tracking::CorrespondenceSet< T >::operator= ( CorrespondenceSet< T > &&  right)
inlinenoexcept

Move operator.

Parameters
rightSecond object to be moved
Returns
Reference to this object

◆ reduce()

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::reduce ( const Indices32 validIndices)
inline

Reduces the elements within each set of corresponding elements.

The remaining elements are defined by a set of indices.

Parameters
validIndicesIndices that define a valid subset of the already stored elements, each index must exist at most once and must lie inside the range [0, elements())
Returns
True, if succeeded

◆ setFirstElements() [1/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setFirstElements ( const Elements elements)
inline

Changes (or sets) the first set of elements.

Beware: The number of provided elements must match to the number of stored elements in each set of this object, if elements have been set already.

Parameters
elementsElements that replace the existing ones
Returns
True, if succeeded

◆ setFirstElements() [2/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setFirstElements ( const Elements elements,
const Indices32 validIndices 
)

Changes (or sets) the first set of elements.

This function takes a set of indices which define the valid subset of the given elements.
Only valid elements will be added while also the already stored sets of elements will be reduced so that only valid elements are stored finally.

Parameters
elementsElements that replace the existing ones
validIndicesIndices that define a valid subset of the given elements, each index must exist at most once and must lie inside the range [0, elements.size())
Returns
True, if succeeded

◆ setFirstElements() [3/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setFirstElements ( Elements &&  elements)
inline

Changes (or sets) the first set of elements.

Beware: The number of provided elements must match to the number of stored elements in each set of this object, if elements have been set already.

Parameters
elementsElements that replace the existing ones
Returns
True, if succeeded

◆ setLastElements() [1/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setLastElements ( const Elements elements)
inline

Changes (or sets) the last set of elements.

Beware: The number of provided elements must match to the number of stored elements in each set of this object, if elements have been set already.

Parameters
elementsElements that replace the existing ones
Returns
True, if succeeded

◆ setLastElements() [2/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setLastElements ( const Elements elements,
const Indices32 validIndices 
)

Changes (or sets) the last set of elements.

This function takes a set of indices which define the valid subset of the given elements.
Only valid elements will be added while also the already stored sets of elements will be reduced so that only valid elements are stored finally.

Parameters
elementsElements that replace the existing ones
validIndicesIndices that define a valid subset of the given elements, each index must exist at most once and must lie inside the range [0, elements.size())
Returns
True, if succeeded

◆ setLastElements() [3/3]

template<typename T >
bool Ocean::Tracking::CorrespondenceSet< T >::setLastElements ( Elements &&  elements)
inline

Changes (or sets) the last set of elements.

Beware: The number of provided elements must match to the number of stored elements in each set of this object, if elements have been set already.

Parameters
elementsElements that replace the existing ones
Returns
True, if succeeded

◆ size()

template<typename T >
size_t Ocean::Tracking::CorrespondenceSet< T >::size
inline

Returns the number of correspondences.

Returns
Correspondence number

Field Documentation

◆ correspondenceElementsSet

template<typename T >
ElementsVector Ocean::Tracking::CorrespondenceSet< T >::correspondenceElementsSet
protected

The set of corresponding elements.


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