STK++ 0.9.13
STK::IMixtureInit Class Referenceabstract

Interface base class for the initializations. More...

#include <STK_IMixtureInit.h>

Inheritance diagram for STK::IMixtureInit:
Inheritance graph

Public Member Functions

virtual ~IMixtureInit ()
 destructor
 
virtual IMixtureInitclone () const =0
 clone pattern
 
IMixtureAlgo const *const p_initAlgo () const
 set a the number of try
 
int nbTry () const
 
void setNbTry (int nbTry)
 set a the number of try
 
void setModel (IMixtureComposer *p_model)
 set a new model
 
void setInitAlgo (IMixtureAlgo *p_initAlgo)
 set the initial algorithm

 
- Public Member Functions inherited from STK::IRunnerBase
String consterror () const
 get the last error message.
 
virtual bool run ()=0
 run the computations.
 

Protected Member Functions

 IMixtureInit ()
 default constructor
 
 IMixtureInit (IMixtureInit const &init)
 copy constructor.
 
bool runInitAlgo ()
 launch the initialization algorithm.
 
- Protected Member Functions inherited from STK::IRunnerBase
 IRunnerBase ()
 default constructor
 
 IRunnerBase (IRunnerBase const &runner)
 copy constructor
 
virtual ~IRunnerBase ()
 destructor
 
virtual void update ()
 update the runner.
 

Protected Attributes

int nbTry_
 number of retry in initialization
 
IMixtureComposerp_model_
 pointer on the mixture model
 
IMixtureAlgop_initAlgo_
 algorithm to use in the initialization
 
- Protected Attributes inherited from STK::IRunnerBase
String msg_error_
 String with the last error message.
 
bool hasRun_
 true if run has been used, false otherwise
 

Detailed Description

Interface base class for the initializations.

All derived class will apply on a model instance and have to implement the run method. An initialization determine in some way values for the parameters of the mixture and perform a given number of iterations of the SEM algorithm.

Definition at line 55 of file STK_IMixtureInit.h.

Constructor & Destructor Documentation

◆ IMixtureInit() [1/2]

STK::IMixtureInit::IMixtureInit ( )
inlineprotected

default constructor

Definition at line 59 of file STK_IMixtureInit.h.

IMixtureComposer * p_model_
pointer on the mixture model
IMixtureAlgo * p_initAlgo_
algorithm to use in the initialization
int nbTry_
number of retry in initialization
IRunnerBase()
default constructor
Definition STK_IRunner.h:68
const int defaultNbInit
Default number of initializations to perform.

◆ IMixtureInit() [2/2]

STK::IMixtureInit::IMixtureInit ( IMixtureInit const init)
inlineprotected

copy constructor.

Parameters
initthe initializing method to copy

Definition at line 63 of file STK_IMixtureInit.h.

64 : IRunnerBase(init), nbTry_(init.nbTry_), p_model_(init.p_model_), p_initAlgo_(init.p_initAlgo_)
65 {}

◆ ~IMixtureInit()

STK::IMixtureInit::~IMixtureInit ( )
virtual

destructor

Definition at line 49 of file STK_MixtureInit.cpp.

50{ if (p_initAlgo_) delete p_initAlgo_;}

References p_initAlgo_.

Member Function Documentation

◆ clone()

virtual IMixtureInit * STK::IMixtureInit::clone ( ) const
pure virtual

clone pattern

Implemented in STK::RandomInit, STK::ClassInit, and STK::FuzzyInit.

◆ nbTry()

int STK::IMixtureInit::nbTry ( ) const
inline
Returns
the number of try

Definition at line 75 of file STK_IMixtureInit.h.

75{ return nbTry_; }

References nbTry_.

Referenced by setNbTry().

◆ p_initAlgo()

IMixtureAlgo const *const STK::IMixtureInit::p_initAlgo ( ) const
inline

set a the number of try

Definition at line 73 of file STK_IMixtureInit.h.

73{ return p_initAlgo_;}

References p_initAlgo_.

Referenced by runInitAlgo(), and setInitAlgo().

◆ runInitAlgo()

bool STK::IMixtureInit::runInitAlgo ( )
protected

launch the initialization algorithm.

Returns
true if there is no initialization algorithm, otherwise return the result of the initialization algorithm.

Definition at line 53 of file STK_MixtureInit.cpp.

54{
55 if (p_initAlgo_)
56 {
58 return (p_initAlgo_->run());
59 }
61 return false;
62}
#define STKERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:49
virtual bool run()
run the initialization by calling the randomClassInit method of the model.
void setModel(IMixtureComposer *p_model)
set model
IMixtureAlgo const *const p_initAlgo() const
set a the number of try
String msg_error_
String with the last error message.
Definition STK_IRunner.h:96
virtual bool run()=0
run the computations.

References STK::IRunnerBase::msg_error_, p_initAlgo(), p_initAlgo_, p_model_, STK::ClassInit::run(), STK::IRunnerBase::run(), STK::IMixtureAlgo::setModel(), and STKERROR_NO_ARG.

Referenced by STK::RandomInit::run(), STK::ClassInit::run(), and STK::FuzzyInit::run().

◆ setInitAlgo()

void STK::IMixtureInit::setInitAlgo ( IMixtureAlgo p_initAlgo)
inline

set the initial algorithm

Definition at line 81 of file STK_IMixtureInit.h.

References p_initAlgo(), and p_initAlgo_.

◆ setModel()

void STK::IMixtureInit::setModel ( IMixtureComposer p_model)
inline

set a new model

Definition at line 79 of file STK_IMixtureInit.h.

79{ p_model_ = p_model; }

References p_model_.

Referenced by STK::FullStrategy::initStep(), STK::SimpleStrategy::run(), and STK::XemStrategy::run().

◆ setNbTry()

void STK::IMixtureInit::setNbTry ( int  nbTry)
inline

set a the number of try

Definition at line 77 of file STK_IMixtureInit.h.

77{ nbTry_ = nbTry; }

References nbTry(), and nbTry_.

Member Data Documentation

◆ nbTry_

int STK::IMixtureInit::nbTry_
protected

number of retry in initialization

Definition at line 85 of file STK_IMixtureInit.h.

Referenced by nbTry(), STK::RandomInit::run(), STK::ClassInit::run(), STK::FuzzyInit::run(), and setNbTry().

◆ p_initAlgo_

IMixtureAlgo* STK::IMixtureInit::p_initAlgo_
protected

algorithm to use in the initialization

Definition at line 89 of file STK_IMixtureInit.h.

Referenced by p_initAlgo(), STK::RandomInit::run(), STK::ClassInit::run(), STK::FuzzyInit::run(), runInitAlgo(), setInitAlgo(), and ~IMixtureInit().

◆ p_model_

IMixtureComposer* STK::IMixtureInit::p_model_
protected

pointer on the mixture model

Definition at line 87 of file STK_IMixtureInit.h.

Referenced by STK::RandomInit::run(), STK::ClassInit::run(), STK::FuzzyInit::run(), runInitAlgo(), and setModel().


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