covEstimate< T > Class Template Reference

This method attmepts to estimate eignen values and vectors. More...

#include <VFAT/covEstimate.H>

Collaboration diagram for covEstimate< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 covEstimate (std::vector< std::vector< T > > &_inputSpace, covHolder< T > &_ch)
 Default constructor, call and input pointer to first matrix.
 covEstimate (std::vector< std::vector< T * > > &_inputSpace, covHolder< T > &_ch)
 for backward compatibility
 covEstimate ()
 Default constructor, call and input pointer to first matrix.
 ~covEstimate ()
 Default destructor, call and input pointer to first matrix.
getP (std::vector< T > sample, covHolder< T > &_ch, int stop)
 given the stored covarienc matrix what is the prob. of some point P
getD (std::vector< T > sample, covHolder< T > &_ch, int stop)
 obtain the distance between this point and the mean found in covEstimate
getD (std::vector< T > *point1, std::vector< T > *point2, std::vector< T > *biasSet, bool useGuass)
 obtain the inverse distance between this point and the other
void matchPmean (std::vector< covHolder< T > > *chNew, long sizeNew, std::vector< covHolder< T > > *chOld, long sizeOld, long minSize)
 match clusters from mean values
void matchPmeanAccum (std::vector< covHolder< T > > *ch, unsigned int *sizeCH, std::vector< covHolder< T > > *accum, unsigned int *sizeAccum, long minSize)
 match clusters from mean values
gauss (T X, T mu, T std)
 find the gaussian P for some data
void run ()
 run covestimator with input data
void setNew (std::vector< std::vector< T > > &_inputSpace, bool doResize, covHolder< T > &_ch, T initVal)
 (1a) call to insert new matrix, force (clear) resize if nessesary
void setNew (std::vector< std::vector< T * > > &_inputSpace, bool doResize, covHolder< T > &_ch, T initVal)
 (1a) call to insert new matrix, force (clear) resize if nessesary
void setNew (std::vector< std::vector< T > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize)
 (1a) call to insert new matrix, force (clear) resize if nessesary
void setNew (std::vector< std::vector< T * > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize)
 (1a) call to insert new matrix, force (clear) resize if nessesary
void setNewF (std::vector< std::vector< float * > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize)
 set new, but lets us set a float when T = double etc.
void resize (unsigned int _dimensions, unsigned int _samples, T zero)
 (aux) resize and clear all matrices
void printDebug ()
 (aux) print debugging data
void printEigenVals ()
 (aux) this will return an image slice of the matrix in its current form
Image< float > returnMatrixSlice (int dim1, int dim2, int spaceSize)
Image< float > returnCovSlice (int dim1, int dim2, int spaceSize, bool inorm=false)
 (aux) this shows how the covarience matrix fits over the data
Image< float > returnCovSlice (int dim1, int dim2, Image< float > &img, bool inorm=false)
void dumpMatrix (std::string fileName, int index, std::string ID)
 dump the covMatrix to files, this will append the output to these files
void dumpMatrix (std::string fileName, covHolder< T > &_ch, int index, std::string ID)
 dump the covMatrix to files, this will append the output to these files
unsigned long getSampleSize ()
 return the sample size

Detailed Description

template<class T>
class covEstimate< T >

This method attmepts to estimate eignen values and vectors.

The basic idea behind this class is to estimate a gaussian envolope around some given data but do so by avoiding matrix inversion and multiplicaition. Instead, we estimate values and gain an order of complexity in speed.

Definition at line 64 of file covEstimate.H.


Constructor & Destructor Documentation

template<class T>
covEstimate< T >::covEstimate ( std::vector< std::vector< T > > &  _inputSpace,
covHolder< T > &  _ch 
) [inline]

Default constructor, call and input pointer to first matrix.

Definition at line 57 of file covEstimate.C.

References covEstimate< T >::setNew().

template<class T>
covEstimate< T >::covEstimate ( std::vector< std::vector< T * > > &  _inputSpace,
covHolder< T > &  _ch 
) [inline]

for backward compatibility

Definition at line 68 of file covEstimate.C.

References covEstimate< T >::setNew().

template<class T>
covEstimate< T >::covEstimate (  )  [inline]

Default constructor, call and input pointer to first matrix.

Definition at line 79 of file covEstimate.C.

template<class T >
covEstimate< T >::~covEstimate (  )  [inline]

Default destructor, call and input pointer to first matrix.

Definition at line 86 of file covEstimate.C.


Member Function Documentation

template<class T>
void covEstimate< T >::dumpMatrix ( std::string  fileName,
covHolder< T > &  _ch,
int  index,
std::string  ID 
) [inline]

dump the covMatrix to files, this will append the output to these files

Definition at line 1345 of file covEstimate.C.

References covEstimate< T >::dumpMatrix().

template<class T >
void covEstimate< T >::dumpMatrix ( std::string  fileName,
int  index,
std::string  ID 
) [inline]

dump the covMatrix to files, this will append the output to these files

Definition at line 1310 of file covEstimate.C.

References vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::eigenVal, vfatTargetInfo< FLOAT >::mean, mean(), covHolder< FLOAT >::meanRatio, and covHolder< FLOAT >::samples.

Referenced by covEstimate< T >::dumpMatrix().

template<class T>
T covEstimate< T >::gauss ( X,
mu,
std 
) [inline]

find the gaussian P for some data

Definition at line 876 of file covEstimate.C.

References exp(), and sqrt().

Referenced by covEstimate< T >::getD(), and covEstimate< T >::getP().

template<class T>
T covEstimate< T >::getD ( std::vector< T > *  point1,
std::vector< T > *  point2,
std::vector< T > *  biasSet,
bool  useGuass 
) [inline]

obtain the inverse distance between this point and the other

