20 for(
size_t n=0; n<
size; n++){
46 for(
size_t n=0; n<
size; n++){
47 destination[n]=
data[n]+operand2[n];
72 for(
size_t n=0; n<
size; n++)
75 shiftValue = -shiftValue;
76 for(
size_t n=0; n<
size; n++)
94 ASSERT(
size >= offset+length,
"Array too small");
110 for(
size_t n = 0; n <
size; ++n)
126 for(
size_t n = 0; n <
size; ++n){
139 data[n] = (int32_t)(value * -(
float)INT_MIN);
149 return data[n] / -(float)INT_MIN;
This class contains useful methods for manipulating arrays of floats.
void setFloatValue(uint32_t n, float value)
Converts a float to int16 and stores it.
void setAll(int32_t value)
IntArray subArray(int offset, size_t length)
A subset of the array.
void clear()
Clear the array.
static IntArray create(int size)
Creates a new IntArray.
void shift(int shiftValue)
Bitshift the array values, saturating.
float getFloatValue(uint32_t n)
Returns an element of the array converted to float.
void add(IntArray operand2)
Element-wise sum between arrays.
void add(IntArray operand2, IntArray destination)
Element-wise sum between arrays.
void toFloat(FloatArray destination)
Copies the content of the array to a FloatArray, interpreting the content of the IntArray as 1....
void fromFloat(FloatArray source)
Copies the content of a FloatArray into a IntArray, converting the float elements to fixed-point 1....
IntArray(int32_t *data, size_t size)
static void destroy(IntArray array)
Destroys a IntArray created with the create() method.
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value.
T * getData()
Get the data stored in the Array.
#define ASSERT(cond, msg)