OpenWareLaboratory
FloatArray Class Reference

This class contains useful methods for manipulating arrays of floats. More...

Inheritance diagram for FloatArray:

Public Member Functions

void add (FloatArray operand2, FloatArray destination)
 Element-wise sum between arrays. More...
 
void add (FloatArray operand2)
 Element-wise sum between arrays. More...
 
void add (float scalar)
 Array-scalar sum. More...
 
void clear ()
 Clear the array. More...
 
void clip ()
 Clips the elements in the array in the range [-1, 1]. More...
 
void clip (float range)
 Clips the elements in the array in the range [-**range**, range]. More...
 
void clip (float min, float max)
 Clips the elements in the array in the range [min, max]. More...
 
void convolve (FloatArray operand2, FloatArray destination)
 Convolution between arrays. More...
 
void convolve (FloatArray operand2, FloatArray destination, int offset, size_t samples)
 Partial convolution between arrays. More...
 
void copyFrom (FloatArray source)
 Copies the content of an array into another array. More...
 
void copyFrom (float *source, size_t length)
 Copies an array of float into the array. More...
 
void copyTo (FloatArray destination)
 Copies the content of the array to another array. More...
 
void copyTo (float *destination, size_t length)
 Copies the content of the array to a location in memory. More...
 
void correlate (FloatArray operand2, FloatArray destination)
 Correlation between arrays. More...
 
void correlateInitialized (FloatArray operand2, FloatArray destination)
 Correlation between arrays. More...
 
void decibelToGain (FloatArray destination)
 Convert decibel to gains values: gain = 10^(dB/20) -6dB = 0.5, 0dB = 1.0, +6dB = 2.0. More...
 
bool equals (const FloatArray &other) const
 Compares two arrays. More...
 
 FloatArray ()
 
 FloatArray (float *data, size_t size)
 
void gainToDecibel (FloatArray destination)
 Convert gains to decibel values: dB = log10(gain)*20 Gain 0.5 = -6dB, 1.0 = 0dB, 2.0 = +6dB. More...
 
float * getData ()
 Get the data stored in the FloatArray. More...
 
float getDb ()
 
float getElement (int index)
 Get a single float stored in the FloatArray. More...
 
void getMax (float *value, int *index)
 Get the maximum value in the array and its index. More...
 
int getMaxIndex ()
 Get the index of the maximum value in the array. More...
 
float getMaxValue ()
 Get the maximum value in the array. More...
 
float getMean ()
 Mean of the array. More...
 
void getMin (float *value, int *index)
 Get the minimum value in the array and its index. More...
 
int getMinIndex ()
 Get the index of the minimum value in the array. More...
 
float getMinValue ()
 Get the minimum value in the array. More...
 
float getPower ()
 Power of the array. More...
 
float getRms ()
 Root mean square value of the array. More...
 
size_t getSize () const
 
size_t getSize ()
 
float getStandardDeviation ()
 Standard deviation of the array. More...
 
float getSum ()
 Sum of the array. More...
 
float getVariance ()
 Variance of the array. More...
 
void insert (FloatArray source, int destinationOffset, size_t samples)
 Copies the content of an array into a subset of the array. More...
 
void insert (FloatArray source, int sourceOffset, int destinationOffset, size_t samples)
 Copies the content of an array into a subset of the array. More...
 
void move (int fromIndex, int toIndex, size_t length)
 Copies values within an array. More...
 
void multiply (FloatArray operand2, FloatArray destination)
 Element-wise multiplication between arrays. More...
 
void multiply (FloatArray operand2)
 Element-wise multiplication between arrays. More...
 
void multiply (float scalar)
 Array-scalar multiplication. More...
 
void multiply (float scalar, FloatArray destination)
 Array-scalar multiplication. More...
 
void negate (FloatArray &destination)
 Negate the array. More...
 
void negate ()
 Negate the array. More...
 
void noise ()
 Random values Fills the array with random values in the range [-1, 1) More...
 
