Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::Feature Class Reference

#include <Feature.h>

Inheritance diagram for alize::Feature:
Inheritance graph
[legend]
Collaboration diagram for alize::Feature:
Collaboration graph
[legend]

List of all members.

Public Types

typedef double data_t

Public Member Functions

 Feature (unsigned long vectSize=0)
 Feature (const Config &c)
 Feature (const Feature &)
const Featureoperator= (const Feature &)
bool operator== (const Feature &) const
bool operator!= (const Feature &) const
virtual ~Feature ()
unsigned long getVectSize () const
data_toperator[] (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_tgetDataVector () const
void setVectSize (const K &, unsigned long)
virtual String getClassName () const
virtual String toString () const

Static Public Member Functions

static Featurecreate (unsigned long vectSize)

Private Member Functions

data_tcreateVector () const

Private Attributes

unsigned long _vectSize
bool _isValid
unsigned long _labelCode
data_t_dataVector

Friends

class TestFeature

Detailed Description

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)

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2003

Definition at line 89 of file Feature.h.


Member Typedef Documentation

typedef double alize::Feature::data_t

Definition at line 95 of file Feature.h.


Constructor & Destructor Documentation

Feature::Feature ( unsigned long  vectSize = 0 ) [explicit]

Create a Feature object

Parameters:
vectSizesize 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

Parameters:
ca 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.


Member Function Documentation

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

Parameters:
fthe feature with the parameters to select
san 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

Parameters:
vectSizesize 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

Returns:
the name of the class of the object as a String

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

Returns:
a pointer on the first acoustic parameter
Warning:
Fast but dangerous ! Use preferably operator [].

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

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

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.

Returns:
true if this feature is valid; false otherwise.

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.

const Feature & Feature::operator= ( const Feature f )

Copy the content of the feature f in this feature. Data copied are : the vector of parameters, the validity flag and the label code.

Exceptions:
Exceptionif 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

Parameters:
indexindex of the element to access
Returns:
a reference to the element
Exceptions:
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

Parameters:
vvector of values
startindex of the first value to use in the vector
Exceptions:
thrownif 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

Parameters:
vvector of values
startindex of the first value to use in the vector
Exceptions:
thrownif 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

Parameters:
codethe 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.

Parameters:
validitytrue 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

Returns:
a description of the object

Reimplemented from alize::Object.

Definition at line 219 of file Feature.cpp.

References _isValid, _labelCode, _vectSize, and alize::String::valueOf().


Friends And Related Function Documentation

friend class TestFeature [friend]

Definition at line 91 of file Feature.h.


Member Data Documentation

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]

The documentation for this class was generated from the following files: