Ocean
Ocean::SuccessionSubset< T, tDimensions > Class Template Reference

This class implements a data container for abstract data objects with several dimensions. More...

Public Types

typedef StaticBuffer< T, tDimensions > Object
 The definition of an abstract object of this constainer. More...
 
typedef std::vector< size_t > Indices
 Definition of a vector holding indices. More...
 

Public Member Functions

 SuccessionSubset ()
 Creates an empty container object. More...
 
 SuccessionSubset (const Object *objects, const size_t size)
 Creates a new container and provides a set of objects that will be managed by this container. More...
 
size_t size () const
 Returns the number of objects that are managed by this container. More...
 
size_t incrementSubset ()
 Determines the next object of this container that has the largest distance to all remaining objects that are stored by this container. More...
 
bool incrementSubset (const size_t object)
 Explicitly selects one object of this container so that is will be added to the internal subset. More...
 
const Objectobject (const size_t index)
 Returns one object of this container. More...
 
const Indicessubset () const
 Returns the current object subset of this container. More...
 
const Indicessubset (const size_t size)
 Returns a subset of the stored elements with specified size. More...
 
void setObjects (const Object *objects, const size_t size)
 Overwrites all objects of this container and resets the current subset of the previous object to zero. More...
 
bool isEmpty () const
 Returns whether this container is empty and thus does not store any object. More...
 
 operator bool () const
 Returns whether this container holds at least one object. More...
 

Static Public Member Functions

static size_t dimensions ()
 Returns the dimension of each object of this container. More...
 
static Indices32 indices2indices32 (const Indices &indices)
 Converts the indices of this object to 32 bit indices. More...
 

Protected Types

typedef std::vector< ObjectObjects
 Definition of a vector holding abstract objects. More...
 
typedef std::vector< unsigned char > Flags
 Definition of a vector holding flags. More...
 

Protected Member Functions

size_t smallestMaximalDistance () const
 Returns the elements of this container that is not part of the subset and that has the smallest maximal distance to all remaining objects in the container. More...
 
size_t largestMinimalDistanceWithSubset () const
 Returns the elements of this container that is not part of the subset and that has the largest minimal distance to all subset objects in the container. More...
 
distance (const size_t a, const size_t b) const
 Determines the distance between two objects of this container. More...
 
maximalDistance (const size_t index) const
 Returns the maximal distance between a specified object of this container and all remaining objects of this container. More...
 
minimalDistanceWithSubset (const size_t index) const
 Returns the smallest distance between a specified object of this container and all subset objects of this container. More...
 

Protected Attributes

Objects successionObjects
 All objects of this container. More...
 
Flags successionFlags
 Objects flags, for a fast check whether an objects is part of the internal subset. More...
 
Indices successionSubset
 The indices of all objects inside the subset. More...
 

Detailed Description

template<typename T, size_t tDimensions>
class Ocean::SuccessionSubset< T, tDimensions >

This class implements a data container for abstract data objects with several dimensions.

The container allows to extract a subset of the data objects with largest distance to the remaining objects in the container.
The distance between two objects is determined by the Euclidean distance while each dimension is normalized by the object's standard deviation of all data objects.
Each object has the same dimension and each element of the objects has the same data type.
Use this class to find a subset of e.g. camera poses, matrices or vectors so that each object of the subset has the largest distance to all objects of the entire set.
The set of objects should be set during the construction of a SuccessionSubset object or by application of SuccessionSubset::setObjects().
Beware: Set the entire set of objects before determine the subset.

Template Parameters
TData type of the individual objects of each object
tDimensionsNumber of dimension that each object has

Member Typedef Documentation

◆ Flags

template<typename T , size_t tDimensions>
typedef std::vector<unsigned char> Ocean::SuccessionSubset< T, tDimensions >::Flags
protected

Definition of a vector holding flags.

◆ Indices

template<typename T , size_t tDimensions>
typedef std::vector<size_t> Ocean::SuccessionSubset< T, tDimensions >::Indices

Definition of a vector holding indices.

◆ Object

template<typename T , size_t tDimensions>
typedef StaticBuffer<T, tDimensions> Ocean::SuccessionSubset< T, tDimensions >::Object

The definition of an abstract object of this constainer.

◆ Objects

template<typename T , size_t tDimensions>
typedef std::vector<Object> Ocean::SuccessionSubset< T, tDimensions >::Objects
protected

Definition of a vector holding abstract objects.

Constructor & Destructor Documentation

◆ SuccessionSubset() [1/2]

template<typename T , size_t tDimensions>
Ocean::SuccessionSubset< T, tDimensions >::SuccessionSubset

Creates an empty container object.

◆ SuccessionSubset() [2/2]

template<typename T , size_t tDimensions>
Ocean::SuccessionSubset< T, tDimensions >::SuccessionSubset ( const Object objects,
const size_t  size 
)

Creates a new container and provides a set of objects that will be managed by this container.

Parameters
objectsObjects that will be copied
sizeNumber of given objects

Member Function Documentation

◆ dimensions()

template<typename T , size_t tDimensions>
size_t Ocean::SuccessionSubset< T, tDimensions >::dimensions
inlinestatic

Returns the dimension of each object of this container.

Returns
Dimensions of each object, tDimension is returned

◆ distance()

template<typename T , size_t tDimensions>
T Ocean::SuccessionSubset< T, tDimensions >::distance ( const size_t  a,
const size_t  b 
) const
protected