void noise (float min, float max)
 Random values in range. More...
 
 operator float * ()
 Casting operator to float*. More...
 
float & operator[] (const int index)
 Allows to index the array using array-style brackets. More...
 
float & operator[] (const int index) const
 Allows to index the array using array-style brackets. More...
 
void ramp (float from, float to)
 Create a linear ramp from one value to another across all values in the Float. More...
 
void reciprocal (FloatArray &destination)
 Reciprocal of the array. More...
 
void reciprocal ()
 Reciprocal of the array. More...
 
void rectify (FloatArray &destination)
 Absolute value of the array. More...
 
void rectify ()
 Absolute value of the array. More...
 
void reverse (FloatArray &destination)
 Reverse the array Copies the elements of the array in reversed order into destination. More...
 
void reverse ()
 Reverse the array. More...
 
void setAll (float value)
 Set all the values in the array. More...
 
void setElement (int index, float value)
 Set a single float in the FloatArray. More...
 
FloatArray subArray (int offset, size_t length)
 A subset of the array. More...
 
void subtract (FloatArray operand2, FloatArray destination)
 Element-wise difference between arrays. More...
 
void subtract (FloatArray operand2)
 Element-wise difference between arrays. More...
 
void subtract (float scalar)
 Array-scalar subtraction. More...
 
void tanh (FloatArray destination)
 Apply tanh to each element in the array. More...
 
void tanh ()
 In-place tanh. More...
 

Static Public Member Functions

static FloatArray create (int size)
 Creates a new FloatArray. More...
 
static void destroy (FloatArray array)
 Destroys a FloatArray created with the create() method. More...
 

Detailed Description

This class contains useful methods for manipulating arrays of floats.

It also provides a convenient handle to the array pointer and the size of the array. FloatArray objects can be passed by value without copying the contents of the array.

Definition at line 11 of file FloatArray.h.

Constructor & Destructor Documentation

FloatArray::FloatArray ( )

Definition at line 6 of file FloatArray.cpp.

Referenced by subArray().

FloatArray::FloatArray ( float *  data,
size_t  size 
)

Definition at line 9 of file FloatArray.cpp.

Member Function Documentation

void FloatArray::add ( FloatArray  operand2,
FloatArray  destination 
)

Element-wise sum between arrays.

Sets each element in destination to the sum of the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the sum
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 297 of file FloatArray.cpp.

References ASSERT.

Referenced by add().

void FloatArray::add ( FloatArray  operand2)

Element-wise sum between arrays.

Adds each element of operand2 to the corresponding element in the array.

Parameters
operand2second operand for the sum
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 313 of file FloatArray.cpp.

References add().

void FloatArray::add ( float  scalar)

Array-scalar sum.

Adds scalar to the values in the array.

Parameters
scalarvalue to be added to the array

Definition at line 318 of file FloatArray.cpp.

void FloatArray::clear ( )
inline

Clear the array.

Set all the values in the array to 0.

Definition at line 31 of file FloatArray.h.

References setAll().

Referenced by FirFilter::create(), and create().

void FloatArray::clip ( )

Clips the elements in the array in the range [-1, 1].

Definition at line 208 of file FloatArray.cpp.

void FloatArray::clip ( float  range)

Clips the elements in the array in the range [-**range**, range].

Parameters
rangeclipping value.

Definition at line 212 of file FloatArray.cpp.

References max.

void FloatArray::clip ( float  min,
float  max 
)

Clips the elements in the array in the range [min, max].

Parameters
minminimum value
maxmaximum value

Definition at line 221 of file FloatArray.cpp.

References max, and min.

void FloatArray::convolve ( FloatArray  operand2,
FloatArray  destination 
)

Convolution between arrays.

Sets destination to the result of the convolution between the array and operand2

Parameters
[in]operand2the second operand for the convolution
[out]destinationarray. It must have a minimum size of this+other-1.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 421 of file FloatArray.cpp.

References ASSERT, and getSize().

