#include <DistribGD.h>


Public Member Functions | |
| DistribGD (const DistribGD &d) | |
| DistribGD (unsigned long vectSize) | |
| DistribGD (const Config &config) | |
| virtual const Distrib & | operator= (const Distrib &d) |
| const DistribGD & | operator= (const DistribGD &d) |
| virtual bool | operator== (const Distrib &d) const |
| virtual | ~DistribGD () |
| virtual void | reset () |
| virtual lk_t | computeLK (const Feature &) const |
| virtual lk_t | computeLK (const Feature &, unsigned long idx) const |
| void | setCov (real_t value, unsigned long index) |
| virtual void | computeAll () |
| real_t | getCov (unsigned long index) |
| real_t | getCov (unsigned long index) const |
| real_t | getCovInv (unsigned long index) const |
| DoubleVector & | getCovVect () |
| const DoubleVector & | getCovVect () const |
| DoubleVector & | getCovInvVect () |
| const DoubleVector & | getCovInvVect () const |
| virtual String | getClassName () const |
| virtual String | toString () const |
| void | setCovInv (const K &, real_t value, unsigned long index) |
| DistribGD & | duplicate (const K &) const |
Static Public Member Functions | |
| static DistribGD & | create (const K &, unsigned long vectSize) |
| static DistribGD & | create (const K &, const Config &config) |
Private Member Functions | |
| virtual Distrib & | clone () const |
Private Attributes | |
| DoubleVector | _covVect |
| DoubleVector | _covInvVect |
Friends | |
| class | TestDistribGD |
| class | TestMixtureGD |
Class for a distribution GD (gaussian with diagonal 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 90 of file DistribGD.h.
| DistribGD::DistribGD | ( | const DistribGD & | d ) |
Copy constructor
| d | the distribution GD to copy. |
| Exception | can be thrown if the dimension of d does not match the dimension of this distribution |
Definition at line 114 of file DistribGD.cpp.
References alize::Distrib::_cst, alize::Distrib::_det, and alize::Distrib::_meanVect.
| DistribGD::DistribGD | ( | unsigned long | vectSize ) | [explicit] |
Creates a new DistribGD object. All the values are randomly initialized.
| vectSize | dimension of the distribution |
Definition at line 83 of file DistribGD.cpp.
References reset().
| DistribGD::DistribGD | ( | const Config & | config ) | [explicit] |
Creates a new DistribGD object. All the values are randomly initialized.
| config | parameters used to build the distribution |
Definition at line 87 of file DistribGD.cpp.
References reset().
| DistribGD::~DistribGD | ( | ) | [virtual] |
Definition at line 302 of file DistribGD.cpp.
| Distrib & DistribGD::clone | ( | ) | const [private, virtual] |
Implements alize::Distrib.
Definition at line 154 of file DistribGD.cpp.
References alize::Object::assertMemoryIsAllocated(), and DistribGD().
Referenced by duplicate().
| void DistribGD::computeAll | ( | ) | [virtual] |
Computes internal data (determinant of the matrix, inverse covariance vector and a constante used for likelihood computation)
Implements alize::Distrib.
Definition at line 192 of file DistribGD.cpp.
References _covInvVect, _covVect, alize::Distrib::_cst, alize::Distrib::_det, alize::Distrib::_vectSize, alize::Object::EPS_LK, alize::RealVector< T >::getArray(), getCovVect(), NULL, alize::Object::PI2, and alize::RealVector< T >::setSize().
Referenced by reset().
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 163 of file DistribGD.cpp.
References _covInvVect, alize::Distrib::_cst, alize::Distrib::_meanVect, alize::Distrib::_vectSize, alize::Object::EPS_LK, alize::RealVector< T >::getArray(), alize::Feature::getDataVector(), alize::Feature::getVectSize(), and alize::String::valueOf().
Implements alize::Distrib.
Definition at line 183 of file DistribGD.cpp.
References _covInvVect, alize::Distrib::_cst, alize::Distrib::_meanVect, and alize::Object::EPS_LK.
Creates a new DistribGD object. Call the constructor and returns the object.
| vectSize | dimension of the distribution |
Definition at line 104 of file DistribGD.cpp.
References alize::Object::assertMemoryIsAllocated(), and DistribGD().
Referenced by create(), alize::Distrib::create(), and alize::MixtureGD::MixtureGD().
Creates a new DistribGD object. Call the constructor and returns the object.
| config | parameters used to build the distribution |
Definition at line 111 of file DistribGD.cpp.
References create(), alize::Config::getParam_vectSize(), and alize::K::k.
Duplicates this DistribGD Object. See copy contructor
Reimplemented from alize::Distrib.
Definition at line 151 of file DistribGD.cpp.
References clone().
| String DistribGD::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Distrib.
Definition at line 271 of file DistribGD.cpp.
Referenced by alize::MixtureGD::toString().
| real_t DistribGD::getCov | ( | unsigned long | index ) |
Gets a value in the covariance vector.
| index | position in the array |
| IndexOutOfBoundsException |
Definition at line 236 of file DistribGD.cpp.
References getCovVect().
| real_t DistribGD::getCov | ( | unsigned long | index ) | const |
Definition at line 239 of file DistribGD.cpp.
References getCovVect().
| real_t DistribGD::getCovInv | ( | unsigned long | index ) | const |
Gets a value in the inverse covariance vector
| index | position in the array |
| IndexOutOfBoundsException |
Definition at line 242 of file DistribGD.cpp.
References _covInvVect.
| DoubleVector & DistribGD::getCovInvVect | ( | ) |
Returns a reference to the inverse covariance vector
Definition at line 244 of file DistribGD.cpp.
References _covInvVect.
| const DoubleVector & DistribGD::getCovInvVect | ( | ) | const |
Definition at line 246 of file DistribGD.cpp.
References _covInvVect.
| const DoubleVector & DistribGD::getCovVect | ( | ) | const |
Definition at line 254 of file DistribGD.cpp.
References _covInvVect, _covVect, alize::Distrib::_vectSize, alize::Object::MIN_COV, alize::RealVector< T >::setSize(), and alize::RealVector< T >::size().
| DoubleVector & DistribGD::getCovVect | ( | ) |
Returns a reference to the covariance vector. If it does not exist it is created and randomly initialized.
Definition at line 248 of file DistribGD.cpp.
Referenced by computeAll(), getCov(), and setCov().
Copy data members of a distribution GD in this distribution
| d | the distribution GD source |
| Exception | can be thrown if the dimension of d does not match the dimension of this distribution |
Definition at line 130 of file DistribGD.cpp.
References _covInvVect, _covVect, alize::Distrib::_cst, alize::Distrib::_det, alize::Distrib::_meanVect, alize::Distrib::_vectSize, alize::Distrib::getVectSize(), and alize::String::valueOf().
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 DistribGD object. |
Implements alize::Distrib.
Definition at line 122 of file DistribGD.cpp.
References NULL.
| bool DistribGD::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 144 of file DistribGD.cpp.
References _covInvVect, alize::Distrib::_meanVect, and NULL.
| void DistribGD::reset | ( | ) | [virtual] |
Resets the distribution (as creation)
Implements alize::Distrib.
Definition at line 91 of file DistribGD.cpp.
References _covVect, alize::Distrib::_meanVect, alize::Distrib::_vectSize, computeAll(), and alize::RealVector< T >::setSize().
Referenced by DistribGD().
| void DistribGD::setCov | ( | real_t | value, |
| unsigned long | index | ||
| ) |
Sets a value in the covariance vector. A zero value is automatically replaced by a positive-and-non-zero value near to zero.
| value | value to set |
| index | position in the array |
| IndexOutOfBoundsException |
Definition at line 225 of file DistribGD.cpp.
References getCovVect(), and alize::Object::MIN_COV.
Sets a value in the inverse covariance vector. internal usage ***
| value | value to set |
| index | position in the array |
| IndexOutOfBoundsException |
Definition at line 233 of file DistribGD.cpp.
References _covInvVect.
| String DistribGD::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 273 of file DistribGD.cpp.
References _covInvVect, _covVect, alize::Distrib::_cst, alize::Distrib::_det, alize::Distrib::_meanVect, alize::Distrib::_vectSize, alize::RealVector< T >::size(), and alize::String::valueOf().
friend class TestDistribGD [friend] |
Reimplemented from alize::Distrib.
Definition at line 92 of file DistribGD.h.
friend class TestMixtureGD [friend] |
Reimplemented from alize::Distrib.
Definition at line 93 of file DistribGD.h.
DoubleVector alize::DistribGD::_covInvVect [private] |
inverse covariance vector
Definition at line 240 of file DistribGD.h.
Referenced by computeAll(), computeLK(), getCovInv(), getCovInvVect(), getCovVect(), operator=(), operator==(), setCovInv(), and toString().
DoubleVector alize::DistribGD::_covVect [mutable, private] |
temporary covariance vector. The vector is cleared after calling computeAll()
Definition at line 237 of file DistribGD.h.
Referenced by computeAll(), getCovVect(), operator=(), reset(), and toString().
1.7.2