Ocean
|
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 Object & | object (const size_t index) |
Returns one object of this container. More... | |
const Indices & | subset () const |
Returns the current object subset of this container. More... | |
const Indices & | subset (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< Object > | Objects |
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... | |
T | distance (const size_t a, const size_t b) const |
Determines the distance between two objects of this container. More... | |
T | 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... | |
T | 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... | |
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.
T | Data type of the individual objects of each object |
tDimensions | Number of dimension that each object has |
|
protected |
Definition of a vector holding flags.
typedef std::vector<size_t> Ocean::SuccessionSubset< T, tDimensions >::Indices |
Definition of a vector holding indices.
typedef StaticBuffer<T, tDimensions> Ocean::SuccessionSubset< T, tDimensions >::Object |
The definition of an abstract object of this constainer.
|
protected |
Definition of a vector holding abstract objects.
Ocean::SuccessionSubset< T, tDimensions >::SuccessionSubset |
Creates an empty container object.
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.
objects | Objects that will be copied |
size | Number of given objects |
|
inlinestatic |
Returns the dimension of each object of this container.
|
protected |
Determines the distance between two objects of this container.
a | Index of the first object, with range [0, size()) |
b | Index of the second object |
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.
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.
object | Index of the object that is selected explicitly, with range [0, size()) |
|
inlinestatic |
Converts the indices of this object to 32 bit indices.
indices | Indices to convert |
|
inline |
Returns whether this container is empty and thus does not store any object.
|
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.
|
protected |
Returns the maximal distance between a specified object of this container and all remaining objects of this container.
index | Index of the object for that the minimal distance will be determined, with range [0, size()) |
|
protected |
Returns the smallest distance between a specified object of this container and all subset objects of this container.
index | Index of the object for that the minimal distance will be determined, with range [0, size()) |
|
inline |
Returns one object of this container.
index | The index of the requested object, with range [0, size()) |
|
inlineexplicit |
Returns whether this container holds at least one object.
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.
objects | New object to be copied into this container |
size | Number of given objects |
|
inline |
Returns the number of objects that are managed by this container.
|
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.
|
inline |
Returns the current object subset of this container.
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.
size | Size of the requested subset, with range [1, size()) |
|
protected |
Objects flags, for a fast check whether an objects is part of the internal subset.
|
protected |
All objects of this container.
|
protected |
The indices of all objects inside the subset.