openModeller  Version 1.5.0
CsmBS Class Reference

#include <csmbs.hh>

Inheritance diagram for CsmBS:
Inheritance graph
Collaboration diagram for CsmBS:
Collaboration graph

Public Member Functions

 CsmBS ()
 
 ~CsmBS ()
 
int initialize ()
 
- Public Member Functions inherited from Csm
 Csm (AlgMetadata const *metadata)
 
 ~Csm ()
 
int iterate ()
 
int done () const
 
Scalar getValue (const Sample &x) const
 
int getConvergence (Scalar *const val) const
 
- Public Member Functions inherited from AlgorithmImpl
 AlgorithmImpl (AlgMetadata const *metadata)
 
virtual ~AlgorithmImpl ()
 
void setParameters (int nparam, AlgParameter const *param)
 
void setParameters (const ParamSetType &)
 
std::string const getID () const
 
AlgMetadata const * getMetadata () const
 
AlgorithmPtr getFreshCopy ()
 
virtual int supportsModelProjection () const
 
Model createModel (const SamplerPtr &samp, CallbackWrapper *func=0)
 
void setSampler (const SamplerPtr &samp)
 
virtual int finalize ()
 
virtual float getProgress () const
 
virtual int needNormalization ()
 
NormalizergetNormalizer () const
 
void setNormalization (const SamplerPtr &samp) const
 
void setNormalization (const EnvironmentPtr &env) const
 
virtual Model getModel () const
 
ConfigurationPtr getConfiguration () const
 
void setConfiguration (const ConstConfigurationPtr &)
 
- Public Member Functions inherited from Configurable
virtual ~Configurable ()
 

Protected Member Functions

gsl_matrix * createRandomMatrix (int size1, int size2)
 
gsl_matrix * randomiseColumns (gsl_matrix *original_matrix)
 
int discardComponents ()
 
- Protected Member Functions inherited from Csm
int SamplerToMatrix ()
 
bool csm1 ()
 
int calculateMeanAndSd (gsl_matrix *theMatrix, gsl_vector *theMeanVector, gsl_vector *theStdDevVector)
 
int center ()
 
void displayVector (const gsl_vector *v, const char *name, const bool roundFlag=true) const
 
void displayMatrix (const gsl_matrix *m, const char *name, const bool roundFlag=true) const
 
gsl_matrix * transpose (gsl_matrix *m)
 
double product (gsl_vector *va, gsl_vector *vb) const
 
gsl_matrix * product (gsl_matrix *a, gsl_matrix *b) const
 
gsl_matrix * autoCovariance (gsl_matrix *m)
 
virtual void _getConfiguration (ConfigurationPtr &config) const
 
virtual void _setConfiguration (const ConstConfigurationPtr &config)
 
- Protected Member Functions inherited from AlgorithmImpl
int dimDomain ()
 
int getParameter (std::string const &name, std::string *value)
 
int getParameter (std::string const &name, double *value)
 
int getParameter (std::string const &name, float *value)
 
int getParameter (std::string const &name, int *value)
 

Protected Attributes

float numberOfStdDevsFloat
 
int numberOfRandomisationsInt
 
gsl_rng * _randomNumberGenerator
 
- Protected Attributes inherited from Csm
int _initialized
 
int _done
 
gsl_matrix * _gsl_environment_matrix
 
gsl_matrix * _gsl_covariance_matrix
 
gsl_vector * _gsl_avg_vector
 
gsl_vector * _gsl_stddev_vector
 
gsl_vector * _gsl_eigenvalue_vector
 
gsl_matrix * _gsl_eigenvector_matrix
 
int _layer_count
 
int _retained_components_count
 
int _localityCount
 
int minComponentsInt
 
bool verboseDebuggingBool
 
- Protected Attributes inherited from AlgorithmImpl
SamplerPtr _samp
 
Normalizer_normalizerPtr
 
ParamSetType _param
 

Additional Inherited Members

- Public Types inherited from AlgorithmImpl
typedef std::map< icstring,
std::string > 
ParamSetType
 

Detailed Description

CsmBS = Csm broken-stick cutoff for discarded components

Author
Tim Sutton

Definition at line 42 of file csmbs.hh.

Constructor & Destructor Documentation

CsmBS::CsmBS ( )

Constructor for Csm

Constructor for CsmBS

Parameters
Sampleris class that will fetch environment variable values at each occurrence / locality

Definition at line 170 of file csmbs.cpp.

References Csm::_initialized, and _randomNumberGenerator.

CsmBS::~CsmBS ( )

This is the descructor for the Csm class

Definition at line 184 of file csmbs.cpp.

References _randomNumberGenerator.

Member Function Documentation

gsl_matrix * CsmBS::createRandomMatrix ( int  size1,
int  size2 
)
protected

generate a matrix populated with random numbers between 0 and 1

Definition at line 261 of file csmbs.cpp.

References _randomNumberGenerator.

Referenced by randomiseColumns().

int CsmBS::discardComponents ( )
protectedvirtual

Discard unwanted components. This method uses the broken-stick cutoff.

Note
This method must be called after center
Returns
0 on error

Implements Csm.

Definition at line 318 of file csmbs.cpp.

References Csm::_gsl_eigenvalue_vector, Csm::_gsl_eigenvector_matrix, Csm::_gsl_environment_matrix, Csm::_layer_count, Csm::_retained_components_count, Csm::autoCovariance(), Csm::calculateMeanAndSd(), Log::debug(), Csm::displayMatrix(), Csm::displayVector(), Log::instance(), Csm::minComponentsInt, numberOfRandomisationsInt, numberOfStdDevsFloat, and randomiseColumns().

Here is the call graph for this function:

int CsmBS::initialize ( )
virtual

Initialise the model specifying a threshold / cutoff point. Any model definition building stuff is done here. This is optional (model dependent).

Note
This method is inherited from the Algorithm class
Returns
0 on error

Reimplemented from Csm.

Definition at line 190 of file csmbs.cpp.

References Log::debug(), AlgorithmImpl::getParameter(), Csm::initialize(), Log::instance(), Csm::minComponentsInt, numberOfRandomisationsInt, numberOfStdDevsFloat, Csm::verboseDebuggingBool, and Log::warn().

Here is the call graph for this function:

gsl_matrix * CsmBS::randomiseColumns ( gsl_matrix *  original_matrix)
protected

shuffle / randomise the row ordering in each column

e.g. before: e.g. after 33 | 56 | 88 | 12| 12 | 34 34 | 12 | 63 | 34 | 44 | 63

12 | 44 | 34 | 33 | 56 | 88

Exchanging elements (GSL Documentation)

The following function can be used to exchange, or permute, the elements of a vector. Function: int gsl_vector_swap_elements (gsl_vector * v, size_t i, size_t j) This function exchanges the i-th and j-th elements of the vector v in-place. Function: int gsl_vector_reverse (gsl_vector * v)

This function reverses the order of the elements of the vector v.

Definition at line 278 of file csmbs.cpp.

References createRandomMatrix().

Referenced by discardComponents().

Here is the call graph for this function:

Member Data Documentation

gsl_rng* CsmBS::_randomNumberGenerator
protected

A gsl random number generator for creating randomness randomly...

Definition at line 97 of file csmbs.hh.

Referenced by createRandomMatrix(), CsmBS(), and ~CsmBS().

int CsmBS::numberOfRandomisationsInt
protected

Increase this number to increase randomness of component selection eigen vector

Definition at line 95 of file csmbs.hh.

Referenced by discardComponents(), and initialize().

float CsmBS::numberOfStdDevsFloat
protected

How many standard deviations should be added to the random derived eigenvalues when doing discard components

Definition at line 92 of file csmbs.hh.

Referenced by discardComponents(), and initialize().


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