test5.cpp File Reference


Detailed Description

Test of serialization, input and output, for all pdfs.

A random pdf is constructed for each type, serialized and output to a file. A new pdf is constructed from the serialization in the file and compared to the original for equality.

Results are as follows:

GaussianPdf passed
DiracPdf passed
UniformPdf passed
DensityTreePdf passed
GaussianMixturePdf passed
DiracMixturePdf passed
DensityTreeMixturePdf passed

Definition in file test5.cpp.

Go to the source code of this file.

Functions

aux::DiracPdf createRandomDirac (const unsigned int M, const double minMean=-5.0, const double maxMean=5.0)
 Create random Dirac distribution.
aux::GaussianPdf createRandomGaussian (const unsigned int M, const double minMean=-5.0, const double maxMean=5.0, const double minCov=0.0, const double maxCov=5.0)
 Create random Gaussian distribution.
aux::UniformPdf createRandomUniform (const unsigned int M, const double minBound=-5.0, const double maxBound=5.0)
 Create random uniform distribution.
bool isZero (const aux::vector &x)
 Determines whether a vector is the zero vector.
bool isZero (const aux::matrix &A)
 Determine whether a matrix is the zero matrix.
bool testGaussianPdf ()
 Test of GaussianPdf.
bool testDiracPdf ()
 Test of DiracPdf.
bool testUniformPdf ()
 Test of UniformPdf.
bool testDensityTreePdf ()
 Test of DensityTreePdf.
bool testGaussianMixturePdf ()
 Test of GaussianMixturePdf.
bool testDiracMixturePdf ()
 Test of DiracMixturePdf.
bool testDensityTreeMixturePdf ()
 Test of DensityTreeMixturePdf.
int main (int argc, const char *argv[])
 Run tests.

Variables

unsigned int N = 4
 Dimensionality of the distributions.
unsigned int GAUSSIAN_MIXTURE_COMPONENTS = 12
 Number of components for Gaussian mixture test.
unsigned int DIRAC_MIXTURE_COMPONENTS = 1000
 Number of components for Dirac mixture test.
unsigned int TREE_MIXTURE_COMPONENTS = 12
 Number of components for density tree mixture test.


Function Documentation

aux::DiracPdf createRandomDirac ( const unsigned int  M,
const double  minMean = -5.0,
const double  maxMean = 5.0 
)

Create random Dirac distribution.

Parameters:
M Dimensionality of the Dirac.
minMean Minimum value of any component of the mean.
maxMean Maximum value of any component of the mean.
Dirac with given dimensionality, with mean randomly generated uniformly from within the given bounds.

Definition at line 61 of file test5.cpp.

aux::GaussianPdf createRandomGaussian ( const unsigned int  M,
const double  minMean = -5.0,
const double  maxMean = 5.0,
const double  minCov = 0.0,
const double  maxCov = 5.0 
)

Create random Gaussian distribution.

Parameters:
M Dimensionality of the Gaussian.
minMean Minimum value of any component of the mean.
maxMean Maximum value of any component of the mean.
minCov Minimum value of any component of the covariance.
maxCov Maximum value of any component of the covariance.
Returns:
Gaussian with given dimensionality, with mean and covariance randomly generated uniformly from within the given bounds.

Definition at line 87 of file test5.cpp.

aux::UniformPdf createRandomUniform ( const unsigned int  M,
const double  minBound = -5.0,
const double  maxBound = 5.0 
)

Create random uniform distribution.

Parameters:
M Dimensionality of the distribution.
minBound Minimum value of any component of a bound.
maxBound Maximum value of any component of a bound.
Returns:
Uniform distribution with given dimensionality, with lower and upper bound randomly generated uniformly from within the given bounds.

Definition at line 121 of file test5.cpp.

bool isZero ( const aux::matrix &  A  ) 

Determine whether a matrix is the zero matrix.

Definition at line 159 of file test5.cpp.

bool isZero ( const aux::vector &  x  ) 

Determines whether a vector is the zero vector.

Definition at line 146 of file test5.cpp.

int main ( int  argc,
const char *  argv[] 
)

Run tests.

Definition at line 431 of file test5.cpp.

bool testDensityTreeMixturePdf (  ) 

Test of DensityTreeMixturePdf.

Definition at line 380 of file test5.cpp.

bool testDensityTreePdf (  ) 

Test of DensityTreePdf.

Definition at line 251 of file test5.cpp.

bool testDiracMixturePdf (  ) 

Test of DiracMixturePdf.

Definition at line 333 of file test5.cpp.

bool testDiracPdf (  ) 

Test of DiracPdf.

Definition at line 201 of file test5.cpp.

bool testGaussianMixturePdf (  ) 

Test of GaussianMixturePdf.

Definition at line 284 of file test5.cpp.

bool testGaussianPdf (  ) 

Test of GaussianPdf.

Definition at line 174 of file test5.cpp.

bool testUniformPdf (  ) 

Test of UniformPdf.

Definition at line 225 of file test5.cpp.


Variable Documentation

unsigned int DIRAC_MIXTURE_COMPONENTS = 1000

Number of components for Dirac mixture test.

Definition at line 44 of file test5.cpp.

unsigned int GAUSSIAN_MIXTURE_COMPONENTS = 12

Number of components for Gaussian mixture test.

Definition at line 39 of file test5.cpp.

unsigned int N = 4

Dimensionality of the distributions.

Definition at line 34 of file test5.cpp.

unsigned int TREE_MIXTURE_COMPONENTS = 12

Number of components for density tree mixture test.

Definition at line 49 of file test5.cpp.


Generated on Wed Mar 5 16:36:30 2008 for dysii Probability Distributions Test Suite by  doxygen 1.5.2