STK++ 0.9.13
|
Interface base class for mixture managers. More...
#include <STK_IMixtureManager.h>
Public Types | |
typedef hidden::MixtureManagerTraits< Derived >::DataHandler | DataHandler |
typedef hidden::MixtureManagerTraits< Derived >::Type | Type |
typedef hidden::MixtureManagerTraits< Derived >::MissingIndexes | MissingIndexes |
typedef hidden::MixtureManagerTraits< Derived >::MissingValues | MissingValues |
typedef hidden::MixtureManagerTraits< Derived >::Data | Data |
typedef hidden::MixtureManagerTraits< Derived >::DataBridgeType | DataBridgeType |
Public Member Functions | |
IMixtureManager (DataHandler const *const p_handler) | |
Default constructor, need an instance of a DataHandler. | |
~IMixtureManager () | |
destructor | |
DataHandler const *const | p_handler () const |
Clust::Mixture | getIdModel (String const &idData) const |
Utility function allowing to find the idModel from the idData. | |
String | getIdModelName (String const &idData) const |
Utility function allowing to find the idModel name from the idData. | |
IMixture * | createMixture (String const &idData, int nbCluster) |
create a mixture and initialize it. | |
void | registerDataBridge (IDataBridge *p_data) |
register a data bridge to the IMixtureManager. | |
void | releaseDataBridge (String const &idData) |
release a data bridge from v_data_. | |
Data const & | getData (String const &idData) const |
get the wrapper for any kind of data set using its Id | |
void | getMissingValues (IMixture *p_mixture, MissingValues &missing) const |
get the missing values | |
void | getParameters (IMixture *p_mixture, ArrayXX &data) const |
get the parameters from an IMixture. | |
void | setParameters (IMixture *p_mixture, ArrayXX const &data) const |
set the parameters from an IMixture. | |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Member Functions | |
IDataBridge * | getDataBridge (String const &idData) const |
Utility lookup function allowing to find a DataBridge from its idData. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Private Member Functions | |
IMixture * | createMixture (String const &modelName, String const &idData, int nbCluster) |
create a concrete mixture and initialize it. | |
Private Attributes | |
DataHandler const *const | p_handler_ |
A pointer on the concrete instance of the data handler. | |
std::vector< IDataBridge * > | v_data_ |
vector of pointers to the data components | |
Interface base class for mixture managers.
A mixture manager is a factory class for injection dependency in the STK++ derived class of the IMixtureComposer:
The pseudo pure virtual method to implement in derived classes are
Derived | any concrete class derived from this interface |
Definition at line 69 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::Data STK::IMixtureManager< Derived >::Data |
Definition at line 76 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::DataBridgeType STK::IMixtureManager< Derived >::DataBridgeType |
Definition at line 77 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::DataHandler STK::IMixtureManager< Derived >::DataHandler |
Definition at line 72 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::MissingIndexes STK::IMixtureManager< Derived >::MissingIndexes |
Definition at line 74 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::MissingValues STK::IMixtureManager< Derived >::MissingValues |
Definition at line 75 of file STK_IMixtureManager.h.
typedef hidden::MixtureManagerTraits<Derived>::Type STK::IMixtureManager< Derived >::Type |
Definition at line 73 of file STK_IMixtureManager.h.
STK::IMixtureManager< Derived >::IMixtureManager | ( | DataHandler const *const | p_handler | ) |
Default constructor, need an instance of a DataHandler.
Definition at line 191 of file STK_IMixtureManager.h.
STK::IMixtureManager< Derived >::~IMixtureManager | ( | ) |
destructor
Definition at line 196 of file STK_IMixtureManager.h.
IMixture * STK::IMixtureManager< Derived >::createMixture | ( | String const & | idData, |
int | nbCluster | ||
) |
create a mixture and initialize it.
This method get the modelName from the DataHandler and then delegate the concrete creation to derived class using the pseudo pure virtual method createMixture( modelName, idData, nbCluster)
.
idData | name of the model |
nbCluster | number of cluster of the model |
createMixture( modelName, idData, nbCluster)
otherwise. Definition at line 230 of file STK_IMixtureManager.h.
|
inlineprivate |
create a concrete mixture and initialize it.
modelName,idData | strings with the Id name of the model and of the data |
nbCluster | number of cluster of the model |
Definition at line 163 of file STK_IMixtureManager.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
hidden::MixtureManagerTraits< Derived >::Data const & STK::IMixtureManager< Derived >::getData | ( | String const & | idData | ) | const |
get the wrapper for any kind of data set using its Id
idData | Id name of the data set attached to the mixture |
Definition at line 274 of file STK_IMixtureManager.h.
References STK::IMixtureManager< Derived >::getData(), and STKRUNTIME_ERROR_1ARG.
Referenced by STK::IMixtureManager< Derived >::getData().
|
protected |
Utility lookup function allowing to find a DataBridge from its idData.
idData | the id name of the mixture we want to get |
Definition at line 261 of file STK_IMixtureManager.h.
Clust::Mixture STK::IMixtureManager< Derived >::getIdModel | ( | String const & | idData | ) | const |
Utility function allowing to find the idModel from the idData.
idData | the id name of the data we want the idModel |
Definition at line 172 of file STK_IMixtureManager.h.
References _T, stk_cout, STK::Clust::stringToMixture(), and STK::Clust::unknown_mixture_.
String STK::IMixtureManager< Derived >::getIdModelName | ( | String const & | idData | ) | const |
Utility function allowing to find the idModel name from the idData.
idData | the id name of the data we want the idModel |
Definition at line 207 of file STK_IMixtureManager.h.
|
inline |
get the missing values
p_mixture | pointer on the mixture |
missing | array with the indexes and the missing values |
Definition at line 131 of file STK_IMixtureManager.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inline |
get the parameters from an IMixture.
p_mixture | pointer on the mixture |
data | the array to return with the parameters |
Definition at line 137 of file STK_IMixtureManager.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inline |
Definition at line 85 of file STK_IMixtureManager.h.
References STK::IMixtureManager< Derived >::p_handler_.
void STK::IMixtureManager< Derived >::registerDataBridge | ( | IDataBridge * | p_data | ) |
register a data bridge to the IMixtureManager.
For each mixture created and registered, a data bridge is created and registered so that it will be deleted when the mixture itself is deleted.
p_data | a pointer on the data manager |
Definition at line 243 of file STK_IMixtureManager.h.
void STK::IMixtureManager< Derived >::releaseDataBridge | ( | String const & | idData | ) |
release a data bridge from v_data_.
idData | name of the data set to release |
Definition at line 249 of file STK_IMixtureManager.h.
|
inline |
set the parameters from an IMixture.
p_mixture | pointer on the mixture |
data | the array with the parameters to set |
Definition at line 143 of file STK_IMixtureManager.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
private |
A pointer on the concrete instance of the data handler.
Definition at line 155 of file STK_IMixtureManager.h.
Referenced by STK::IMixtureManager< Derived >::p_handler().
|
private |
vector of pointers to the data components
Definition at line 157 of file STK_IMixtureManager.h.