Ocean
Ocean::Clustering< tUseIndices >::Data< T, tDimension > Class Template Reference

This class implements the abstract data object which will be specialized for both data modes toggled by tUseIndices. More...

Public Types

typedef StaticBuffer< T, tDimension > Observation
 Definition of an observation object. More...
 
typedef size_t DataIndex
 Definition of an index that addresses one specific observation element in the data object that stores all observations. More...
 
typedef std::vector< DataIndexDataIndices
 Definition of a vector holding indices to the data object. More...
 
typedef StaticBuffer< T, tDimension > Observation
 Definition of an observation object. More...
 
typedef size_t DataIndex
 Definition of an index that addresses one specific observation element in the data object that stores all observations. More...
 
typedef std::vector< DataIndexDataIndices
 Definition of a vector holding indices to the data object. More...
 

Public Member Functions

 Data ()=default
 Creates a new empty data object. More...
 
 Data (const Observation *observations, const size_t numberObservations, const bool copyObservations=false)
 Creates a new data object by observations lying in a joined memory block as array. More...
 
 Data (Data< T, tDimension > &&data) noexcept
 Move constructor for an data object. More...
 
const Observationobservation (const DataIndex &dataIndex) const
 Returns one specific observation of this data object specified by the data-index of this observation. More...
 
size_t numberObservations () const
 Returns the number of observations that are stored by this data object. More...
 
bool isValidDataIndex (const DataIndex &dataIndex) const
 Returns whether a given data-index is valid and has a corresponding observation stored in this data object. More...
 
const Observationoperator[] (const DataIndex &dataIndex) const
 Returns one specific observation of this data object specified by the data-index of this observation. More...
 
Data< T, tDimension > & operator= (Data< T, tDimension > &&data) noexcept
 Move operator. More...
 
 operator bool () const
 Returns whether this data object holds at least one observation. More...
 
 Data ()=default
 Creates a new empty data object. More...
 
 Data (const Observation **observationPointers, const size_t numberObservations, const bool copyPointers=false)
 Creates a new data object by observations lying at individual memory positions. More...
 
 Data (Data< T, tDimension > &&data) noexcept
 Move constructor for an data object. More...
 
const Observationobservation (const DataIndex &dataIndex) const
 Returns one specific observation of this data object specified by the data-index of this observation. More...
 
size_t numberObservations () const
 Returns the number of observations that are stored by this data object. More...
 
bool isValidDataIndex (const DataIndex &dataIndex) const
 Returns whether a given data-index is valid and has a corresponding observation stored in this data object. More...
 
const Observationoperator[] (const DataIndex &dataIndex) const
 Returns one specific observation of this data object specified by the data-index of this observation. More...
 
Data< T, tDimension > & operator= (Data< T, tDimension > &&data) noexcept
 Move operator. More...
 
 operator bool () const
 Returns whether this data object holds at least one observation. More...
 
 Data (const Observation *observations, const size_t numberObservations, const bool copyObservations)
 
 Data (Data< T, tDimension > &&data) noexcept
 
const Clustering< true >::Data< T, tDimension >::Observationobservation (const DataIndex &dataIndex) const
 
size_t numberObservations () const
 
bool isValidDataIndex (const DataIndex &dataIndex) const
 
const Clustering< true >::Data< T, tDimension >::Observationoperator[] (const DataIndex &dataIndex) const
 
Clustering< true >::Data< T, tDimension > & operator= (Data< T, tDimension > &&data) noexcept
 
 operator bool () const
 
 Data (const Observation **observationPointers, const size_t numberObservations, const bool copyPointers)
 
 Data (Data< T, tDimension > &&data) noexcept
 
const Clustering< false >::Data< T, tDimension >::Observationobservation (const DataIndex &dataIndex) const
 
size_t numberObservations () const
 
bool isValidDataIndex (const DataIndex &dataIndex) const
 
const Clustering< false >::Data< T, tDimension >::Observationoperator[] (const DataIndex &dataIndex) const
 
Clustering< false >::Data< T, tDimension > & operator= (Data< T, tDimension > &&data) noexcept
 
 operator bool () const
 

Protected Attributes

std::vector< ObservationcopyObservations_
 The optional observations that are stored as copy. More...
 
const Observationobservations_ = nullptr
 The observation objects of this data object. More...
 
size_t numberObservations_ = 0
 The number of observation elements of this data object. More...
 
std::vector< const Observation * > copyObservationPointers_
 The optional observation pointers that are stored as copy. More...
 
const Observation ** observationPointers_ = nullptr
 The observation pointers of this data object. More...
 

Detailed Description

template<bool tUseIndices>
template<typename T, size_t tDimension>
class Ocean::Clustering< tUseIndices >::Data< T, tDimension >

This class implements the abstract data object which will be specialized for both data modes toggled by tUseIndices.

Specialization for Clustering<true>::Data<T, tDimension>.

Template Parameters
TThe data type of each element of an observation
tDimensionThe dimension of each observation (the number of elements in each observation), with range [1, infinity)

This data class implements the first data mode of the clustering class identifying observations by their indices.

