#include <LKVector.h>


Classes | |
| struct | type |
Public Member Functions | |
| LKVector (unsigned long capacity=0, unsigned long size=0) | |
| virtual | ~LKVector () |
| const LKVector & | operator= (const LKVector &) |
| LKVector (const LKVector &) | |
| unsigned long | size () const |
| void | clear () |
| void | setSize (unsigned long size) |
| void | pack (unsigned long size) |
| void | addValue (type v) |
| type & | operator[] (unsigned long index) |
| const type & | operator[] (unsigned long index) const |
| void | descendingSort () const |
| type * | getArray () const |
| virtual String | getClassName () const |
| virtual String | toString () const |
Public Attributes | |
| real_t | sumNonTopDistribWeights |
| real_t | sumNonTopDistribLK |
| unsigned long | topDistribsCount |
Private Member Functions | |
| type * | createArray () const |
| bool | operator== (const LKVector &) const |
| bool | operator!= (const LKVector &) const |
Static Private Member Functions | |
| static int | compare (const void *, const void *) |
Private Attributes | |
| unsigned long | _capacity |
| unsigned long | _size |
| type * | _array |
This class implements a growable array of a special type values Used for determine top distributions
Definition at line 78 of file LKVector.h.
| LKVector::LKVector | ( | unsigned long | capacity = 0, |
| unsigned long | size = 0 |
||
| ) |
Create a vector of type type 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 69 of file LKVector.cpp.
References setSize().
| LKVector::~LKVector | ( | ) | [virtual] |
Definition at line 210 of file LKVector.cpp.
References _array.
| LKVector::LKVector | ( | const LKVector & | obj ) |
Definition at line 75 of file LKVector.cpp.
References _array, _capacity, _size, addValue(), createArray(), sumNonTopDistribLK, sumNonTopDistribWeights, and topDistribsCount.
| void LKVector::addValue | ( | type | v ) |
Appends a real_t data to the end of the vector
| v | the real_t value to add |
Definition at line 128 of file LKVector.cpp.
References _array, _capacity, _size, createArray(), and NULL.
Referenced by LKVector(), and operator=().
| void LKVector::clear | ( | ) |
Definition at line 192 of file LKVector.cpp.
References _size.
| int LKVector::compare | ( | const void * | s1, |
| const void * | s2 | ||
| ) | [static, private] |
Definition at line 175 of file LKVector.cpp.
Referenced by descendingSort().
| LKVector::type * LKVector::createArray | ( | ) | const [private] |
Definition at line 106 of file LKVector.cpp.
References _capacity, and alize::Object::assertMemoryIsAllocated().
Referenced by addValue(), LKVector(), operator=(), pack(), and setSize().
| void LKVector::descendingSort | ( | ) | const |
| LKVector::type * LKVector::getArray | ( | ) | const |
Use this method to access directly to the internal vector
Definition at line 190 of file LKVector.cpp.
References _array.
| String LKVector::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 196 of file LKVector.cpp.
| bool alize::LKVector::operator!= | ( | const LKVector & | ) | const [private] |
Definition at line 91 of file LKVector.cpp.
References _array, _capacity, _size, addValue(), createArray(), sumNonTopDistribLK, sumNonTopDistribWeights, and topDistribsCount.
| bool alize::LKVector::operator== | ( | const LKVector & | ) | const [private] |
| const LKVector::type & LKVector::operator[] | ( | unsigned long | index ) | const |
Definition at line 121 of file LKVector.cpp.
References _array, _size, alize::Object::assertIsInBounds(), and NULL.
| LKVector::type & LKVector::operator[] | ( | unsigned long | index ) |
Overloaded operator[] to access an element in the vector.
| index | index of the element to access |
| IndexOutOfBoundsException |
Definition at line 114 of file LKVector.cpp.
References _array, _size, alize::Object::assertIsInBounds(), and NULL.
| void LKVector::pack | ( | unsigned long | size ) |
modify the capacity of the array
| size | new size |
Definition at line 143 of file LKVector.cpp.
References _array, _capacity, _size, createArray(), and size().
| void LKVector::setSize | ( | unsigned long | size ) |
Set a new size
| size | new size |
Definition at line 158 of file LKVector.cpp.
References _array, _capacity, _size, createArray(), NULL, and size().
Referenced by LKVector().
| unsigned long LKVector::size | ( | ) | const |
| String LKVector::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 198 of file LKVector.cpp.
References _array, _size, and alize::String::valueOf().
type* alize::LKVector::_array [private] |
Definition at line 155 of file LKVector.h.
Referenced by addValue(), descendingSort(), getArray(), LKVector(), operator=(), operator[](), pack(), setSize(), toString(), and ~LKVector().
unsigned long alize::LKVector::_capacity [private] |
Definition at line 153 of file LKVector.h.
Referenced by addValue(), createArray(), LKVector(), operator=(), pack(), and setSize().
unsigned long alize::LKVector::_size [private] |
Definition at line 154 of file LKVector.h.
Referenced by addValue(), clear(), descendingSort(), LKVector(), operator=(), operator[](), pack(), setSize(), size(), and toString().
Definition at line 148 of file LKVector.h.
Referenced by LKVector(), and operator=().
Definition at line 147 of file LKVector.h.
Referenced by LKVector(), and operator=().
| unsigned long alize::LKVector::topDistribsCount |
Definition at line 149 of file LKVector.h.
Referenced by LKVector(), and operator=().
1.7.2