#include <DistribGF.h>


Public Member Functions | |
| DistribGF (const DistribGF &d) | |
| DistribGF (const unsigned long vectSize) | |
| DistribGF (const Config &config) | |
| virtual const Distrib & | operator= (const Distrib &d) |
| const DistribGF & | operator= (const DistribGF &d) |
| virtual bool | operator== (const Distrib &d) const |
| virtual | ~DistribGF () |
| virtual void | reset () |
| virtual lk_t | computeLK (const Feature &) const |
| virtual lk_t | computeLK (const Feature &, unsigned long idx) const |
| void | setCov (const real_t value, const unsigned long col, const unsigned long row) |
| virtual void | computeAll () |
| real_t | getCov (const unsigned long col, const unsigned long row) const |
| real_t | getCovInv (const unsigned long col, const unsigned long row) const |
| DoubleSquareMatrix & | getCovMatrix () |
| const DoubleSquareMatrix & | getCovMatrix () const |
| DoubleSquareMatrix & | getCovInvMatrix () |
| const DoubleSquareMatrix & | getCovInvMatrix () const |
| virtual String | getClassName () const |
| virtual String | toString () const |
| void | setCovInv (const K &, real_t value, const unsigned long col, const unsigned long row) |
| DistribGF & | duplicate (const K &) const |
Static Public Member Functions | |
| static DistribGF & | create (const K &, const unsigned long vectSize) |
| static DistribGF & | create (const K &, const Config &config) |
Private Member Functions | |
| virtual Distrib & | clone () const |
Private Attributes | |
| DoubleSquareMatrix | _covMatr |
| DoubleSquareMatrix | _covInvMatr |
| real_t | _cst |
| DoubleVector | _tmpVect |
Friends | |
| class | TestDistribGF |
| class | TestMixtureGF |
| class | TestMixtureGFStat |
Class for a distribution GF (gaussian with full matrix)
Just after creation, all the values are randomly initialized.
To build a valid distribution, you have to set all the covariance and mean values and call computeAll() to compute inverse covariance values, the constante and the determinant.
A temporary array is used to store covariance values. This array is destroyed after calling computeAll(). Before calling computeAll(), the distribution is not valid for some methods.
Definition at line 91 of file DistribGF.h.
| DistribGF::DistribGF | ( | const DistribGF & | d ) |
Copy constructor
| d | the distribution GF to copy. |
| Exception | can be thrown if the dimension of d does not match the dimension of this distribution |
Definition at line 123 of file DistribGF.cpp.
References alize::Distrib::_det, and alize::Distrib::_meanVect.
| DistribGF::DistribGF | ( | const unsigned long | vectSize ) | [explicit] |
Creates a new DistribGF object. All the values are randomly initialized.
| vectSize | dimension of the distribution |
Definition at line 85 of file DistribGF.cpp.
| DistribGF::DistribGF | ( | const Config & | config ) | [explicit] |
Creates a new DistribGF object. All the values are randomly initialized.
| config | parameters used to build the distribution |
Definition at line 89 of file DistribGF.cpp.
| DistribGF::~DistribGF | ( | ) | [virtual] |
Definition at line 293 of file DistribGF.cpp.
| Distrib & DistribGF::clone | ( | ) | const [private, virtual] |
Implements alize::Distrib.
Definition at line 168 of file DistribGF.cpp.
References alize::Object::assertMemoryIsAllocated(), and DistribGF().
Referenced by duplicate().
| void DistribGF::computeAll | ( | ) | [virtual] |
Computes internal data (determinant of the matrix, inverse covariance matrix and a constante used for likelihood computation)
Implements alize::Distrib.
Definition at line 218 of file DistribGF.cpp.
References _covInvMatr, _covMatr, _cst, alize::Distrib::_det, alize::Distrib::_vectSize, alize::Object::EPS_LK, alize::DoubleSquareMatrix::invert(), alize::Object::PI2, and alize::DoubleSquareMatrix::setSize().
Computes the likelihood between this distribution and a Feature object.
| Exception | if the feature vectSize does not match the distribution vectSize |
Implements alize::Distrib.
Definition at line 177 of file DistribGF.cpp.
References _covInvMatr, _cst, alize::Distrib::_meanVect, _tmpVect, alize::Distrib::_vectSize, alize::Object::EPS_LK, alize::DoubleSquareMatrix::getArray(), alize::RealVector< T >::getArray(), alize::Feature::getDataVector(), alize::Feature::getVectSize(), and alize::String::valueOf().
Implements alize::Distrib.
Definition at line 209 of file DistribGF.cpp.
References _covInvMatr, _cst, alize::Distrib::_meanVect, and alize::Object::EPS_LK.
Creates a new DistribGF object. Call the constructor and returns the object. internal usage ***
| vectSize | dimension of the distribution |
Definition at line 113 of file DistribGF.cpp.
References alize::Object::assertMemoryIsAllocated(), and DistribGF().
Referenced by create(), alize::Distrib::create(), and alize::MixtureGF::MixtureGF().
Creates a new DistribGF object. Call the constructor and returns the object. internal usage ***
| config | parameters used to build the distribution |
Definition at line 120 of file DistribGF.cpp.
References create(), alize::Config::getParam_vectSize(), and alize::K::k.
Duplicates this DistribGF Object. See copy contructor internal usage ***
Reimplemented from alize::Distrib.
Definition at line 165 of file DistribGF.cpp.
References clone().
| String DistribGF::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Distrib.
Definition at line 265 of file DistribGF.cpp.
Referenced by alize::MixtureGF::toString().
| real_t DistribGF::getCov | ( | const unsigned long | col, |
| const unsigned long | row | ||
| ) | const |
Gets a value in the covariance matrix. WARNING : contrary to class Matrix, colum index is FIRST argument and row index is SECOND argument
This will probably change in next release of Alize
| col | column index |
| row | row index |
| IndexOutOfBoundsException |
Definition at line 247 of file DistribGF.cpp.
References _covMatr, alize::Distrib::_vectSize, and alize::DoubleSquareMatrix::setSize().
| real_t DistribGF::getCovInv | ( | const unsigned long | col, |
| const unsigned long | row | ||
| ) | const |
Gets a value in the inverse covariance matrix WARNING : contrary to class Matrix, colum index is FIRST argument and row index is SECOND argument
This will probably change in next release of Alize
| col | column index |
| row | row index |
| IndexOutOfBoundsException |
Definition at line 253 of file DistribGF.cpp.
References _covInvMatr.
| DoubleSquareMatrix & DistribGF::getCovInvMatrix | ( | ) |
Returns a reference to the inverse covariance matrix
Definition at line 257 of file DistribGF.cpp.
References _covInvMatr.
| const DoubleSquareMatrix & DistribGF::getCovInvMatrix | ( | ) | const |
Definition at line 259 of file DistribGF.cpp.
References _covInvMatr.
| DoubleSquareMatrix & DistribGF::getCovMatrix | ( | ) |
Returns a reference to the covariance matrix.
Definition at line 261 of file DistribGF.cpp.
References _covMatr.
| const DoubleSquareMatrix & DistribGF::getCovMatrix | ( | ) | const |
Definition at line 263 of file DistribGF.cpp.
References _covMatr.
Copy data members of a distribution in this distribution.
| d | the distribution source |
| Exception | if the dimension of d does not match the dimension of this distribution or if d is not a DistribGF object. |
Implements alize::Distrib.
Definition at line 131 of file DistribGF.cpp.
References NULL.
Copy data members of a distribution GF in this distribution
| d | the distribution GF source |
| Exception | can be thrown if the dimension of d does not match the dimension of this distribution |
Definition at line 139 of file DistribGF.cpp.
References _covInvMatr, _covMatr, _cst, alize::Distrib::_det, alize::Distrib::_meanVect, alize::Distrib::_vectSize, and alize::String::valueOf().
| bool DistribGF::operator== | ( | const Distrib & | d ) | const [virtual] |
Compares the distribution d to this one.
| d | the generic distribution to compare to this one. |
Implements alize::Distrib.
Definition at line 153 of file DistribGF.cpp.
References _covInvMatr, _covMatr, alize::Distrib::_meanVect, NULL, and alize::DoubleSquareMatrix::size().
| void DistribGF::reset | ( | ) | [virtual] |
Resets the distribution (as creation)
Implements alize::Distrib.
Definition at line 93 of file DistribGF.cpp.
| void DistribGF::setCov | ( | const real_t | value, |
| const unsigned long | col, | ||
| const unsigned long | row | ||
| ) |
Sets a value in the covariance matrix. WARNING : contrary to class Matrix, colum index is FIRST argument and row index is SECOND argument
This will probably change in next release of Alize A zero value is automatically replaced by a positive-and-non-zero value near to zero.
| value | value to set |
| col | column index |
| row | row index |
| IndexOutOfBoundsException |
Definition at line 235 of file DistribGF.cpp.
References _covMatr, alize::Distrib::_vectSize, alize::Object::MIN_COV, and alize::DoubleSquareMatrix::setSize().
| void DistribGF::setCovInv | ( | const K & | , |
| real_t | value, | ||
| const unsigned long | col, | ||
| const unsigned long | row | ||
| ) |
Sets a value in the inverse covariance matrix. internal usage ***
| value | value to set |
| col | column index |
| row | row index |
| IndexOutOfBoundsException |
Definition at line 243 of file DistribGF.cpp.
References _covInvMatr.
| String DistribGF::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Implements alize::Distrib.
Definition at line 267 of file DistribGF.cpp.
References _covInvMatr, _covMatr, _cst, alize::Distrib::_det, alize::Distrib::_meanVect, alize::Distrib::_vectSize, alize::DoubleSquareMatrix::size(), and alize::String::valueOf().
friend class TestDistribGF [friend] |
Reimplemented from alize::Distrib.
Definition at line 93 of file DistribGF.h.
friend class TestMixtureGF [friend] |
Reimplemented from alize::Distrib.
Definition at line 94 of file DistribGF.h.
friend class TestMixtureGFStat [friend] |
Definition at line 95 of file DistribGF.h.
inverse covariance matrix
Definition at line 257 of file DistribGF.h.
Referenced by computeAll(), computeLK(), getCovInv(), getCovInvMatrix(), operator=(), operator==(), setCovInv(), and toString().
DoubleSquareMatrix alize::DistribGF::_covMatr [mutable, private] |
temporary covariance matrix. The matrix is cleared after calling computeAll()
Definition at line 254 of file DistribGF.h.
Referenced by computeAll(), getCov(), getCovMatrix(), operator=(), operator==(), setCov(), and toString().
real_t alize::DistribGF::_cst [private] |
constante
Reimplemented from alize::Distrib.
Definition at line 258 of file DistribGF.h.
Referenced by computeAll(), computeLK(), operator=(), and toString().
DoubleVector alize::DistribGF::_tmpVect [private] |
Definition at line 259 of file DistribGF.h.
Referenced by computeLK().
1.7.2