STK++ 0.9.13
|
implementation
of the DataHandlerBase class for kernel mixture models.
More...
#include <STK_KernelHandler.h>
Public Types | |
typedef DataHandlerBase< KernelHandler > | Base |
typedef DataHandlerBase< KernelHandler >::InfoMap | InfoMap |
typedef std::pair< Kernel::IKernel *, String > | TaggedKernel |
typedef Array1D< TaggedKernel >::iterator | Iterator |
typedef Array1D< TaggedKernel >::const_iterator | ConstIterator |
![]() | |
typedef std::map< std::string, std::string > | InfoMap |
Public Member Functions | |
KernelHandler () | |
default constructor | |
KernelHandler (Kernel::IKernel *p_kernel, String const &idData, String const &idModel) | |
constructor with an instance of a kernel to handle | |
~KernelHandler () | |
destructor. | |
int | nbSample () const |
bool | addKernel (Kernel::IKernel *p_kernel, String const &idData, String const &idModel) |
add an instance of a kernel to the handler | |
template<class Derived , class Array > | |
bool | addKernel (String const &kernelName, Array const &data, ExprBase< Derived > const ¶m, String const &idData, String const &idModel) |
add an instance of a kernel to the handler | |
Kernel::IKernel const * | getKernel (String const &idData) const |
get an instance of a kernel from the handler | |
void | removeKernel (String const &idData) |
remove an instance of a kernel to the handler | |
bool | isHandled (Kernel::IKernel *const p_kernel) const |
utility lookup function allowing to know if some pointer on a kernel is handled by the KernelHandler. | |
![]() | |
~DataHandlerBase () | |
destructor | |
InfoMap const & | info () const |
bool | addInfo (std::string const &idData, std::string const &idModel) |
Add an info descriptor to the data handler. | |
bool | getIdModelName (std::string const &idData, std::string &idModel) const |
Giving the Id of a data set, find the Id of the model. | |
void | writeInfo (ostream &os) const |
write infoMap on os | |
![]() | |
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 Attributes | |
int | nbSample_ |
Number of sample. | |
Array1D< TaggedKernel > | v_kernel_ |
Array of the kernels. | |
![]() | |
InfoMap | info_ |
Store the informations of the mixtures in the form (idData, idModel) with. | |
Additional Inherited Members | |
![]() | |
DataHandlerBase () | |
default constructor | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
implementation
of the DataHandlerBase class for kernel mixture models.
This class stores the kernels and the idData, allow to add them and to remvoe them.
Definition at line 75 of file STK_KernelHandler.h.
Definition at line 78 of file STK_KernelHandler.h.
typedef Array1D<TaggedKernel>::const_iterator STK::KernelHandler::ConstIterator |
Definition at line 82 of file STK_KernelHandler.h.
Definition at line 79 of file STK_KernelHandler.h.
typedef Array1D<TaggedKernel>::iterator STK::KernelHandler::Iterator |
Definition at line 81 of file STK_KernelHandler.h.
typedef std::pair<Kernel::IKernel*, String> STK::KernelHandler::TaggedKernel |
Definition at line 80 of file STK_KernelHandler.h.
STK::KernelHandler::KernelHandler | ( | ) |
STK::KernelHandler::KernelHandler | ( | Kernel::IKernel * | p_kernel, |
String const & | idData, | ||
String const & | idModel | ||
) |
constructor with an instance of a kernel to handle
Definition at line 43 of file STK_KernelHandler.cpp.
STK::KernelHandler::~KernelHandler | ( | ) |
destructor.
All pointer on kernels will be deleted.
Definition at line 48 of file STK_KernelHandler.cpp.
References STK::ITContainer1D< Derived >::beginIterator(), STK::ITContainer1D< Derived >::endIterator(), isHandled(), and v_kernel_.
bool STK::KernelHandler::addKernel | ( | Kernel::IKernel * | p_kernel, |
String const & | idData, | ||
String const & | idModel | ||
) |
add an instance of a kernel to the handler
p_kernel | an instance of a kernel |
idData | can be any string given by the user for identifying data. |
idModel | represent the idModel of a given model (can be defined inside or outside STK++). |
true
if the pair (idData,idModel) has been successfully added to the handler Definition at line 69 of file STK_KernelHandler.cpp.
References STK::DataHandlerBase< KernelHandler >::addInfo(), STK::ITContainer1D< Derived >::beginConstIterator(), STK::ITContainer1D< Derived >::endConstIterator(), STK::Kernel::IKernel::nbSample(), nbSample_, STK::IArray1D< Derived >::push_back(), and v_kernel_.
bool STK::KernelHandler::addKernel | ( | String const & | kernelName, |
Array const & | data, | ||
ExprBase< Derived > const & | param, | ||
String const & | idData, | ||
String const & | idModel | ||
) |
add an instance of a kernel to the handler
kernelName | name of the kernel |
data | data set associated to the kernel |
param | parameters of the kernel |
idData | can be any string given by the user for identifying data. |
idModel | represent the idModel of a given model (can be defined inside or outside STK++). |
true
if the pair (idData,idModel) has been successfully added to the handler Definition at line 141 of file STK_KernelHandler.h.
References STK::DataHandlerBase< KernelHandler >::addInfo(), STK::ITContainer1D< Derived >::beginIterator(), STK::ITContainer1D< Derived >::endIterator(), STK::Kernel::gaussian_, STK::Kernel::hamming_, STK::Kernel::laplace_, STK::Kernel::linear_, STK::Kernel::IKernel::nbSample(), nbSample_, STK::Kernel::polynomial_, STK::IArray1D< Derived >::push_back(), STK::Kernel::rationalQuadratic_, STK::Kernel::stringToKernelType(), and v_kernel_.
Kernel::IKernel const * STK::KernelHandler::getKernel | ( | String const & | idData | ) | const |
get an instance of a kernel from the handler
idData | can be any string given by the user for identifying data. |
0
if the idData has not been found, a pointer to the kernel otherwise Definition at line 92 of file STK_KernelHandler.cpp.
References STK::ITContainer1D< Derived >::beginConstIterator(), STK::ITContainer1D< Derived >::endConstIterator(), and v_kernel_.
bool STK::KernelHandler::isHandled | ( | Kernel::IKernel *const | p_kernel | ) | const |
utility lookup function allowing to know if some pointer on a kernel is handled by the KernelHandler.
true
if the pointed kernel is found, false
otherwise Definition at line 126 of file STK_KernelHandler.cpp.
References STK::ITContainer1D< Derived >::beginConstIterator(), STK::ITContainer1D< Derived >::endConstIterator(), and v_kernel_.
Referenced by removeKernel(), and ~KernelHandler().
|
inline |
Definition at line 91 of file STK_KernelHandler.h.
References nbSample_.
remove an instance of a kernel to the handler
idData | can be any string given by the user for identifying data. |
Definition at line 105 of file STK_KernelHandler.cpp.
References STK::ITContainer1D< Derived >::beginIterator(), STK::ITContainer1D< Derived >::endIterator(), STK::IArray1D< Derived >::erase(), isHandled(), and v_kernel_.
|
protected |
Number of sample.
Definition at line 135 of file STK_KernelHandler.h.
Referenced by addKernel(), addKernel(), and nbSample().
|
protected |
Array of the kernels.
Definition at line 137 of file STK_KernelHandler.h.
Referenced by addKernel(), addKernel(), getKernel(), isHandled(), removeKernel(), and ~KernelHandler().