Determines the distance between two objects of this container.

Parameters
aIndex of the first object, with range [0, size())
bIndex of the second object
Returns
Resulting distance between both objects

◆ incrementSubset() [1/2]

template<typename T , size_t tDimensions>
size_t Ocean::SuccessionSubset< T, tDimensions >::incrementSubset

Determines the next object of this container that has the largest distance to all remaining objects that are stored by this container.

The determined object is added to the internal subset, further the index of the object will be returned.

Returns
Index of the object with largest distance, returns -1 if the subset holds already all objects

◆ incrementSubset() [2/2]

template<typename T , size_t tDimensions>
bool Ocean::SuccessionSubset< T, tDimensions >::incrementSubset ( const size_t  object)

Explicitly selects one object of this container so that is will be added to the internal subset.

Use this function only if one specific object should be part of the final subset.
The object must not be part of the current subset.

Parameters
objectIndex of the object that is selected explicitly, with range [0, size())
Returns
True, if succeeded

◆ indices2indices32()

template<typename T , size_t tDimensions>
Indices32 Ocean::SuccessionSubset< T, tDimensions >::indices2indices32 ( const Indices indices)
inlinestatic

Converts the indices of this object to 32 bit indices.

Parameters
indicesIndices to convert
Returns
The converted indices

◆ isEmpty()

template<typename T , size_t tDimensions>
bool Ocean::SuccessionSubset< T, tDimensions >::isEmpty
inline

Returns whether this container is empty and thus does not store any object.

Returns
True, if so

◆ largestMinimalDistanceWithSubset()

template<typename T , size_t tDimensions>
size_t Ocean::SuccessionSubset< T, tDimensions >::largestMinimalDistanceWithSubset
protected

Returns the elements of this container that is not part of the subset and that has the largest minimal distance to all subset objects in the container.

Returns
Index of the resulting object

◆ maximalDistance()

template<typename T , size_t tDimensions>
T Ocean::SuccessionSubset< T, tDimensions >::maximalDistance ( const size_t  index) const
protected

Returns the maximal distance between a specified object of this container and all remaining objects of this container.

Parameters
indexIndex of the object for that the minimal distance will be determined, with range [0, size())
Returns
Resulting smallest distance

◆ minimalDistanceWithSubset()

template<typename T , size_t tDimensions>
T Ocean::SuccessionSubset< T, tDimensions >::minimalDistanceWithSubset ( const size_t  index) const
protected

Returns the smallest distance between a specified object of this container and all subset objects of this container.

Parameters
indexIndex of the object for that the minimal distance will be determined, with range [0, size())
Returns
Resulting smallest distance

◆ object()

template<typename T , size_t tDimensions>
const SuccessionSubset< T, tDimensions >::Object & Ocean::SuccessionSubset< T, tDimensions >::object ( const size_t  index)
inline

Returns one object of this container.

Parameters
indexThe index of the requested object, with range [0, size())
Returns
The requested object

◆ operator bool()

template<typename T , size_t tDimensions>
Ocean::SuccessionSubset< T, tDimensions >::operator bool
inlineexplicit

Returns whether this container holds at least one object.

Returns
True, if so

◆ setObjects()

template<typename T , size_t tDimensions>
void Ocean::SuccessionSubset< T, tDimensions >::setObjects ( const Object objects,
const size_t  size 
)

Overwrites all objects of this container and resets the current subset of the previous object to zero.

Parameters
objectsNew object to be copied into this container
sizeNumber of given objects

◆ size()

template<typename T , size_t tDimensions>
size_t Ocean::SuccessionSubset< T, tDimensions >::size
inline

Returns the number of objects that are managed by this container.

Returns
Object number

◆ smallestMaximalDistance()

template<typename T , size_t tDimensions>
size_t Ocean::SuccessionSubset< T, tDimensions >::smallestMaximalDistance
protected

Returns the elements of this container that is not part of the subset and that has the smallest maximal distance to all remaining objects in the container.

Returns
Index of the resulting object

◆ subset() [1/2]

template<typename T , size_t tDimensions>
const SuccessionSubset< T, tDimensions >::Indices & Ocean::SuccessionSubset< T, tDimensions >::subset
inline

Returns the current object subset of this container.

Returns
Indices of the objects that belong to the subset of this container

◆ subset() [2/2]

template<typename T , size_t tDimensions>
const SuccessionSubset< T, tDimensions >::Indices & Ocean::SuccessionSubset< T, tDimensions >::subset ( const size_t  size)

Returns a subset of the stored elements with specified size.

If the internal subset is larger than the requested size, the entire subset is returned.
If the internal subset is smaller than the requested size, the internal subset will be incremented until the requested size is reached.

Parameters
sizeSize of the requested subset, with range [1, size())
Returns
Indices of the elements of the requested subset

Field Documentation

◆ successionFlags

template<typename T , size_t tDimensions>
Flags Ocean::SuccessionSubset< T, tDimensions >::successionFlags
protected

Objects flags, for a fast check whether an objects is part of the internal subset.

◆ successionObjects

template<typename T , size_t tDimensions>
Objects Ocean::SuccessionSubset< T, tDimensions >::successionObjects
protected

All objects of this container.

◆ successionSubset

template<typename T , size_t tDimensions>
Indices Ocean::SuccessionSubset< T, tDimensions >::successionSubset
protected

The indices of all objects inside the subset.


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