OpenWareLaboratory
|
Public Member Functions | |
void | add (IntArray operand2) |
Element-wise sum between arrays. More... | |
void | add (IntArray operand2, IntArray destination) |
Element-wise sum between arrays. More... | |
void | clear () |
Clear the array. More... | |
void | copyFrom (SimpleArray< int32_t > source) |
Copies the content of another array into this array. More... | |
void | copyTo (SimpleArray< int32_t > destination) |
Copies the content of this array to another array. More... | |
bool | equals (const SimpleArray< int32_t > &other) const |
Compares two arrays. More... | |
void | fromFloat (FloatArray source) |
Copies the content of a FloatArray into a IntArray, converting the float elements to fixed-point 1.31. More... | |
int32_t * | getData () |
Get the data stored in the Array. More... | |
int32_t | getElement (size_t index) |
Get a single value stored in the array. More... | |
float | getFloatValue (uint32_t n) |
Returns an element of the array converted to float. More... | |
size_t | getSize () const |
void | insert (SimpleArray< int32_t > source, int destinationOffset, size_t len) |
Copies the content of an array into a subset of the array. More... | |
void | insert (SimpleArray< int32_t > source, int sourceOffset, int destinationOffset, size_t len) |
Copies the content of an array into a subset of the array. More... | |
IntArray () | |
IntArray (int32_t *data, size_t size) | |
bool | isEmpty () const |
void | move (int fromIndex, int toIndex, size_t len) |
Copies values within an array. More... | |
operator int32_t * () | |
Casting operator to T*. More... | |
void | setAll (int32_t value) |
void | setElement (size_t index, int32_t value) |
Set a single value in the array. More... | |
void | setFloatValue (uint32_t n, float value) |
Converts a float to int16 and stores it. More... | |
void | shift (int shiftValue) |
Bitshift the array values, saturating. More... | |
IntArray | subArray (int offset, size_t length) |
A subset of the array. More... | |
void | toFloat (FloatArray destination) |
Copies the content of the array to a FloatArray, interpreting the content of the IntArray as 1.31. More... | |
Static Public Member Functions | |
static void | copy (int32_t *dst, int32_t *src, size_t len) |
Optimised array copy for datatype T. More... | |
static IntArray | create (int size) |
Creates a new IntArray. More... | |
static void | destroy (IntArray array) |
Destroys a IntArray created with the create() method. More... | |
Protected Attributes | |
int32_t * | data |
size_t | size |
Definition at line 9 of file IntArray.h.
|
inline |
Definition at line 11 of file IntArray.h.
Referenced by subArray().
|
inline |
Definition at line 12 of file IntArray.h.
|
inline |
Element-wise sum between arrays.
Adds each element of operand2 to the corresponding element in the array.
operand2 | second operand for the sum |
Definition at line 57 of file IntArray.h.
References add().
Element-wise sum between arrays.
Sets each element in destination to the sum of the corresponding element of the array and operand2
[in] | operand2 | second operand for the sum |
[out] | destination | the destination array |
Definition at line 40 of file IntArray.h.
References SimpleArray< T >::data, SimpleArray< int32_t >::data, and SimpleArray< int32_t >::size.
Referenced by add().
|
inline |
Clear the array.
Set all the values in the array to 0.
Definition at line 30 of file IntArray.h.
References setAll().
Referenced by create().
|
inlinestaticinherited |
Optimised array copy for datatype T.
Copy four at a time to minimise loop overheads and allow SIMD optimisations. This performs well on external RAM but is slower on internal memory compared to memcpy.
Definition at line 134 of file SimpleArray.h.
|
inlineinherited |
Copies the content of another array into this array.
This array needs to be at least as big as the other array.
[in] | source | the source array |
Definition at line 86 of file SimpleArray.h.
|
inlineinherited |
Copies the content of this array to another array.
The other array needs to be at least as big as this array.
[out] | destination | the destination array |
Definition at line 76 of file SimpleArray.h.
|
inlinestatic |
Creates a new IntArray.
Allocates size*sizeof(int32_t) bytes of memory and returns a IntArray that points to it.
size | the size of the new IntArray. |
Definition at line 159 of file IntArray.h.
References clear(), and SimpleArray< int32_t >::size.
|
inlinestatic |
Destroys a IntArray created with the create() method.
array | the IntArray to be destroyed. |
Definition at line 171 of file IntArray.h.
References SimpleArray< T >::data.
|
inlineinherited |
Compares two arrays.
Performs an element-wise comparison of the values contained in the arrays.
other | the array to compare against. |
Definition at line 61 of file SimpleArray.h.
|
inline |
Copies the content of a FloatArray into a IntArray, converting the float elements to fixed-point 1.31.
[in] | source | the source array |
Definition at line 120 of file IntArray.h.
References ASSERT, SimpleArray< int32_t >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), setFloatValue(), and SimpleArray< int32_t >::size.
|
inlineinherited |
Get the data stored in the Array.
Definition at line 27 of file SimpleArray.h.
|
inlineinherited |
Get a single value stored in the array.
index |
Definition at line 43 of file SimpleArray.h.
|
inline |
Returns an element of the array converted to float.
n | the array element to read. |
Definition at line 148 of file IntArray.h.
References SimpleArray< int32_t >::data.
Referenced by toFloat().
|
inlineinherited |
Definition at line 31 of file SimpleArray.h.
|
inlineinherited |
Copies the content of an array into a subset of the array.
Copies len elements from source to destinationOffset in the current array.
[in] | source | the source array |
[in] | destinationOffset | the offset into the destination array |
[in] | len | the number of samples to copy |
Definition at line 99 of file SimpleArray.h.
|
inlineinherited |
Copies the content of an array into a subset of the array.
Copies len elements starting from sourceOffset of source to destinationOffset in the current array.
[in] | source | the source array |
[in] | sourceOffset | the offset into the source array |
[in] | destinationOffset | the offset into the destination array |
[in] | len | the number of samples to copy |
Definition at line 111 of file SimpleArray.h.
|
inlineinherited |
Definition at line 35 of file SimpleArray.h.
|
inlineinherited |
Copies values within an array.
Copies length values starting from index fromIndex to locations starting with index toIndex
[in] | fromIndex | the first element to copy |
[in] | toIndex | the destination of the first element |
[in] | len | the number of elements to copy |
Definition at line 124 of file SimpleArray.h.
|
inlineinherited |
Casting operator to T*.
Definition at line 157 of file SimpleArray.h.
|
inline |
Definition at line 15 of file IntArray.h.
References SimpleArray< int32_t >::data, and SimpleArray< int32_t >::size.
Referenced by clear().
|
inlineinherited |
Set a single value in the array.
Definition at line 50 of file SimpleArray.h.
|
inline |
Converts a float to int16 and stores it.
n | the array element to write to. @value the value to write |
Definition at line 138 of file IntArray.h.
References SimpleArray< int32_t >::data.
Referenced by fromFloat().
|
inline |
Bitshift the array values, saturating.
shiftValue | number of positions to shift. A positive value will shift left, a negative value will shift right. |
Definition at line 67 of file IntArray.h.
References SimpleArray< int32_t >::data, and SimpleArray< int32_t >::size.
|
inline |
A subset of the array.
Returns a array that points to subset of the memory used by the original array.
[in] | offset | the first element of the subset. |
[in] | length | the number of elments in the new IntArray. |
Definition at line 93 of file IntArray.h.
References ASSERT, SimpleArray< int32_t >::data, IntArray(), and SimpleArray< int32_t >::size.
|
inline |
Copies the content of the array to a FloatArray, interpreting the content of the IntArray as 1.31.
[out] | destination | the destination array |
Definition at line 104 of file IntArray.h.
References ASSERT, SimpleArray< int32_t >::data, SimpleArray< T >::getData(), getFloatValue(), SimpleArray< T >::getSize(), and SimpleArray< int32_t >::size.
|
protectedinherited |
Definition at line 16 of file SimpleArray.h.
|
protectedinherited |
Definition at line 17 of file SimpleArray.h.