|
|
static long | vDefaultLength = 16 |
| |
|
static long | vDefaultBoost = 16 |
| |
◆ Vector()
Initializes an empty vector of long values with a default initial capacity.
◆ ~Vector()
Frees the memory allocated for the vector data.
◆ appendValue()
| void Vector::appendValue |
( |
const long |
l | ) |
|
Appends a value to the Vector.
Adds a long value to the end of the vector, growing the vector if needed.
- Parameters
-
| l | The long value to append. |
◆ appendVector()
| void Vector::appendVector |
( |
const Vector & |
v | ) |
|
Appends the contents of another Vector to this Vector.
- Parameters
-
| v | The source Vector whose contents are to be appended. |
◆ extractMin()
| long Vector::extractMin |
( |
VectorFP & |
values | ) |
|
Extracts the minimum value from the vector based on a VectorFP of floating-point values.
- Parameters
-
| values | The VectorFP of floating-point values to compare. |
- Returns
- The index of the minimum value, or
-1 if the vector is empty.
◆ remove()
| void Vector::remove |
( |
const unsigned long |
l | ) |
|
Removes the element at the given index and shifts the remaining elements to fill the gap.
- Parameters
-
| l | The index of the element to remove. |
◆ resetVector()
| void Vector::resetVector |
( |
void |
| ) |
|
Resets the Vector to an empty state.
Clears the vector by resetting its length, but keeps the allocated memory.
◆ sort()
| void Vector::sort |
( |
void |
| ) |
|
Sorts the Vector in ascending order.
◆ storeValue()
| void Vector::storeValue |
( |
const long |
v, |
|
|
const unsigned long |
l |
|
) |
| |
Stores a value at a specific index in the Vector.
If the index is beyond the current capacity, the vector grows to accommodate the value.
- Parameters
-
| v | The long value to store. |
| l | The index at which to store the value. |
◆ storeVector()
| void Vector::storeVector |
( |
const Vector & |
v, |
|
|
const unsigned long |
l |
|
) |
| |
Stores a pointer to a Vector at a specified index, growing the vector if necessary.
- Parameters
-
| v | The Vector object to store. |
| l | The index at which to store the vector. |
◆ swap()
| void Vector::swap |
( |
Vector & |
src | ) |
|
Swaps the contents of this Vector with another Vector.
Exchanges the data, length, and capacity of two Vector objects.
- Parameters
-
| src | The Vector object to swap with. |
◆ value()
| long Vector::value |
( |
const long |
idx | ) |
const |
Retrieves a value from the Vector at the specified index.
- Parameters
-
| idx | The index from which to retrieve the value. |
- Returns
- The value stored at the specified index.
The documentation for this class was generated from the following files: