Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

DefectPCA Class Reference

Class dedicated to the Principal Components Analysis computation. More...

List of all members.

Public Member Functions

 DefectPCA (const DefectixOptions::Options &options)
 Standard constructor.

void computePCA (gsl_matrix *m, const int nb_pc)
 Compute Principal Components Analysis.

void computePCA (gsl_matrix *m, const int nb_pc, gsl_matrix *evec)
 Compute Principal Components Analysis.

void writeRebuilt (const gsl_matrix_view &evecv, gsl_matrix *m, long axis[2])
 deprecated and unefficient

const gsl_matrix *const  getEigenVectors () const
 Get the KL-Base.

const gsl_vector *const  getEigenValues () const
 Get eigen values.

const gsl_matrix *const  getPrincipalComponents () const
 Get principal components.


Protected Attributes

int _blocSize
 Size of the blocks to create.

int _zoomStep
 Unused for now.

gsl_matrix * _pc
 Principal components.

gsl_matrix * _evec
 Eigen vectors of the covariance matrix (KL-Base).

gsl_vector * _eval
 Eigen values of the covariance matrix.

bool _printEvec
 Ask to save KL-Base.

bool _printRebuilt
 Useless.


Private Member Functions

void setEigenVectors (const gsl_matrix *const m)
 allocate eigen vectors and eigen values

errorCodes eigenVectors (const gsl_matrix *const const_m)
 compute eigen vectors and values

void writeEigenVectors (gsl_matrix *evec)
 Write the KL-Base into files.

void printMessage (const char *msg) const
 Print a message on the standard output.


Detailed Description

Class dedicated to the Principal Components Analysis computation.

The PCA is computed to reduce create input vectors for neural networks.


Constructor & Destructor Documentation

DefectPCA::DefectPCA const DefectixOptions::Options options  ) 
 

Standard constructor.

The constructor initialises private members with 'options' values.

Parameters:
options Class containing every parameters set by the user (or default)


Member Function Documentation

void DefectPCA::computePCA gsl_matrix *  m,
const int  nb_pc,
gsl_matrix *  evec
 

Compute Principal Components Analysis.

The function computes a PCA on the given matrix and tranform m with the first components of the precalculated KL-Base

Parameters:
m matrix to transform
nb_pc number of principal components to use
evec precalculated KL-Base

void DefectPCA::computePCA gsl_matrix *  m,
const int  nb_pc
 

Compute Principal Components Analysis.

The function computes a PCA on the given matrix and tranform m with the first components of the obtained KL-Base

Parameters:
m matrix to transform
nb_pc number of principal components to use

errorCodes DefectPCA::eigenVectors const gsl_matrix *const  const_m  )  [private]
 

compute eigen vectors and values

The function computes the eigen vectors and values of the covariance matrix of the given matrix. Eigen vectors are then sorted by ascending eigen values.

Parameters:
const_m matrix used for computation

const gsl_vector *const DefectPCA::getEigenValues  )  const [inline]
 

Get eigen values.

The function returns a pointer to the current eigen values

const gsl_matrix *const DefectPCA::getEigenVectors  )  const [inline]
 

Get the KL-Base.

The function returns a pointer to the current KL-Base

const gsl_matrix *const DefectPCA::getPrincipalComponents  )  const [inline]
 

Get principal components.

The function returns a pointer to the current principal components. The principal components are the result of the projection of the image on the KL-Base.

void DefectPCA::printMessage const char *  msg  )  const [inline, private]
 

Print a message on the standard output.

Parameters:
msg string to print

void DefectPCA::setEigenVectors const gsl_matrix *const  m  )  [private]
 

allocate eigen vectors and eigen values

The function checks eigen vectors and values dimensions. The functions frees and/or allocates them if needed.

Parameters:
m matrix used to check dimensions

void DefectPCA::writeEigenVectors gsl_matrix *  evec  )  [private]
 

Write the KL-Base into files.

The function writes the gsl_matrix into a file and also write each principal component into a FITS file

Parameters:
evec KL-Base to save


Member Data Documentation

DefectPCA::_blocSize [protected]
 

Size of the blocks to create.

_blocSize defines the size of the blocks used for PCA, training and computing. Blocks contains _blocSize x _blocSize pixels.

gsl_vector * DefectPCA::_eval [protected]
 

Eigen values of the covariance matrix.

The eigen values computed by eigenVectors() are stored in this vector

gsl_matrix * DefectPCA::_evec [protected]
 

Eigen vectors of the covariance matrix (KL-Base).

The eigen vectors computed by eigenVectors() are stored in this matrix

gsl_matrix * DefectPCA::_pc [protected]
 

Principal components.

The principal components computed by computePCA() are stored in this matrix.

bool DefectPCA::_printEvec [protected]
 

Ask to save KL-Base.

If _printEvec is true, the KL-Base is written by function writeEigenVectors()


The documentation for this class was generated from the following file:
Generated on Fri Jul 2 13:08:03 2004 for defectix by doxygen 1.3.5