PoolRealArray¶
A pooled Array of reals (float).
Descripción¶
An Array specifically designed to hold floating-point values. Optimized for memory usage, does not fragment the memory.
Note: This type is passed by value and not by reference.
Note: Unlike primitive floats which are 64-bit, numbers stored in PoolRealArray
are 32-bit floats. This means values stored in PoolRealArray
have lower precision compared to primitive floats. If you need to store 64-bit floats in an array, use a generic Array with float elements as these will still be 64-bit. However, using a generic Array to store floats will use roughly 6 times more memory compared to a PoolRealArray
.
Métodos¶
PoolRealArray ( Array from ) |
|
void |
|
void |
append_array ( PoolRealArray array ) |
empty ( ) |
|
void |
invert ( ) |
void |
|
void |
|
void |
|
void |
|
size ( ) |
Descripciones de Métodos¶
PoolRealArray PoolRealArray ( Array from )
Constructs a new PoolRealArray
. Optionally, you can pass in a generic Array that will be converted.
void append ( float value )
Concatena un elemento al final del array (alias de push_back).
void append_array ( PoolRealArray array )
Appends a PoolRealArray
at the end of this array.
bool empty ( )
Devuelve true
si el array es vacio.
Inserta un nuevo elemento en una posición determinada del array. La posición debe ser válida, o al final del array (idx == size()
).
void invert ( )
Invierte el orden de los elementos en el array.
void push_back ( float value )
Concatena un elemen al final del array.
void remove ( int idx )
Elimina un elemento del array por indice.
void resize ( int idx )
Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size.
Note: Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values.
Cambia el real en el índice dado.
int size ( )
Devuelve el tamaño del array.