Definition at line 527 of file covEstimate.C.

References covEstimate< T >::gauss(), and sqrt().

template<class T>
T covEstimate< T >::getD ( std::vector< T >  sample,
covHolder< T > &  _ch,
int  stop 
) [inline]

obtain the distance between this point and the mean found in covEstimate

Parameters:
sample This a new sample point in the same space as cov matrix

Definition at line 501 of file covEstimate.C.

References ASSERT, vfatTargetInfo< FLOAT >::bias, vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::mean, and sqrt().

Referenced by covEstimate< T >::matchPmeanAccum().

template<class T>
T covEstimate< T >::getP ( std::vector< T >  sample,
covHolder< T > &  _ch,
int  stop 
) [inline]

given the stored covarienc matrix what is the prob. of some point P

Parameters:
sample This a new sample point in the same space as cov matrix
stop How early to stop from end of list in diminsions

Definition at line 400 of file covEstimate.C.

References ASSERT, vfatTargetInfo< FLOAT >::bias, vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::eigenVal, covEstimate< T >::gauss(), vfatTargetInfo< FLOAT >::mean, covHolder< FLOAT >::meanTheta, covHolder< FLOAT >::samples, and sqrt().

template<class T >
unsigned long covEstimate< T >::getSampleSize (  )  [inline]

return the sample size

Definition at line 1355 of file covEstimate.C.

template<class T>
void covEstimate< T >::matchPmean ( std::vector< covHolder< T > > *  chNew,
long  sizeNew,
std::vector< covHolder< T > > *  chOld,
long  sizeOld,
long  minSize 
)

match clusters from mean values

This will take in a set of mean values about each cluster and match clusters from one set to clusters in another set based upon mean values.

Parameters:
ch1 this is a list of covHolders for set 1
size1 this is the size of the first list
ch2 this is a list of covHolders for set 2
size2 this is the size of the second list
template<class T>
void covEstimate< T >::matchPmeanAccum ( std::vector< covHolder< T > > *  ch,
unsigned int *  sizeCH,
std::vector< covHolder< T > > *  accum,
unsigned int *  sizeAccum,
long  minSize 
) [inline]

match clusters from mean values

This will take in a set of mean values about each cluster and match clusters from one set to clusters in another set based upon mean values. This one accumulates Classes.

Parameters:
ch1 this is a list of covHolders for set 1
size1 this is the size of the first list
ch2 this is a list of covHolders for set 2
size2 this is the size of the second list

Definition at line 718 of file covEstimate.C.

References covEstimate< T >::getD().

template<class T >
void covEstimate< T >::printDebug (  )  [inline]
template<class T >
void covEstimate< T >::printEigenVals (  )  [inline]

(aux) this will return an image slice of the matrix in its current form

This takes a 2D snapshot of the space along the two dimensions provided

Parameters:
spaceSize,this is the "size" of the image to be returned as a square of size X x X

Definition at line 1088 of file covEstimate.C.

References vfatTargetInfo< FLOAT >::eigenVal, and covHolder< FLOAT >::meanRatio.

template<class T>
void covEstimate< T >::resize ( unsigned int  _dimensions,
unsigned int  _samples,
zero 
) [inline]

(aux) resize and clear all matrices

this should not be called directly, but may if you wish

Parameters:
dimensions This is the dimension of the input matrix
samples This is the number of samples taken
zero This is what value you would like to set all elements to

Definition at line 1010 of file covEstimate.C.

Referenced by covEstimate< T >::setNew(), and covEstimate< T >::setNewF().

template<class T >
Image< float > covEstimate< T >::returnCovSlice ( int  dim1,
int  dim2,
int  spaceSize,
bool  inorm = false 
) [inline]

(aux) this shows how the covarience matrix fits over the data

Definition at line 1140 of file covEstimate.C.

References Image< T >::resize().

Referenced by main().

template<class T >
void covEstimate< T >::run (  )  [inline]

run covestimator with input data

Definition at line 885 of file covEstimate.C.

Referenced by main().

template<class T>
void covEstimate< T >::setNew ( std::vector< std::vector< T * > > &  _inputSpace,
initVal,
int  samples,
int  dim,
covHolder< T > &  _ch,
bool  _resize = false 
) [inline]

(1a) call to insert new matrix, force (clear) resize if nessesary

Definition at line 964 of file covEstimate.C.

References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.

template<class T>
void covEstimate< T >::setNew ( std::vector< std::vector< T > > &  _inputSpace,
initVal,
int  samples,
int  dim,
covHolder< T > &  _ch,
bool  _resize = false 
) [inline]

(1a) call to insert new matrix, force (clear) resize if nessesary

Definition at line 943 of file covEstimate.C.

References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.

template<class T>
void covEstimate< T >::setNew ( std::vector< std::vector< T * > > &  _inputSpace,
bool  doResize,
covHolder< T > &  _ch,
initVal 
) [inline]

(1a) call to insert new matrix, force (clear) resize if nessesary

Definition at line 922 of file covEstimate.C.

References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.

template<class T>
void covEstimate< T >::setNew ( std::vector< std::vector< T > > &  _inputSpace,
bool  doResize,
covHolder< T > &  _ch,
initVal 
) [inline]

(1a) call to insert new matrix, force (clear) resize if nessesary

Definition at line 901 of file covEstimate.C.

References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.

Referenced by covEstimate< T >::covEstimate().

template<class T>
void covEstimate< T >::setNewF ( std::vector< std::vector< float * > > &  _inputSpace,
initVal,
int  samples,
int  dim,
covHolder< T > &  _ch,
bool  _resize = false 
) [inline]

set new, but lets us set a float when T = double etc.

Definition at line 987 of file covEstimate.C.

References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:18 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3