Template Parameters
TThe data type of each element of an observation
tDimensionThe dimension of each observation (the number of elements in each observation), with range [1, infinity)

This data class implements the second data mode of the clustering class identifying observations by their pointers.

Template Parameters
TThe data type of each element of an observation
tDimensionThe dimension of each observation (the number of elements in each observation), with range [1, infinity)

Member Typedef Documentation

◆ DataIndex [1/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef size_t Ocean::Clustering< tUseIndices >::Data< T, tDimension >::DataIndex

Definition of an index that addresses one specific observation element in the data object that stores all observations.

◆ DataIndex [2/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef size_t Ocean::Clustering< tUseIndices >::Data< T, tDimension >::DataIndex

Definition of an index that addresses one specific observation element in the data object that stores all observations.

◆ DataIndices [1/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef std::vector<DataIndex> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::DataIndices

Definition of a vector holding indices to the data object.

◆ DataIndices [2/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef std::vector<DataIndex> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::DataIndices

Definition of a vector holding indices to the data object.

◆ Observation [1/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef StaticBuffer<T, tDimension> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Observation

Definition of an observation object.

◆ Observation [2/2]

template<bool tUseIndices>
template<typename T , size_t tDimension>
typedef StaticBuffer<T, tDimension> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Observation

Definition of an observation object.

Constructor & Destructor Documentation

◆ Data() [1/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( )
default

Creates a new empty data object.

◆ Data() [2/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( const Observation observations,
const size_t  numberObservations,
const bool  copyObservations = false 
)

Creates a new data object by observations lying in a joined memory block as array.

Due to performance issues: The given observations can be copied or used directly without any memory copy.
Beware: If no copy of the observations is created, the given observations must exist as long as this data object (or the corresponding clustering object) exists.

Parameters
observationsThe first observation in the given joined memory block
numberObservationsThe number of observations that are provided, with range [1, infinity)
copyObservationsTrue, to copy the given observations; False, to simply use the given observations as reference

◆ Data() [3/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( Data< T, tDimension > &&  data)
inlinenoexcept

Move constructor for an data object.

Parameters
dataThe data object to be moved

◆ Data() [4/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( )
default

Creates a new empty data object.

◆ Data() [5/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( const Observation **  observationPointers,
const size_t  numberObservations,
const bool  copyPointers = false 
)

Creates a new data object by observations lying at individual memory positions.

Due to performance issues: The given observation !pointers! can be copied or used directly without any copy.
Beware: If no copy of the observation pointers is created, the given observation pointers must exist as long as this data object (or the corresponding clustering object) exists.
Beware: In any case, the observations (not the pointers) must exist as long as this data object (or the corresponding clustering object) exists.

Parameters
observationPointersThe first pointer of the observations
numberObservationsThe number of observations/pointers that are provided, with range [1, infinity)
copyPointersTrue, to copy the given observation pointers (not the observations); False, to simply use the given observation pointers as reference

◆ Data() [6/10]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::Data ( Data< T, tDimension > &&  data)
inlinenoexcept

Move constructor for an data object.

Parameters
dataThe data object to be moved

◆ Data() [7/10]

Ocean::Clustering::Data< T, tDimension >::Data ( const Observation observations,
const size_t  numberObservations,
const bool  copyObservations 
)

◆ Data() [8/10]

Ocean::Clustering::Data< T, tDimension >::Data ( Data< T, tDimension > &&  data)
inlinenoexcept

◆ Data() [9/10]

Ocean::Clustering::Data< T, tDimension >::Data ( const Observation **  observationPointers,
const size_t  numberObservations,
const bool  copyPointers 
)

◆ Data() [10/10]

Ocean::Clustering::Data< T, tDimension >::Data ( Data< T, tDimension > &&  data)
inlinenoexcept

Member Function Documentation

◆ isValidDataIndex() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
bool Ocean::Clustering< tUseIndices >::Data< T, tDimension >::isValidDataIndex ( const DataIndex dataIndex) const
inline

Returns whether a given data-index is valid and has a corresponding observation stored in this data object.

Parameters
dataIndexThe data-index that will be checked
Returns
True, if so

◆ isValidDataIndex() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
bool Ocean::Clustering< tUseIndices >::Data< T, tDimension >::isValidDataIndex ( const DataIndex dataIndex) const
inline

Returns whether a given data-index is valid and has a corresponding observation stored in this data object.

Parameters
dataIndexThe data-index that will be checked
Returns
True, if so

◆ isValidDataIndex() [3/4]

bool Ocean::Clustering::Data< T, tDimension >::isValidDataIndex ( const DataIndex dataIndex) const
inline

◆ isValidDataIndex() [4/4]

bool Ocean::Clustering::Data< T, tDimension >::isValidDataIndex ( const DataIndex dataIndex) const
inline

◆ numberObservations() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
size_t Ocean::Clustering< tUseIndices >::Data< T, tDimension >::numberObservations ( ) const
inline

Returns the number of observations that are stored by this data object.

Returns
Number of observations

◆ numberObservations() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
size_t Ocean::Clustering< tUseIndices >::Data< T, tDimension >::numberObservations ( ) const
inline

Returns the number of observations that are stored by this data object.

Returns
Number of observations

◆ numberObservations() [3/4]

size_t Ocean::Clustering::Data< T, tDimension >::numberObservations ( ) const
inline

◆ numberObservations() [4/4]

size_t Ocean::Clustering::Data< T, tDimension >::numberObservations ( ) const
inline

◆ observation() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::observation ( const DataIndex dataIndex) const
inline

Returns one specific observation of this data object specified by the data-index of this observation.

Parameters
dataIndexThe data-index of the observation that will be returned, ensure that the given data-index is valid
Returns
The specified observation
See also
isValidDataIndex().

◆ observation() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::observation ( const DataIndex dataIndex) const
inline

Returns one specific observation of this data object specified by the data-index of this observation.

Parameters
dataIndexThe data-index of the observation that will be returned, ensure that the given data-index is valid
Returns
The specified observation
See also
isValidDataIndex().

◆ observation() [3/4]

const Clustering< true >::Data< T, tDimension >::Observation & Ocean::Clustering::Data< T, tDimension >::observation ( const DataIndex dataIndex) const
inline

◆ observation() [4/4]

const Clustering< false >::Data< T, tDimension >::Observation & Ocean::Clustering::Data< T, tDimension >::observation ( const DataIndex dataIndex) const
inline

◆ operator bool() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator bool ( ) const
inlineexplicit

Returns whether this data object holds at least one observation.

Returns
True, if so

◆ operator bool() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator bool ( ) const
inlineexplicit

Returns whether this data object holds at least one observation.

Returns
True, if so

◆ operator bool() [3/4]

Ocean::Clustering::Data< T, tDimension >::operator bool ( ) const
inline

◆ operator bool() [4/4]

Ocean::Clustering::Data< T, tDimension >::operator bool ( ) const
inline

◆ operator=() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Data<T, tDimension>& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator= ( Data< T, tDimension > &&  data)
inlinenoexcept

Move operator.

Parameters
dataThe data object that will be moved to this object.
Returns
Reference to this object.

◆ operator=() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
Data<T, tDimension>& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator= ( Data< T, tDimension > &&  data)
inlinenoexcept

Move operator.

Parameters
dataThe data object that will be moved to this object.
Returns
Reference to this object.

◆ operator=() [3/4]

Clustering< true >::Data< T, tDimension > & Ocean::Clustering::Data< T, tDimension >::operator= ( Data< T, tDimension > &&  data)
inlinenoexcept

◆ operator=() [4/4]

Clustering< false >::Data< T, tDimension > & Ocean::Clustering::Data< T, tDimension >::operator= ( Data< T, tDimension > &&  data)
inlinenoexcept

◆ operator[]() [1/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator[] ( const DataIndex dataIndex) const
inline

Returns one specific observation of this data object specified by the data-index of this observation.

Parameters
dataIndexThe data-index of the observation that will be returned, ensure that the given data-index is valid
Returns
The specified observation
See also
isValidDataIndex(), observation()..

◆ operator[]() [2/4]

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation& Ocean::Clustering< tUseIndices >::Data< T, tDimension >::operator[] ( const DataIndex dataIndex) const
inline

Returns one specific observation of this data object specified by the data-index of this observation.

Parameters
dataIndexThe data-index of the observation that will be returned, ensure that the given data-index is valid
Returns
The specified observation
See also
isValidDataIndex(), observation()..

◆ operator[]() [3/4]

const Clustering< true >::Data< T, tDimension >::Observation & Ocean::Clustering::Data< T, tDimension >::operator[] ( const DataIndex dataIndex) const
inline

◆ operator[]() [4/4]

const Clustering< false >::Data< T, tDimension >::Observation & Ocean::Clustering::Data< T, tDimension >::operator[] ( const DataIndex dataIndex) const
inline

Field Documentation

◆ copyObservationPointers_

template<bool tUseIndices>
template<typename T , size_t tDimension>
std::vector<const Observation*> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::copyObservationPointers_
protected

The optional observation pointers that are stored as copy.

◆ copyObservations_

template<bool tUseIndices>
template<typename T , size_t tDimension>
std::vector<Observation> Ocean::Clustering< tUseIndices >::Data< T, tDimension >::copyObservations_
protected

The optional observations that are stored as copy.

◆ numberObservations_

template<bool tUseIndices>
template<typename T , size_t tDimension>
size_t Ocean::Clustering< tUseIndices >::Data< T, tDimension >::numberObservations_ = 0
protected

The number of observation elements of this data object.

◆ observationPointers_

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation** Ocean::Clustering< tUseIndices >::Data< T, tDimension >::observationPointers_ = nullptr
protected

The observation pointers of this data object.

◆ observations_

template<bool tUseIndices>
template<typename T , size_t tDimension>
const Observation* Ocean::Clustering< tUseIndices >::Data< T, tDimension >::observations_ = nullptr
protected

The observation objects of this data object.


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