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. | |
| aux::DiracPdf createRandomDirac | ( | const unsigned int | M, | |
| const double | minMean = -5.0, |
|||
| const double | maxMean = 5.0 | |||
| ) |
Create random Dirac distribution.
| M | Dimensionality of the Dirac. | |
| minMean | Minimum value of any component of the mean. | |
| maxMean | Maximum value of any component of the mean. |
| 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.
| 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. |
| aux::UniformPdf createRandomUniform | ( | const unsigned int | M, | |
| const double | minBound = -5.0, |
|||
| const double | maxBound = 5.0 | |||
| ) |
Create random uniform distribution.
| M | Dimensionality of the distribution. | |
| minBound | Minimum value of any component of a bound. | |
| maxBound | Maximum value of any component of a bound. |
| bool isZero | ( | const aux::matrix & | A | ) |
| bool isZero | ( | const aux::vector & | x | ) |
| bool testDensityTreeMixturePdf | ( | ) |
| bool testGaussianMixturePdf | ( | ) |
| unsigned int DIRAC_MIXTURE_COMPONENTS = 1000 |
| unsigned int GAUSSIAN_MIXTURE_COMPONENTS = 12 |
| unsigned int TREE_MIXTURE_COMPONENTS = 12 |
1.5.2