Documentation of Johannes Lampel's SOMSim

qSOM2d

nVec

SOMPattern


class DllExport qSOM2d
public:
qSOM2d(); ctor
~qSOM2d(); dtor
int SetSize(long,long,long); set size of map (Dim of Input,x,y) -> x=y isn't too useful
int InitWeights(InitType); ...
int SetInput(double *); copies input into local class storage
double Categorize(void); cats input
double Categorize(double*); like the two above
double CategorizeFast(void); cats faster cause it neglects some (!) neurons
double CategorizeFast(double*); ...
void GetWinner(long &,long &); finds 'nearest' neuron
double *GetNWeights(long,long); return the weight matrix of one neuron
double GetDistP(void); return stiffness param
void SetDistP(double); ...
double GetLRate(void); return lRate
void SetLRate(double); ...
void SetNKFunction(double (*name)(const double&,const double&)); sets the pointer to the NK functions, which is set to fNKgauss1 by default
void *GetNKFunction(void); ..
void Save(const char *); savin' data to file
void Load(const char *); loadin' data from file to mem
protected:
long lXSize,lYSize,lNNeurons;...
long lRow; lXSize * lNNeurons
double *dp3Weights; field of weights
double *dp1Input; input to be categorized or tested
double dLearnrate; ...
double dDistanceP; stiffness param
char *szVersion; Just some information about this simulator
double (*fNK)(const double&,const double&); pointer to NK function
nVec *pVDiff; diff (updated by calling cat) between Input and Winner
private:

back to title
class DllExport nVec
friend nVec operator *(double,nVec&);
friend class SOMPattern;
public:
nVec();ctor
nVec(const dim_c);ctor
nVec(const dim_c,const double * const);ctor
nVec(const nVec &);ctor
virtual ~nVec();dtor
double Length(void); ...
int Normalize(void); ...
int GetVec(double *); copy data from field into this class
int SetMemVec(double *); set ddpDim to Param and iType to nVT_mem - be careful, you havn't a copy of this data, your changing the original data
int ConvMemtoCopy(void); convert a Mem - typed instance of this class to a instance, which contains a copy of this data items - alloc mem and copy
int SetVec(double *); copy data from class to field
double SQuadr(void); return sum of all quadrs of comps
int SetNumDim(const dim_c);
virtual const nVec & operator = (const nVec &); ...
virtual const nVec & operator +=(const nVec &); ...
virtual const nVec & operator -=(const nVec &); ...
virtual const nVec & operator *=(const double); ...
virtual const nVec & operator /=(const double); ...
virtual nVec operator +(const nVec &); ...
virtual nVec operator -(const nVec &); ...
virtual nVec operator *(const double); ...
virtual nVec operator /(const double); ...
virtual double & operator [](long); return value of [dimension] component
protected:
double *ppdDim; data items
long lCDim; number of dimensions
int iType; copy data or set pointer to data
private:

back to title
class DllExport SOMPattern
public:
SOMPattern(const dim_c); ctor
~SOMPattern(); dtor
int SetMaxPatternNum(const long); max Number of Pattern - not yet able to copy data from old array to new and no dynamic alloc
long AddPattern(const double *); ...
long AddPattern(const nVec &); ... (-> calling AddPattern(const double *)
int SetSOM(qSOM2d *); setting som to be trained
int TeachEpoch(const double&,const double&); Teaching a full number of pattern and storing the errors ( return values of qSOM2d :: Categorize ) in a pattern related variable
int TeachEpochFast(const double &,const double &); same as above, only using qSOM2d::CategorizeFast
protected:
SOMPatternElem *pFPattern; Field of PatternElem instances with static size
long lPDimNum; Number of dimensions of every Pattern
long lPNum; Number of pattern
long lActPPos; Actual position of last elem ( lActPPos - 1 )
qSOM2d * SActSOM; som to be trained
private:

back to title