AURobotServers  4
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
UFuzzySplit Class Reference

#include <ufuzzysplit.h>

Public Member Functions

bool addElement (UFuzzyElement *elem)
 
bool classify (int clusters, double stopVal, int maxLoopCnt, bool initialize)
 
bool classifyOld (int clusters, double stopVal, int maxLoopCnt)
 
void clear ()
 
void countMembers ()
 
UFuzzyElementgetElement (int index)
 
UMatrixgetF (int clust)
 
int getMembCount (int clust)
 
UMatrixgetV (int clust)
 
bool initFromValues (int clust, int inx, int idxCnt)
 
 UFuzzySplit ()
 
int updateElement (UFuzzyElement *elem, int clustCnt)
 
 ~UFuzzySplit ()
 

Protected Member Functions

bool getCenter (int clust, double m, UFuzzyElement **e, int eCnt, UMatrix *pmV)
 
bool getCovariance (int clust, double m, UFuzzyElement **e, int eCnt, UMatrix *pmF, UMatrix *pmV, UMatrix *pmAi)
 

Protected Attributes

int clustCnt
 
int elemClust [MAX_CLUSTER_CNT]
 
UFuzzyElementelems [MAX_ELEMENTS]
 
int elemsCnt
 
UMatrix4 mAi [MAX_CLUSTER_CNT]
 
UMatrix4 mF [MAX_CLUSTER_CNT]
 
UMatrix4 mV [MAX_CLUSTER_CNT]
 

Static Protected Attributes

static const int MAX_CLUSTER_CNT = 20
 
static const int MAX_ELEMENTS = 100000
 

Detailed Description

Split fuzzy elements into n classes

Author
Christian Andersen

Constructor & Destructor Documentation

UFuzzySplit::UFuzzySplit ( )

Constructor

References clear().

UFuzzySplit::~UFuzzySplit ( )

Destructor

Member Function Documentation

bool UFuzzySplit::addElement ( UFuzzyElement elem)
bool UFuzzySplit::classify ( int  clusters,
double  stopVal,
int  maxLoopCnt,
bool  initialize 
)
bool UFuzzySplit::classifyOld ( int  clusters,
double  stopVal,
int  maxLoopCnt 
)
void UFuzzySplit::clear ( void  )
void UFuzzySplit::countMembers ( )
bool UFuzzySplit::getCenter ( int  clust,
double  m,
UFuzzyElement **  e,
int  eCnt,
UMatrix pmV 
)
protected

Calculate center of cluster if 'clust' = -1, then membership is set to 1.0.

References UMatrix::clear(), elems, elemsCnt, and UMatrix::mult().

Referenced by classify(), getF(), and initFromValues().

bool UFuzzySplit::getCovariance ( int  clust,
double  m,
UFuzzyElement **  e,
int  eCnt,
UMatrix pmF,
UMatrix pmV,
UMatrix pmAi 
)
protected

Calculate new value for covariance matrices. Requires that center is calculated (in pmV) Result is set in pmF and pmAi. Returns true

References UMatrix::add(), UMatrix::clear(), UMatrix::cols(), UMatrix4::det(), UMatrix4::inversed(), UMatrix::mult(), UMatrix::rows(), and UMatrix::setRC().

Referenced by classify(), getF(), and initFromValues().

UFuzzyElement * UFuzzySplit::getElement ( int  index)

Get pointer to an element

References elems, and elemsCnt.

UMatrix* UFuzzySplit::getF ( int  clust)
inline

Get cluster center mvector

References getCenter(), getCovariance(), and mF.

Referenced by UClientFuncImgGui::showUVImage().

int UFuzzySplit::getMembCount ( int  clust)

Get number of members in a group. NB! countMembers must be called first.

References elemClust.

Referenced by classifyOld(), UFuncFz::doClassify(), UClientFuncImgGui::doFuzzyClassify(), testFuzzySplit(), and testFuzzySplit2().

UMatrix* UFuzzySplit::getV ( int  clust)
inline

Get cluster center mvector

References mV.

Referenced by UClientFuncImgGui::showUVImage().

bool UFuzzySplit::initFromValues ( int  clust,
int  inx,
int  idxCnt 
)

Set class center, covariance matrix and from these elements with a common membership value (=0.5)

References elems, elemsCnt, getCenter(), getCovariance(), UFuzzyElement::getVectorSize(), mAi, mF, mV, UFuzzyElement::setMembValue(), and UMatrix::setSize().

Referenced by UClientFuncImgGui::doFuzzyClassify(), UFuncFz::initializeClassesFromLine(), and testFuzzySplit2().

int UFuzzySplit::updateElement ( UFuzzyElement elem,
int  clustCnt 
)

Update this element with distance and membershop value. Returns number of best cluster

References clustCnt, UFuzzyElement::getClass(), mAi, mV, UFuzzyElement::setDistance(), and UFuzzyElement::updateMembValue().

Referenced by UClientFuncImgGui::getPixelClass(), and UFuncFz::getPixelClass().

Member Data Documentation

int UFuzzySplit::clustCnt
protected

Number of requested classes

Referenced by classify(), classifyOld(), countMembers(), and updateElement().

int UFuzzySplit::elemClust[MAX_CLUSTER_CNT]
protected

Number of elements in each cluster

Referenced by countMembers(), and getMembCount().

UFuzzyElement* UFuzzySplit::elems[MAX_ELEMENTS]
protected

Array of pointers to elements to classify

Referenced by addElement(), classify(), classifyOld(), countMembers(), getCenter(), getElement(), and initFromValues().

int UFuzzySplit::elemsCnt
protected
UMatrix4 UFuzzySplit::mAi[MAX_CLUSTER_CNT]
protected

Inverse Mahalanobi matrix values for classes

Referenced by classify(), classifyOld(), initFromValues(), and updateElement().

const int UFuzzySplit::MAX_CLUSTER_CNT = 20
staticprotected

Maximum number of clusters usable

const int UFuzzySplit::MAX_ELEMENTS = 100000
staticprotected

Maximum number of elements to classify

Referenced by addElement().

UMatrix4 UFuzzySplit::mF[MAX_CLUSTER_CNT]
protected

Covariance matrix values for classes

Referenced by classify(), classifyOld(), getF(), and initFromValues().

UMatrix4 UFuzzySplit::mV[MAX_CLUSTER_CNT]
protected

Cluster center

Referenced by classify(), classifyOld(), getV(), initFromValues(), and updateElement().


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