#include <RealVector.h>


Public Member Functions | |
| RealVector (unsigned long capacity=0, unsigned long size=0) | |
| RealVector (const RealVector< T > &v) | |
| const RealVector< T > & | operator= (const RealVector< T > &v) |
| const RealVector< T > & | operator+= (const RealVector< T > &v) |
| const RealVector< T > & | operator-= (const RealVector< T > &v) |
| bool | operator== (const RealVector< T > &v) const |
| bool | operator!= (const RealVector< T > &v) const |
| virtual | ~RealVector () |
| unsigned long | size () const |
| void | clear () |
| void | setSize (const unsigned long size, const bool updateCapacity=false) |
| void | addValue (T v) |
| void | addValue (const RealVector< T > &v) |
| void | setValues (const RealVector< T > &v) |
| void | setAllValues (T v) |
| T | computeSum () const |
| const RealVector< T > & | operator*= (double s) |
| T & | operator[] (unsigned long i) |
| T | operator[] (unsigned long i) const |
| void | ascendingSort () const |
| unsigned long | getIndexOfLargestValue () |
| T * | getArray () const |
| virtual String | getClassName () const |
| virtual String | toString () const |
Static Public Member Functions | |
| static RealVector< T > & | create (unsigned long capacity=0, unsigned long size=0) |
Private Member Functions | |
| T * | createArray () const |
Static Private Member Functions | |
| static int | compare (const void *s1, const void *s2) |
Private Attributes | |
| unsigned long | _size |
| unsigned long | _capacity |
| T * | _array |
Friends | |
| class | TestDoubleVector |
| class | TestFloatVector |
| class | TestRealVector |
This class implements a growable array of real (float/double) values.
Definition at line 83 of file RealVector.h.
| alize::RealVector< T >::RealVector | ( | unsigned long | capacity = 0, |
| unsigned long | size = 0 |
||
| ) | [inline, explicit] |
Create a vector of type double values.
| size | initial size of the array |
| capacity | maximum number of elements in the array The capacity will grow automatically when the size will overtake the capacity |
Definition at line 99 of file RealVector.h.
| alize::RealVector< T >::RealVector | ( | const RealVector< T > & | v ) | [inline] |
Definition at line 106 of file RealVector.h.
| virtual alize::RealVector< T >::~RealVector | ( | ) | [inline, virtual] |
Definition at line 171 of file RealVector.h.
| void alize::RealVector< T >::addValue | ( | T | v ) | [inline] |
Appends a real data to the end of the vector
| v | the real value to add |
Definition at line 216 of file RealVector.h.
Referenced by alize::Histo::accumulateValue(), alize::LabelSet::addLabel(), and alize::ViterbiAccum::computeAndAccumulate().
| void alize::RealVector< T >::addValue | ( | const RealVector< T > & | v ) | [inline] |
Appends a real data vector to the end of the vector
| v | the real vector to add |
Definition at line 234 of file RealVector.h.
| void alize::RealVector< T >::ascendingSort | ( | ) | const [inline] |
Sorts the internal vector (ascending)
Definition at line 309 of file RealVector.h.
Referenced by alize::Histo::computeHisto().
| void alize::RealVector< T >::clear | ( | ) | [inline] |
Definition at line 181 of file RealVector.h.
Referenced by alize::LabelSet::clear(), alize::ViterbiAccum::computeAndAccumulate(), alize::Histo::computeHisto(), and alize::ViterbiAccum::reset().
| static int alize::RealVector< T >::compare | ( | const void * | s1, |
| const void * | s2 | ||
| ) | [inline, static, private] |
Definition at line 372 of file RealVector.h.
| T alize::RealVector< T >::computeSum | ( | ) | const [inline] |
Computes and returns the sum of all values
Definition at line 267 of file RealVector.h.
| static RealVector<T>& alize::RealVector< T >::create | ( | unsigned long | capacity = 0, |
| unsigned long | size = 0 |
||
| ) | [inline, static] |
Definition at line 113 of file RealVector.h.
| T* alize::RealVector< T >::createArray | ( | ) | const [inline, private] |
Definition at line 365 of file RealVector.h.
| T* alize::RealVector< T >::getArray | ( | ) | const [inline] |
Use this method to access directly to the internal vector
Definition at line 339 of file RealVector.h.
Referenced by alize::FrameAcc::computeAll(), alize::DistribGD::computeAll(), alize::DistribGF::computeLK(), alize::DistribGD::computeLK(), alize::DoubleSquareMatrix::invert(), alize::Feature::setData(), and alize::Matrix< T >::transpose().
| virtual String alize::RealVector< T >::getClassName | ( | ) | const [inline, virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 344 of file RealVector.h.
| unsigned long alize::RealVector< T >::getIndexOfLargestValue | ( | ) | [inline] |
Returns the index of largest value in the vector
| Exception | if the vector is empty |
Definition at line 319 of file RealVector.h.
| bool alize::RealVector< T >::operator!= | ( | const RealVector< T > & | v ) | const [inline] |
Definition at line 166 of file RealVector.h.
| const RealVector<T>& alize::RealVector< T >::operator*= | ( | double | s ) | [inline] |
Multiplies each value by a scalar
| s | a scalar |
Definition at line 279 of file RealVector.h.
| const RealVector<T>& alize::RealVector< T >::operator+= | ( | const RealVector< T > & | v ) | [inline] |
Definition at line 137 of file RealVector.h.
| const RealVector<T>& alize::RealVector< T >::operator-= | ( | const RealVector< T > & | v ) | [inline] |
Definition at line 145 of file RealVector.h.
| const RealVector<T>& alize::RealVector< T >::operator= | ( | const RealVector< T > & | v ) | [inline] |
Definition at line 121 of file RealVector.h.
| bool alize::RealVector< T >::operator== | ( | const RealVector< T > & | v ) | const [inline] |
Definition at line 154 of file RealVector.h.
| T& alize::RealVector< T >::operator[] | ( | unsigned long | i ) | [inline] |
Overloaded operator[] to access an element in the vector.
| i | index of the element to access |
| IndexOutOfBoundsException |
Definition at line 291 of file RealVector.h.
| T alize::RealVector< T >::operator[] | ( | unsigned long | i ) | const [inline] |
like the other operator[] but for constant RealVector object.
Definition at line 300 of file RealVector.h.
| void alize::RealVector< T >::setAllValues | ( | T | v ) | [inline] |
Sets all the values to a a particular value
| v | the real value to set |
Definition at line 258 of file RealVector.h.
| void alize::RealVector< T >::setSize | ( | const unsigned long | size, |
| const bool | updateCapacity = false |
||
| ) | [inline] |
Set a new size. If updateCapacity is set to true, update the capacity of the vector (useful to save memory)
| size | new size |
| updateMemory |
Definition at line 191 of file RealVector.h.
Referenced by alize::ViterbiAccum::addState(), alize::DistribGD::computeAll(), alize::DistribGD::getCovVect(), and alize::DistribGD::reset().
| void alize::RealVector< T >::setValues | ( | const RealVector< T > & | v ) | [inline] |
Sets all the values
| v | the vector that contains the values |
| Exception | if vector sizes are different |
Definition at line 247 of file RealVector.h.
| unsigned long alize::RealVector< T >::size | ( | ) | const [inline] |
Definition at line 176 of file RealVector.h.
Referenced by alize::Histo::computeHisto(), alize::DistribGD::getCovVect(), alize::Matrix< T >::Matrix(), alize::Feature::setData(), and alize::DistribGD::toString().
| virtual String alize::RealVector< T >::toString | ( | ) | const [inline, 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 349 of file RealVector.h.
friend class TestDoubleVector [friend] |
Definition at line 85 of file RealVector.h.
friend class TestFloatVector [friend] |
Definition at line 88 of file RealVector.h.
friend class TestRealVector [friend] |
Definition at line 89 of file RealVector.h.
T* alize::RealVector< T >::_array [private] |
Definition at line 363 of file RealVector.h.
Referenced by alize::RealVector< float >::addValue(), alize::RealVector< float >::operator+=(), alize::RealVector< float >::operator-=(), alize::RealVector< float >::operator=(), alize::RealVector< float >::operator==(), alize::RealVector< float >::RealVector(), and alize::RealVector< float >::setValues().
unsigned long alize::RealVector< T >::_capacity [private] |
Definition at line 362 of file RealVector.h.
unsigned long alize::RealVector< T >::_size [private] |
Definition at line 361 of file RealVector.h.
Referenced by alize::RealVector< float >::addValue(), alize::RealVector< float >::operator+=(), alize::RealVector< float >::operator-=(), alize::RealVector< float >::operator=(), alize::RealVector< float >::operator==(), and alize::RealVector< float >::setValues().
1.7.2