Referenced by correlateInitialized().

void FloatArray::convolve ( FloatArray  operand2,
FloatArray  destination,
int  offset,
size_t  samples 
)

Partial convolution between arrays.

Perform partial convolution: start at offset and compute samples values.

Parameters
[in]operand2the second operand for the convolution.
[out]destinationthe destination array.
[in]offsetfirst output sample to compute
[in]samplesnumber of samples to compute
Remarks
destination[n] is left unchanged for n<offset and the result is stored from destination[offset] onwards that is, in the same position where they would be if a full convolution was performed.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 440 of file FloatArray.cpp.

References ASSERT, getData(), and getSize().

void FloatArray::copyFrom ( FloatArray  source)

Copies the content of an array into another array.

Parameters
[in]sourcethe source array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 240 of file FloatArray.cpp.

References getSize(), and min.

Referenced by FilterStage::setCoefficients(), and FirFilter::setCoefficients().

void FloatArray::copyFrom ( float *  source,
size_t  length 
)

Copies an array of float into the array.

Parameters
[in]sourcea pointer to the beginning of the portion of memory to read from.
[in]lengthnumber of samples to copy.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 255 of file FloatArray.cpp.

References ASSERT, and getData().

void FloatArray::copyTo ( FloatArray  destination)

Copies the content of the array to another array.

Parameters
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 235 of file FloatArray.cpp.

References getSize(), and min.

void FloatArray::copyTo ( float *  destination,
size_t  length 
)

Copies the content of the array to a location in memory.

Parameters
[out]destinationa pointer to the beginning of the memory location to copy to. The **length***sizeof(float) bytes of memory starting at this location must have been allocated before calling this method.
[in]lengthnumber of samples to copy
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 245 of file FloatArray.cpp.

References ASSERT, and getData().

void FloatArray::correlate ( FloatArray  operand2,
FloatArray  destination 
)

Correlation between arrays.

Sets destination to the correlation of the array and operand2.

Parameters
[in]operand2the second operand for the correlation
[out]destinationthe destination array. It must have a minimum size of 2*max(srcALen, srcBLen)-1
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 468 of file FloatArray.cpp.

References correlateInitialized(), and setAll().

void FloatArray::correlateInitialized ( FloatArray  operand2,
FloatArray  destination 
)

Correlation between arrays.

Sets destination to the correlation of this array and operand2.

Parameters
[in]operand2the second operand for the correlation
[out]destinationarray. It must have a minimum size of 2*max(srcALen, srcBLen)-1
Remarks
It is the same as correlate(), but destination must have been initialized to 0 in advance.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 473 of file FloatArray.cpp.

References ASSERT, convolve(), and reverse().

Referenced by correlate().

FloatArray FloatArray::create ( int  size)
static

Creates a new FloatArray.

Allocates size*sizeof(float) bytes of memory and returns a FloatArray that points to it.

Parameters
sizethe size of the new FloatArray.
Returns
a FloatArray which data point to the newly allocated memory and size is initialized to the proper value.
Remarks
a FloatArray created with this method has to be destroyed invoking the FloatArray::destroy() method.

Definition at line 519 of file FloatArray.cpp.

References clear().

Referenced by WavetableOscillator::create(), FirFilter::create(), GaussianNoiseOscillator::create(), FourierPitchDetector::init(), and ZeroCrossingPitchDetector::ZeroCrossingPitchDetector().

void FloatArray::decibelToGain ( FloatArray  destination)

Convert decibel to gains values: gain = 10^(dB/20) -6dB = 0.5, 0dB = 1.0, +6dB = 2.0.

Definition at line 495 of file FloatArray.cpp.

References ASSERT, and getSize().

void FloatArray::destroy ( FloatArray  array)
static

Destroys a FloatArray created with the create() method.

Parameters
arraythe FloatArray to be destroyed.
Remarks
the FloatArray object passed as an argument should not be used again after invoking this method.
a FloatArray object that has not been created by the FloatArray::create() method might cause an exception if passed as an argument to this method.

