Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

Divergence Class Reference

Object for the Kullback-Leibler divergence beween 3 dimensionnal Gaussians. More...

#include <divergence.h>

List of all members.

Public Methods

 Divergence (int nb_dimensions)
 Constructor : Memory allocation.

virtual ~Divergence ()
 Destructor : Memory desallocation.

void Initialise (float **C_A, float **C_B, float *M_A, float *M_B)
 Initialisation with 2 Gaussian Distributions. More...

int BoundResolution_Calculation (float *min_bound, float *max_bound, float *resolution, float PrecisionFactor)
 Calculation of the integration resolution and the integration bounds. More...

void InvertCovMatrix ()
 Inversion of the covariance matrices using a LU decomposition.

float MeanDifference ()
 Rough approximation of Kullback-Leibler distance by Mean vector difference.

float Divergence2GaussModel (float *min_bound, float *max_bound, float *resolution, float weight)
 Global method for calculating the ratio of a divergence integration (between a MT and a TL cluster) and the quantity of pixel belonging to the intersection of the MT and TL spatial classes. More...


Private Methods

float Div_MultiDimFunc (float x, float y, float z)
 analytical function to integrate. More...

void BoundCalculus (float *pas, float *resolution)
 Method to fix the portion of the integration domain to integrate.

float Integration ()
 Integration of a part of the integrable domain. More...

float f1 (float x)
 recursive funtions. The 3D function is defined with recursive functions. More...

float f2 (float y)
 recursive funtions. The 3D function is defined with recursive functions. More...

float f3 (float z)
 recursive funtions. The 3D function is defined with recursive functions. More...

float Qgaus (float(Divergence::*func)(float), float a, float b)
 Function approximating the integral with Gaussian smoothing. More...


Private Attributes

float * MeanA
 mean vector A.

float * MeanB
 mean vector B.

float ** CovA
 covariance matrix A.

float ** CovB
 covariance matrix B.

float ** InvCovA
 Inverse covariance matrix A.

float ** InvCovB
 Inverse covariance matrix B.

float * a
 Max bound for integration.

float * b
 Min bound for integration.

float xsav
 auxiliary variable for integration calculus.

float ysav
 auxiliary variable for integration calculus.

float determinantA
 Inverse covariance matrix determinant.

float determinantB
 Inverse covariance matrix determinant.

int nb_dim
 Dimensionnality of the distribution (implemented for 3 dim only).

int nb_Gdim
 number of dimension with a distribution different from a Dirac.


Detailed Description

Object for the Kullback-Leibler divergence beween 3 dimensionnal Gaussians.

Definition at line 13 of file divergence.h.


Member Function Documentation

int Divergence::BoundResolution_Calculation float *    min_bound,
float *    max_bound,
float *    resolution,
float    PrecisionFactor
 

Calculation of the integration resolution and the integration bounds.

For each band, the integration resolution is proportional to the smallest value in the diagonal of the 2 different covariance matrices
The bound of integration are adapted, for each band, to the width of the considered Gaussians. The Dirac special case is also considered, to avoid a future integration in the next steps and compute instead a multiplication.
If the Gaussians are evaluated too far from each other, a variable greater than 1 is returned by the function to avois a future useless integration.

Parameters:
min_bound  output array of min integration bounds
max_bound  output array of max integration bounds
resolution  output array of integration resolutions
PrecisionFactor  input scalar factor for the integration resolutions
Returns:
number of bands whith too distant Gaussians

Definition at line 257 of file divergence.cpp.

float Divergence::Div_MultiDimFunc float    x,
float    y,
float    z
[private]
 

analytical function to integrate.

The function is the kullback-Leibler divergence with 2 Gaussians.

Definition at line 169 of file divergence.cpp.

float Divergence::Divergence2GaussModel float *    min_bound,
float *    max_bound,
float *    resolution,
float    weight
 

Global method for calculating the ratio of a divergence integration (between a MT and a TL cluster) and the quantity of pixel belonging to the intersection of the MT and TL spatial classes.

The global integration in the 3D space is decomposed. We partition the 3D integration domain into small "cubes", sized according to the previously calculated resolution. All the cube contributions are added to form the global divergence value.
The global integration is performed only in the space composed by the non-Dirac distribution. For the dimensions approximated with a Dirac distribution, because an approximation of band independance, the divergence integration is simplified to a simple multiplication. This product is then added to the global integration value.
The divergence is finally divided by the quantity of pixel belonging to the intersection of the MT and TL spatial classes.

Parameters:
min_bound  output array of min integration bounds
max_bound  output array of max integration bounds
resolution  output array of integration resolutions
weight  input quantity of pixel belonging to the intersection of the MT and TL spatial classes
Returns:
ratio of the Divergence integration and the quantity of pixel belonging to the intersection of the MT and TL spatial classes

Definition at line 335 of file divergence.cpp.

float Divergence::f1 float    x [private]
 

recursive funtions. The 3D function is defined with recursive functions.

This recursive integration method is inspired from the numerical recepies book.

Definition at line 235 of file divergence.cpp.

float Divergence::f2 float    y [private]
 

recursive funtions. The 3D function is defined with recursive functions.

This recursive integration method is inspired from the numerical recepies book.

Definition at line 240 of file divergence.cpp.

float Divergence::f3 float    z [private]
 

recursive funtions. The 3D function is defined with recursive functions.

This recursive integration method is inspired from the numerical recepies book.

Definition at line 245 of file divergence.cpp.

void Divergence::Initialise float **    C_A,
float **    C_B,
float *    M_A,
float *    M_B
 

Initialisation with 2 Gaussian Distributions.

The components of the multivariate Gaussian distribution which are too narrow are moved to the last dimensions of the covariance matrix. A variable saves the number of dimension presenting a too narrow marginal Gaussian distribution.In this case, the divergence will be equal to a simple multiplication.

Definition at line 48 of file divergence.cpp.

float Divergence::Integration   [private]
 

Integration of a part of the integrable domain.

The divergence is performed by an analytical integration using a Gaussian approximation. This recursive integration method is inspired from the numerical recepies book.

Returns:
integration value

Definition at line 227 of file divergence.cpp.

float Divergence::Qgaus float(Divergence::*    func)(float),
float    a,
float    b
[private]
 

Function approximating the integral with Gaussian smoothing.

This integration method is inspired from the numerical recepies book.

Definition at line 206 of file divergence.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Feb 17 11:03:19 2005 for Interactive Learning of Sub-Graphs Semantics by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002