#include <Feature.h>


Public Types | |
| typedef double | data_t |
Public Member Functions | |
| Feature (unsigned long vectSize=0) | |
| Feature (const Config &c) | |
| Feature (const Feature &) | |
| const Feature & | operator= (const Feature &) |
| bool | operator== (const Feature &) const |
| bool | operator!= (const Feature &) const |
| virtual | ~Feature () |
| unsigned long | getVectSize () const |
| data_t & | operator[] (unsigned long index) |
| data_t | operator[] (unsigned long index) const |
| virtual void | reset () |
| bool | isValid () const |
| void | setValidity (bool validity) |
| unsigned long | getLabelCode () const |
| void | setLabelCode (unsigned long code) |
| void | setData (const FloatVector &v, unsigned long start=0) |
| void | setData (const DoubleVector &v, unsigned long start=0) |
| void | copySelectedData (const Feature &f, const ULongVector &s) |
| data_t * | getDataVector () const |
| void | setVectSize (const K &, unsigned long) |
| virtual String | getClassName () const |
| virtual String | toString () const |
Static Public Member Functions | |
| static Feature & | create (unsigned long vectSize) |
Private Member Functions | |
| data_t * | createVector () const |
Private Attributes | |
| unsigned long | _vectSize |
| bool | _isValid |
| unsigned long | _labelCode |
| data_t * | _dataVector |
Friends | |
| class | TestFeature |
This class represents a feature. A feature contains a vector of acoustic parameters and other data like :
> a label code (speaker identifier, phoneme identifier, etc.)
> a flag for the validity of the feature
and in the next version of the class :
> some end-point-detection information
> a generic object (for example, in order to store computation results)
Definition at line 89 of file Feature.h.
| typedef double alize::Feature::data_t |
| Feature::Feature | ( | unsigned long | vectSize = 0 ) |
[explicit] |
Create a Feature object
| vectSize | size of the acoustic parameters vector |
Definition at line 69 of file Feature.cpp.
Referenced by create().
| Feature::Feature | ( | const Config & | c ) | [explicit] |
Create a Feature object
| c | a Config object that contains the vectSize parameter |
Definition at line 77 of file Feature.cpp.
| Feature::Feature | ( | const Feature & | f ) |
Definition at line 92 of file Feature.cpp.
References _dataVector, and _vectSize.
| Feature::~Feature | ( | ) | [virtual] |
Definition at line 231 of file Feature.cpp.
References _dataVector, and NULL.
| void Feature::copySelectedData | ( | const Feature & | f, |
| const ULongVector & | s | ||
| ) |
Copy some parameters from a feature (copy too validity and label code)
Gets parameters from f according to the selection s and put them into this feature
| f | the feature with the parameters to select |
| s | an array of parameter indexes |
Definition at line 195 of file Feature.cpp.
References _dataVector, _isValid, _labelCode, _vectSize, alize::ULongVector::getArray(), and alize::ULongVector::size().
| Feature & Feature::create | ( | unsigned long | vectSize ) | [static] |
Create a Feature object
| vectSize | size of the acoustic parameters vector |
Definition at line 85 of file Feature.cpp.
References alize::Object::assertMemoryIsAllocated(), and Feature().
| Feature::data_t * Feature::createVector | ( | ) | const [private] |
Definition at line 124 of file Feature.cpp.
References _vectSize, and alize::Object::assertMemoryIsAllocated().
Referenced by setVectSize().
| String Feature::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 217 of file Feature.cpp.
| Feature::data_t * Feature::getDataVector | ( | ) | const |
Use this method to access directly to the internal vector
Definition at line 215 of file Feature.cpp.
References _dataVector.
Referenced by alize::FrameAcc::accumulate(), alize::DistribGF::computeLK(), alize::DistribGD::computeLK(), and alize::FrameAcc::deaccumulate().
| unsigned long Feature::getLabelCode | ( | ) | const |
Returns the label code
Definition at line 145 of file Feature.cpp.
References _labelCode.
| unsigned long Feature::getVectSize | ( | ) | const |
Returns the size of the acoustic parameters vector
Definition at line 163 of file Feature.cpp.
References _vectSize.
Referenced by alize::FrameAcc::accumulate(), alize::DistribGF::computeLK(), alize::DistribGD::computeLK(), alize::FrameAcc::deaccumulate(), alize::Matrix< T >::Matrix(), and alize::FeatureFileWriter::writeFeature().
| bool Feature::isValid | ( | ) | const |
Tells whether or not this feature is valid.
Definition at line 141 of file Feature.cpp.
References _isValid.
| bool Feature::operator!= | ( | const Feature & | c ) | const |
Definition at line 122 of file Feature.cpp.
Copy the content of the feature f in this feature. Data copied are : the vector of parameters, the validity flag and the label code.
| Exception | if the target vectSize dos not match the source vectSize |
Definition at line 99 of file Feature.cpp.
References _dataVector, _isValid, _labelCode, _vectSize, and alize::String::valueOf().
| bool Feature::operator== | ( | const Feature & | f ) | const |
Two Feature objects are equal if their dimensions are equal and their validities are equal and all their parameters (vector) are the same.
Definition at line 112 of file Feature.cpp.
References _dataVector, _isValid, and _vectSize.
| Feature::data_t & Feature::operator[] | ( | unsigned long | index ) |
Overloaded operator[] to access an element in the acoustic parameters vector
| index | index of the element to access |
| IndexOutOfBoundsException |
Definition at line 149 of file Feature.cpp.
References _dataVector, _vectSize, alize::Object::assertIsInBounds(), and NULL.
| Feature::data_t Feature::operator[] | ( | unsigned long | index ) | const |
like the other operator[] but for constant Feature object
Definition at line 156 of file Feature.cpp.
References _dataVector, _vectSize, alize::Object::assertIsInBounds(), and NULL.
| void Feature::reset | ( | ) | [virtual] |
Set all the acoustic parameters to 0.0, the label to an empty string and the validity to false;
Definition at line 131 of file Feature.cpp.
References _dataVector, _isValid, _labelCode, and _vectSize.
| void Feature::setData | ( | const FloatVector & | v, |
| unsigned long | start = 0 |
||
| ) |
Updates all the acoustic parameters
| v | vector of values |
| start | index of the first value to use in the vector |
| thrown | if the vector size is not equals to the feature size |
Definition at line 177 of file Feature.cpp.
References _dataVector, _vectSize, alize::RealVector< T >::getArray(), and alize::RealVector< T >::size().
| void Feature::setData | ( | const DoubleVector & | v, |
| unsigned long | start = 0 |
||
| ) |
Updates all the acoustic parameters
| v | vector of values |
| start | index of the first value to use in the vector |
| thrown | if the vector size is not equals to the feature size |
Definition at line 186 of file Feature.cpp.
References _dataVector, _vectSize, alize::RealVector< T >::getArray(), and alize::RealVector< T >::size().
| void Feature::setLabelCode | ( | unsigned long | code ) |
Method to set the label code
| code | the value of the code. |
Definition at line 147 of file Feature.cpp.
References _labelCode.
| void Feature::setValidity | ( | bool | validity ) |
Sets the validity of this feature.
| validity | true or false. |
Definition at line 143 of file Feature.cpp.
References _isValid.
| void Feature::setVectSize | ( | const K & | , |
| unsigned long | s | ||
| ) |
Definition at line 165 of file Feature.cpp.
References _dataVector, _vectSize, createVector(), and NULL.
| String Feature::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
Reimplemented from alize::Object.
Definition at line 219 of file Feature.cpp.
References _isValid, _labelCode, _vectSize, and alize::String::valueOf().
data_t* alize::Feature::_dataVector [private] |
Definition at line 215 of file Feature.h.
Referenced by copySelectedData(), Feature(), getDataVector(), operator=(), operator==(), operator[](), reset(), setData(), setVectSize(), and ~Feature().
bool alize::Feature::_isValid [private] |
Definition at line 213 of file Feature.h.
Referenced by copySelectedData(), isValid(), operator=(), operator==(), reset(), setValidity(), and toString().
unsigned long alize::Feature::_labelCode [private] |
Definition at line 214 of file Feature.h.
Referenced by copySelectedData(), getLabelCode(), operator=(), reset(), setLabelCode(), and toString().
unsigned long alize::Feature::_vectSize [private] |
Definition at line 212 of file Feature.h.
Referenced by copySelectedData(), createVector(), Feature(), getVectSize(), operator=(), operator==(), operator[](), reset(), setData(), setVectSize(), and toString().
1.7.2