Definition at line 525 of file FloatArray.cpp.

Referenced by WavetableOscillator::destroy(), FirFilter::destroy(), GaussianNoiseOscillator::destroy(), StereoBiquadFilter::destroy(), FourierPitchDetector::~FourierPitchDetector(), and ZeroCrossingPitchDetector::~ZeroCrossingPitchDetector().

bool FloatArray::equals ( const FloatArray other) const
inline

Compares two arrays.

Performs an element-wise comparison of the values contained in the arrays.

Parameters
otherthe array to compare against.
Returns
true if the arrays have the same size and the value of each of the elements of the one match the value of the corresponding element of the other, or false otherwise.

Definition at line 429 of file FloatArray.h.

References getSize().

void FloatArray::gainToDecibel ( FloatArray  destination)

Convert gains to decibel values: dB = log10(gain)*20 Gain 0.5 = -6dB, 1.0 = 0dB, 2.0 = +6dB.

Definition at line 489 of file FloatArray.cpp.

References ASSERT, and getSize().

float* FloatArray::getData ( )
inline

Get the data stored in the FloatArray.

Returns
a float* pointer to the data stored in the FloatArray

Definition at line 453 of file FloatArray.h.

Referenced by Window::apply(), convolve(), copyFrom(), copyTo(), FirFilter::FirFilter(), insert(), negate(), FirFilter::processBlock(), reciprocal(), and rectify().

float FloatArray::getDb ( )
float FloatArray::getElement ( int  index)
inline

Get a single float stored in the FloatArray.

Returns
the float stored at index
Parameters
index

Definition at line 461 of file FloatArray.h.

void FloatArray::getMax ( float *  value,
int *  index 
)

Get the maximum value in the array and its index.

Parameters
[out]valuewill be set to the maximum value after the call
[out]indexwill be set to the index of the maximum value after the call
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 47 of file FloatArray.cpp.

References ASSERT.

Referenced by getMaxIndex(), and getMaxValue().

int FloatArray::getMaxIndex ( )

Get the index of the maximum value in the array.

Returns
the maximum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 75 of file FloatArray.cpp.

References getMax().

Referenced by FourierPitchDetector::computeFrequency().

float FloatArray::getMaxValue ( )

Get the maximum value in the array.

Returns
the maximum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 67 of file FloatArray.cpp.

References getMax().

float FloatArray::getMean ( )

Mean of the array.

Gets the mean (or average) of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 151 of file FloatArray.cpp.

Referenced by ZeroCrossingPitchDetector::getFrequency().

void FloatArray::getMin ( float *  value,
int *  index 
)

Get the minimum value in the array and its index.

Parameters
[out]valuewill be set to the minimum value after the call
[out]indexwill be set to the index of the minimum value after the call
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 12 of file FloatArray.cpp.

Referenced by getMinIndex(), and getMinValue().

int FloatArray::getMinIndex ( )

Get the index of the minimum value in the array.

Returns
the mimimum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 39 of file FloatArray.cpp.

References getMin().

float FloatArray::getMinValue ( )

Get the minimum value in the array.

Returns
the minimum value contained in the array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 31 of file FloatArray.cpp.

References getMin().

float FloatArray::getPower ( )

Power of the array.

Gets the power of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 166 of file FloatArray.cpp.

Referenced by getVariance().

float FloatArray::getRms ( )

Root mean square value of the array.

Gets the root mean square of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 128 of file FloatArray.cpp.

size_t FloatArray::getSize ( )
inline

Definition at line 23 of file FloatArray.h.

float FloatArray::getStandardDeviation ( )

Standard deviation of the array.

Gets the standard deviation of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 181 of file FloatArray.cpp.

References getVariance().

float FloatArray::getSum ( )

Sum of the array.

Gets the sum of the values in the array.

Definition at line 144 of file FloatArray.cpp.

float FloatArray::getVariance ( )

Variance of the array.

