36#ifndef STK_IMIXTUREMANAGER_H
37#define STK_IMIXTUREMANAGER_H
68template<
class Derived>
138 { this->
asDerived().getParametersImpl(p_mixture, data);}
144 { this->
asDerived().setParametersImpl(p_mixture, data);}
164 {
return this->
asDerived().createMixtureImpl(modelName, idData, nbCluster);}
171template<
class Derived>
175 if (!p_handler()->getIdModelName( idData,
modelName))
177#ifdef STK_MIXTURE_VERY_VERBOSE
178 stk_cout <<
_T(
"In IMixtureManager::getIdModel, fail to get idData = ") << idData <<
_T(
"\n");
182#ifdef STK_MIXTURE_VERY_VERBOSE
183 stk_cout <<
_T(
"In IMixtureManager::getIdModel, success to get idData = ") << idData <<
_T(
"\n");
190template<
class Derived>
192 : p_handler_(p_handler)
195template<
class Derived>
198 typedef std::vector<IDataBridge*>::iterator
DataIterator;
206template<
class Derived>
210 if (!p_handler_->getIdModelName( idData,
modelName))
212#ifdef STK_MIXTURE_VERY_VERBOSE
213 stk_cout <<
_T(
"In IMixtureManager::getIdModelName, fail to get idData = ") << idData <<
_T(
"\n");
216#ifdef STK_MIXTURE_VERY_VERBOSE
217 stk_cout <<
_T(
"In IMixtureManager::getIdModeName, success to get idData = ") << idData <<
_T(
"\n");
229template<
class Derived>
233 if (!p_handler_->getIdModelName( idData,
modelName)) {
return 0;};
234 return createMixture(
modelName, idData, nbCluster);
242template<
class Derived>
244{ v_data_.push_back(p_data);}
248template<
class Derived>
251 typedef std::vector<IDataBridge*>::iterator
DataIterator;
253 {
if ((*it)->idData() == idData) {
delete (*it); v_data_.erase(
it);
break;}}
260template<
class Derived>
265 {
if ((*it)->idData() == idData)
return (*
it);}
273template<
class Derived>
In this file, we define the final class Array2D.
In this file we define the data wrapper class.
define the main interface for linking specific mixture model to the composer.
#define STKRUNTIME_ERROR_1ARG(Where, Arg, Error)
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Interface class wrapping a data set.
Interface base class for mixture managers.
hidden::MixtureManagerTraits< Derived >::MissingIndexes MissingIndexes
void getMissingValues(IMixture *p_mixture, MissingValues &missing) const
get the missing values
Clust::Mixture getIdModel(String const &idData) const
Utility function allowing to find the idModel from the idData.
hidden::MixtureManagerTraits< Derived >::Type Type
hidden::MixtureManagerTraits< Derived >::DataHandler DataHandler
void registerDataBridge(IDataBridge *p_data)
register a data bridge to the IMixtureManager.
Data const & getData(String const &idData) const
get the wrapper for any kind of data set using its Id
IMixtureManager(DataHandler const *const p_handler)
Default constructor, need an instance of a DataHandler.
~IMixtureManager()
destructor
void setParameters(IMixture *p_mixture, ArrayXX const &data) const
set the parameters from an IMixture.
String getIdModelName(String const &idData) const
Utility function allowing to find the idModel name from the idData.
DataHandler const *const p_handler() const
IMixture * createMixture(String const &idData, int nbCluster)
create a mixture and initialize it.
void releaseDataBridge(String const &idData)
release a data bridge from v_data_.
IMixture * createMixture(String const &modelName, String const &idData, int nbCluster)
create a concrete mixture and initialize it.
hidden::MixtureManagerTraits< Derived >::MissingValues MissingValues
hidden::MixtureManagerTraits< Derived >::DataBridgeType DataBridgeType
hidden::MixtureManagerTraits< Derived >::Data Data
IDataBridge * getDataBridge(String const &idData) const
Utility lookup function allowing to find a DataBridge from its idData.
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
void getParameters(IMixture *p_mixture, ArrayXX &data) const
get the parameters from an IMixture.
Interface base class for all the mixture models that will be processed by the composer.
Interface base class for all classes implementing the curious recursive template paradigm.
Derived & asDerived()
static cast : return a reference of this with a cast to the derived class.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Mixture stringToMixture(String const &type)
Convert a String to a Mixture.
Mixture
list of the mixtures that can be used by the composer
std::basic_string< Char > String
STK fundamental type of a String.
The namespace STK is the main domain space of the Statistical ToolKit project.
Main class for the mixture managers traits policy.