Gets the variance of the values in the array.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 192 of file FloatArray.cpp.

References getPower().

Referenced by getStandardDeviation().

void FloatArray::insert ( FloatArray  source,
int  destinationOffset,
size_t  samples 
)

Copies the content of an array into a subset of the array.

Copies samples elements from source to destinationOffset in the current array.

Parameters
[in]sourcethe source array
[in]destinationOffsetthe offset into the destination array
[in]samplesthe number of samples to copy
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 276 of file FloatArray.cpp.

Referenced by FourierPitchDetector::process().

void FloatArray::insert ( FloatArray  source,
int  sourceOffset,
int  destinationOffset,
size_t  samples 
)

Copies the content of an array into a subset of the array.

Copies samples elements starting from sourceOffset of source to destinationOffset in the current array.

Parameters
[in]sourcethe source array
[in]sourceOffsetthe offset into the source array
[in]destinationOffsetthe offset into the destination array
[in]samplesthe number of samples to copy
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 265 of file FloatArray.cpp.

References ASSERT, and getData().

void FloatArray::move ( int  fromIndex,
int  toIndex,
size_t  length 
)

Copies values within an array.

Copies length values starting from index fromIndex to locations starting with index toIndex

Parameters
[in]fromIndexthe first element to copy
[in]toIndexthe destination of the first element
[in]lengththe number of elements to copy
Remarks
this method uses memmove() so that the source memory and the destination memory can overlap. As a consequence it might have slow performances.

Definition at line 281 of file FloatArray.cpp.

References ASSERT.

void FloatArray::multiply ( FloatArray  operand2,
FloatArray  destination 
)

Element-wise multiplication between arrays.

Sets each element in destination to the product of the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the product
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 351 of file FloatArray.cpp.

References ASSERT.

Referenced by PolyBlepOscillator::getSamples(), multiply(), and FourierPitchDetector::process().

void FloatArray::multiply ( FloatArray  operand2)

Element-wise multiplication between arrays.

Multiplies each element in the array by the corresponding element in operand2.

Parameters
operand2second operand for the sum
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 368 of file FloatArray.cpp.

References multiply().

void FloatArray::multiply ( float  scalar)

Array-scalar multiplication.

Multiplies the values in the array by scalar.

Parameters
scalarto be multiplied with the array elements

Definition at line 373 of file FloatArray.cpp.

void FloatArray::multiply ( float  scalar,
FloatArray  destination 
)

Array-scalar multiplication.

Multiplies the values in the array by scalar.

Parameters
scalarto be subtracted from the array
destinationthe destination array

Definition at line 382 of file FloatArray.cpp.

void FloatArray::negate ( FloatArray destination)

Negate the array.

Stores the opposite of the elements in the array into destination.

Parameters
[out]destinationthe destination array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 391 of file FloatArray.cpp.

References getData().

void FloatArray::negate ( )

Negate the array.

Sets each element in the array to its opposite.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 401 of file FloatArray.cpp.

void FloatArray::noise ( )

Random values Fills the array with random values in the range [-1, 1)

Definition at line 406 of file FloatArray.cpp.

void FloatArray::noise ( float  min,
float  max 
)

Random values in range.

Fills the array with random values in the range [min, max)

Parameters
minminimum value in the range
maxmaximum value in the range

Definition at line 410 of file FloatArray.cpp.

References ASSERT, getSize(), and min.

FloatArray::operator float * ( )
inline

Casting operator to float*.

Returns
a float* pointer to the data stored in the FloatArray

Definition at line 445 of file FloatArray.h.

float& FloatArray::operator[] ( const int  index)
inline

Allows to index the array using array-style brackets.

Parameters
indexthe index of the element
Returns
the value of the index element of the array Example usage:
int size=1000;
float content[size];
FloatArray floatArray(content, size);
for(int n=0; n<size; n++)
content[n]==floatArray[n]; //now the FloatArray can be indexed as if it was an array

Definition at line 410 of file FloatArray.h.

float& FloatArray::operator[] ( const int  index) const
inline

Allows to index the array using array-style brackets.

const version of operator[]

Definition at line 418 of file FloatArray.h.

void FloatArray::ramp ( float  from,
float  to 
)

Create a linear ramp from one value to another across all values in the Float.

Definition at line 501 of file FloatArray.cpp.

Referenced by Window::applyTriangularWindow(), and Window::triangular().

void FloatArray::reciprocal ( FloatArray destination)

Reciprocal of the array.

Stores the reciprocal of the elements in the array into destination.

Parameters
[out]destinationthe destination array.

Definition at line 118 of file FloatArray.cpp.

References getData(), and getSize().

void FloatArray::reciprocal ( )

Reciprocal of the array.

Sets each element in the array to its reciprocal.

Definition at line 124 of file FloatArray.cpp.

void FloatArray::rectify ( FloatArray destination)

Absolute value of the array.

Stores the absolute value of the elements in the array into destination.

Parameters
[out]destinationthe destination array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 83 of file FloatArray.cpp.

References getData(), getSize(), and min.

void FloatArray::rectify ( )

Absolute value of the array.

Sets each element in the array to its absolute value.

Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 95 of file FloatArray.cpp.

void FloatArray::reverse ( FloatArray destination)

Reverse the array Copies the elements of the array in reversed order into destination.

Parameters
[out]destinationthe destination array.

Definition at line 100 of file FloatArray.cpp.

References reverse().

Referenced by correlateInitialized().

void FloatArray::reverse ( )

Reverse the array.

Reverses the order of the elements in the array.

Definition at line 110 of file FloatArray.cpp.

Referenced by reverse().

void FloatArray::setAll ( float  value)

Set all the values in the array.

Sets all the elements of the array to value.

Parameters
[in]valueall the elements are set to this value.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 286 of file FloatArray.cpp.

Referenced by clear(), and correlate().

void FloatArray::setElement ( int  index,
float  value 
)
inline

Set a single float in the FloatArray.

Definition at line 468 of file FloatArray.h.

FloatArray FloatArray::subArray ( int  offset,
size_t  length 
)

A subset of the array.

Returns a array that points to subset of the memory used by the original array.

Parameters
[in]offsetthe first element of the subset.
[in]lengththe number of elments in the new FloatArray.
Returns
the newly created FloatArray.
Remarks
no memory is allocated by this method. The memory is still shared with the original array. The memory should not be de-allocated elsewhere (e.g.: by calling FloatArray::destroy() on the original FloatArray) as long as the FloatArray returned by this method is still in use.
Calling FloatArray::destroy() on a FloatArray instance created with this method might cause an exception.

Definition at line 230 of file FloatArray.cpp.

References ASSERT, and FloatArray().

Referenced by FourierPitchDetector::computeFrequency().

void FloatArray::subtract ( FloatArray  operand2,
FloatArray  destination 
)

Element-wise difference between arrays.

Sets each element in destination to the difference between the corresponding element of the array and operand2

Parameters
[in]operand2second operand for the subtraction
[out]destinationthe destination array
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 324 of file FloatArray.cpp.

References ASSERT.

Referenced by subtract().

void FloatArray::subtract ( FloatArray  operand2)

Element-wise difference between arrays.

Subtracts from each element of the array the corresponding element in operand2.

Parameters
[in]operand2second operand for the subtraction
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 340 of file FloatArray.cpp.

References subtract().

void FloatArray::subtract ( float  scalar)

Array-scalar subtraction.

Subtracts scalar from the values in the array.

Parameters
scalarto be subtracted from the array

Definition at line 345 of file FloatArray.cpp.

void FloatArray::tanh ( FloatArray  destination)

Apply tanh to each element in the array.

Definition at line 510 of file FloatArray.cpp.

void FloatArray::tanh ( )

In-place tanh.

Definition at line 515 of file FloatArray.cpp.


The documentation for this class was generated from the following files: