OpenWareLaboratory
|
This class contains useful methods for manipulating arrays of floats. More...
Public Member Functions | |
void | add (float scalar) |
In-place array-scalar addition. More... | |
void | add (float scalar, FloatArray destination) |
Array-scalar addition. More... | |
void | add (FloatArray operand2) |
Element-wise sum between arrays. More... | |
void | add (FloatArray operand2, FloatArray destination) |
Element-wise sum between arrays. More... | |
void | clear () |
Clear the array. More... | |
void | clip () |
Clips the elements in the array in the range [-1, 1]. More... | |
void | clip (float min, float max) |
Clips the elements in the array in the range [min, max]. More... | |
void | clip (float range) |
Clips the elements in the array in the range [-**range**, range]. 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 (SimpleArray< float > source) |
Copies the content of another array into this array. More... | |
void | copyTo (SimpleArray< float > destination) |
Copies the content of this array to another array. 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 SimpleArray< float > &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 Array. More... | |
float | getElement (size_t index) |
Get a single value stored in the array. 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 |
float | getStandardDeviation () |
Standard deviation of the array. More... | |
float | getSum () |
Sum of the array. More... | |
float | getVariance () |
Variance of the array. More... | |
void | insert (SimpleArray< float > source, int destinationOffset, size_t len) |
Copies the content of an array into a subset of the array. More... | |
void | insert (SimpleArray< float > source, int sourceOffset, int destinationOffset, size_t len) |
Copies the content of an array into a subset of the array. More... | |
bool | isEmpty () const |
void | move (int fromIndex, int toIndex, size_t len) |
Copies values within an array. More... | |
void | multiply (float scalar) |
Array-scalar multiplication. More... | |
void | multiply (float scalar, FloatArray destination) |
Array-scalar multiplication. More... | |
void | multiply (FloatArray operand2) |
Element-wise multiplication between arrays. More... | |
void | multiply (FloatArray operand2, FloatArray destination) |
Element-wise multiplication between arrays. More... | |
void | negate () |
Negate the array. More... | |
void | negate (FloatArray &destination) |
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 T*. More... | |
void | ramp (float from, float to) |
Create a linear ramp from one value to another. More... | |
void | reciprocal () |
Reciprocal of the array, in-place version. More... | |
void | reciprocal (FloatArray &destination) |
Reciprocal of the array. More... | |
void | rectify () |
Absolute value of the array, in-place version. More... | |
void | rectify (FloatArray &destination) |
Absolute value of the array. More... | |
void | reverse () |
Reverse the array. More... | |
void | reverse (FloatArray &destination) |
Reverse the array Copies the elements of the array in reversed order into destination. More... | |
void | scale (float from, float to) |
In-place scale. More... | |
void | scale (float from, float to, FloatArray destination) |
Scale all values along a linear ramp from one value to another. More... | |
void | setAll (float value) |
Set all the values in the array. More... | |
void | setElement (size_t index, float value) |
Set a single value in the array. More... | |
void | softclip () |
Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1] In-place version. More... | |
void | softclip (FloatArray destination) |
Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1]. More... | |
FloatArray | subArray (int offset, size_t length) |
A subset of the array. More... | |
void | subtract (float scalar) |
Array-scalar subtraction. More... | |
void | subtract (FloatArray operand2) |
Element-wise difference between arrays. More... | |
void | subtract (FloatArray operand2, FloatArray destination) |
Element-wise difference between arrays. More... | |
void | tanh () |
In-place tanh. More... | |
void | tanh (FloatArray destination) |
Apply tanh to each element in the array. More... | |
Static Public Member Functions | |
static void | copy (float *dst, float *src, size_t len) |
Optimised array copy for datatype T. More... | |
static FloatArray | create (int size) |
Creates a new FloatArray. More... | |
static void | destroy (FloatArray array) |
Destroys a FloatArray created with the create() method. More... | |
Protected Attributes | |
float * | data |
size_t | size |
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 12 of file FloatArray.h.
|
inline |
Definition at line 14 of file FloatArray.h.
Referenced by subArray().
|
inline |
Definition at line 15 of file FloatArray.h.
void FloatArray::add | ( | float | scalar | ) |
In-place array-scalar addition.
Adds scalar to each value in the array
[in] | scalar | value to be added to the array |
Definition at line 252 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
void FloatArray::add | ( | float | scalar, |
FloatArray | destination | ||
) |
Array-scalar addition.
Adds scalar to each value in the array and put the result in destination
[in] | scalar | value to be added to the array |
[out] | destination | the destination array |
Definition at line 258 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
void FloatArray::add | ( | FloatArray | operand2 | ) |
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 247 of file FloatArray.cpp.
References add().
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
[in] | operand2 | second operand for the sum |
[out] | destination | the destination array |
Definition at line 231 of file FloatArray.cpp.
References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.
Referenced by AudioBuffer::add(), add(), CrossFadingCircularBuffer< T >::delay(), MorphingOscillator::generate(), VoiceAllocatorSignalGenerator< Allocator, SynthVoice, VOICES >::generate(), PolyBlepOscillator::generate(), StereoFeedbackProcessor::process(), PingPongFeedbackProcessor::process(), DryWetSignalProcessor< Processor >::process(), FeedbackSignalProcessor< Processor >::process(), and VoiceAllocatorSignalProcessor< Allocator, SynthVoice, VOICES >::process().
|
inline |
Clear the array.
Set all the values in the array to 0.
Definition at line 29 of file FloatArray.h.
References setAll().
Referenced by create(), FirFilter::create(), UpSampler::process(), and SimpleMovingAverage::reset().
void FloatArray::clip | ( | ) |
Clips the elements in the array in the range [-1, 1].
Definition at line 193 of file FloatArray.cpp.
void FloatArray::clip | ( | float | min, |
float | max | ||
) |
Clips the elements in the array in the range [min, max].
min | minimum value |
max | maximum value |
Definition at line 206 of file FloatArray.cpp.
References SimpleArray< float >::data, max, min, and SimpleArray< float >::size.
void FloatArray::clip | ( | float | range | ) |
Clips the elements in the array in the range [-**range**, range].
range | clipping value. |
Definition at line 197 of file FloatArray.cpp.
References SimpleArray< float >::data, max, and SimpleArray< float >::size.
void FloatArray::convolve | ( | FloatArray | operand2, |
FloatArray | destination | ||
) |
Convolution between arrays.
Sets destination to the result of the convolution between the array and operand2
[in] | operand2 | the second operand for the convolution |
[out] | destination | array. It must have a minimum size of this+other-1. |
Definition at line 352 of file FloatArray.cpp.
References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< T >::getSize(), SimpleArray< float >::size, and SimpleArray< T >::size.
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.
[in] | operand2 | the second operand for the convolution. |
[out] | destination | the destination array. |
[in] | offset | first output sample to compute |
[in] | samples | number of samples to compute |
Definition at line 370 of file FloatArray.cpp.
References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), SimpleArray< float >::size, and SimpleArray< T >::size.
|
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.
void FloatArray::correlate | ( | FloatArray | operand2, |
FloatArray | destination | ||
) |
Correlation between arrays.
Sets destination to the correlation of the array and operand2.
[in] | operand2 | the second operand for the correlation |
[out] | destination | the destination array. It must have a minimum size of 2*max(srcALen, srcBLen)-1 |
Definition at line 398 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.
[in] | operand2 | the second operand for the correlation |
[out] | destination | array. It must have a minimum size of 2*max(srcALen, srcBLen)-1 |
Definition at line 404 of file FloatArray.cpp.
References ASSERT, convolve(), SimpleArray< T >::data, SimpleArray< float >::data, reverse(), SimpleArray< float >::size, and SimpleArray< T >::size.
Referenced by correlate().
|
static |
Creates a new FloatArray.
Allocates size*sizeof(float) bytes of memory and returns a FloatArray that points to it.
size | the size of the new FloatArray. |
Definition at line 466 of file FloatArray.cpp.
References clear(), and SimpleArray< float >::size.
Referenced by InterpolatingWavetableOscillator< im >::create(), SimpleMovingAverage::create(), GaussianNoiseGenerator::create(), StereoFeedbackProcessor::create(), PingPongFeedbackProcessor::create(), VoiceAllocatorSignalGenerator< Allocator, SynthVoice, VOICES >::create(), VoiceAllocatorSignalProcessor< Allocator, SynthVoice, VOICES >::create(), DryWetSignalProcessor< Processor >::create(), FeedbackSignalProcessor< Processor >::create(), CrossFadingCircularBuffer< T >::create(), MorphingOscillator::create(), FirFilter::create(), WavFile::createFloatArray(), 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 426 of file FloatArray.cpp.
References ASSERT, SimpleArray< float >::data, SimpleArray< T >::getSize(), and SimpleArray< float >::size.
|
static |
Destroys a FloatArray created with the create() method.
array | the FloatArray to be destroyed. |
Definition at line 472 of file FloatArray.cpp.
References SimpleArray< T >::data.
Referenced by CrossFadingCircularBuffer< T >::destroy(), DryWetSignalProcessor< Processor >::destroy(), FeedbackSignalProcessor< Processor >::destroy(), FirFilter::destroy(), GaussianNoiseGenerator::destroy(), InterpolatingWavetableOscillator< im >::destroy(), KaiserWindow::destroy(), MorphingOscillator::destroy(), VoiceAllocatorSignalGenerator< Allocator, SynthVoice, VOICES >::destroy(), VoiceAllocatorSignalProcessor< Allocator, SynthVoice, VOICES >::destroy(), PingPongFeedbackProcessor::destroy(), SimpleMovingAverage::destroy(), StereoFeedbackProcessor::destroy(), FourierPitchDetector::~FourierPitchDetector(), and ZeroCrossingPitchDetector::~ZeroCrossingPitchDetector().
|
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.
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 420 of file FloatArray.cpp.
References ASSERT, SimpleArray< float >::data, SimpleArray< T >::getSize(), and SimpleArray< float >::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.
void FloatArray::getMax | ( | float * | value, |
int * | index | ||
) |
Get the maximum value in the array and its index.
[out] | value | will be set to the maximum value after the call |
[out] | index | will be set to the index of the maximum value after the call |
Definition at line 41 of file FloatArray.cpp.
References ASSERT, SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by getMaxIndex(), and getMaxValue().
int FloatArray::getMaxIndex | ( | ) |
Get the index of the maximum value in the array.
Definition at line 69 of file FloatArray.cpp.
References getMax().
Referenced by FourierPitchDetector::computeFrequency().
float FloatArray::getMaxValue | ( | ) |
Get the maximum value in the array.
Definition at line 61 of file FloatArray.cpp.
References getMax().
float FloatArray::getMean | ( | ) |
Mean of the array.
Gets the mean (or average) of the values in the array.
Definition at line 136 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by ZeroCrossingPitchDetector::getFrequency().
void FloatArray::getMin | ( | float * | value, |
int * | index | ||
) |
Get the minimum value in the array and its index.
[out] | value | will be set to the minimum value after the call |
[out] | index | will be set to the index of the minimum value after the call |
Definition at line 6 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by getMinIndex(), and getMinValue().
int FloatArray::getMinIndex | ( | ) |
Get the index of the minimum value in the array.
Definition at line 33 of file FloatArray.cpp.
References getMin().
float FloatArray::getMinValue | ( | ) |
Get the minimum value in the array.
Definition at line 25 of file FloatArray.cpp.
References getMin().
float FloatArray::getPower | ( | ) |
Power of the array.
Gets the power of the values in the array.
Definition at line 151 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by getVariance().
float FloatArray::getRms | ( | ) |
Root mean square value of the array.
Gets the root mean square of the values in the array.
Definition at line 113 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
|
inlineinherited |
Definition at line 31 of file SimpleArray.h.
float FloatArray::getStandardDeviation | ( | ) |
Standard deviation of the array.
Gets the standard deviation of the values in the array.
Definition at line 166 of file FloatArray.cpp.
References SimpleArray< float >::data, getVariance(), and SimpleArray< float >::size.
float FloatArray::getSum | ( | ) |
Sum of the array.
Gets the sum of the values in the array.
Definition at line 129 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
float FloatArray::getVariance | ( | ) |
Variance of the array.
Gets the variance of the values in the array.
Definition at line 177 of file FloatArray.cpp.
References SimpleArray< float >::data, getPower(), and SimpleArray< float >::size.
Referenced by getStandardDeviation().
|
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.
void FloatArray::multiply | ( | float | scalar | ) |
Array-scalar multiplication.
Multiplies the values in the array by scalar.
scalar | to be multiplied with the array elements |
Definition at line 312 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
void FloatArray::multiply | ( | float | scalar, |
FloatArray | destination | ||
) |
Array-scalar multiplication.
Multiplies the values in the array by scalar.
scalar | to be subtracted from the array |
destination | the destination array |
Definition at line 321 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
void FloatArray::multiply | ( | FloatArray | operand2 | ) |
Element-wise multiplication between arrays.
Multiplies each element in the array by the corresponding element in operand2.
operand2 | second operand for the sum |
Definition at line 307 of file FloatArray.cpp.
References multiply().
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
[in] | operand2 | second operand for the product |
[out] | destination | the destination array |
Definition at line 290 of file FloatArray.cpp.
References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.
Referenced by MorphingOscillator::generate(), PolyBlepOscillator::generate(), PolyBlepOscillator::getSamples(), AudioBuffer::multiply(), multiply(), StereoFeedbackProcessor::process(), PingPongFeedbackProcessor::process(), FourierPitchDetector::process(), DryWetSignalProcessor< Processor >::process(), and FeedbackSignalProcessor< Processor >::process().
|
inline |
Negate the array.
Sets each element in the array to its opposite.
Definition at line 127 of file FloatArray.h.
void FloatArray::negate | ( | FloatArray & | destination | ) |
Negate the array.
Stores the opposite of the elements in the array into destination.
[out] | destination | the destination array. |
Definition at line 330 of file FloatArray.cpp.
References SimpleArray< float >::data, SimpleArray< T >::getData(), and SimpleArray< float >::size.
void FloatArray::noise | ( | ) |
Random values Fills the array with random values in the range [-1, 1)
Definition at line 340 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)
min | minimum value in the range |
max | maximum value in the range |
Definition at line 344 of file FloatArray.cpp.
References SimpleArray< float >::data, max, min, randf(), and SimpleArray< float >::size.
|
inlineinherited |
Casting operator to T*.
Definition at line 157 of file SimpleArray.h.
void FloatArray::ramp | ( | float | from, |
float | to | ||
) |
Create a linear ramp from one value to another.
Interpolates all samples in the FloatArray between the endpoints from to to.
Definition at line 432 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by Window::applyTriangularWindow(), and Window::triangular().
|
inline |
Reciprocal of the array, in-place version.
Sets each element in the array to its reciprocal.
Definition at line 111 of file FloatArray.h.
void FloatArray::reciprocal | ( | FloatArray & | destination | ) |
Reciprocal of the array.
Stores the reciprocal of the elements in the array into destination.
[out] | destination | the destination array. |
Definition at line 107 of file FloatArray.cpp.
References SimpleArray< float >::data, SimpleArray< float >::getData(), and SimpleArray< float >::getSize().
|
inline |
Absolute value of the array, in-place version.
Sets each element in the array to its absolute value.
Definition at line 83 of file FloatArray.h.
void FloatArray::rectify | ( | FloatArray & | destination | ) |
Absolute value of the array.
Stores the absolute value of the elements in the array into destination.
[out] | destination | the destination array. |
Definition at line 77 of file FloatArray.cpp.
References SimpleArray< float >::data, SimpleArray< T >::getData(), SimpleArray< T >::getSize(), min, and SimpleArray< float >::size.
void FloatArray::reverse | ( | ) |
Reverse the array.
Reverses the order of the elements in the array.
Definition at line 99 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by reverse().
void FloatArray::reverse | ( | FloatArray & | destination | ) |
Reverse the array Copies the elements of the array in reversed order into destination.
[out] | destination | the destination array. |
Definition at line 89 of file FloatArray.cpp.
References SimpleArray< float >::data, reverse(), and SimpleArray< float >::size.
Referenced by correlateInitialized().
|
inline |
void FloatArray::scale | ( | float | from, |
float | to, | ||
FloatArray | destination | ||
) |
Scale all values along a linear ramp from one value to another.
Definition at line 440 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by CrossFadingCircularBuffer< T >::delay(), and scale().
void FloatArray::setAll | ( | float | value | ) |
Set all the values in the array.
Sets all the elements of the array to value.
[in] | value | all the elements are set to this value. |
Definition at line 220 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
Referenced by clear(), correlate(), InterpolatingSignalGenerator< im >::generate(), and SimpleMovingAverage::set().
|
inlineinherited |
Set a single value in the array.
Definition at line 50 of file SimpleArray.h.
|
inline |
Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1] In-place version.
Definition at line 209 of file FloatArray.h.
void FloatArray::softclip | ( | FloatArray | destination | ) |
Applies a cubic soft-clip algorithm to all elements in the array which limits them to the range [-1, 1].
[out] | destination | the destination array |
Definition at line 454 of file FloatArray.cpp.
References clamp, SimpleArray< float >::data, and SimpleArray< float >::size.
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.
[in] | offset | the first element of the subset. |
[in] | length | the number of elments in the new FloatArray. |
Definition at line 215 of file FloatArray.cpp.
References ASSERT, SimpleArray< float >::data, FloatArray(), and SimpleArray< float >::size.
Referenced by FourierPitchDetector::computeFrequency().
void FloatArray::subtract | ( | float | scalar | ) |
Array-scalar subtraction.
Subtracts scalar from the values in the array.
scalar | to be subtracted from the array |
Definition at line 284 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
void FloatArray::subtract | ( | FloatArray | operand2 | ) |
Element-wise difference between arrays.
Subtracts from each element of the array the corresponding element in operand2.
[in] | operand2 | second operand for the subtraction |
Definition at line 279 of file FloatArray.cpp.
References subtract().
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
[in] | operand2 | second operand for the subtraction |
[out] | destination | the destination array |
Definition at line 263 of file FloatArray.cpp.
References ASSERT, SimpleArray< T >::data, SimpleArray< float >::data, SimpleArray< float >::size, and SimpleArray< T >::size.
Referenced by subtract().
|
inline |
In-place tanh.
Definition at line 386 of file FloatArray.h.
void FloatArray::tanh | ( | FloatArray | destination | ) |
Apply tanh to each element in the array.
Definition at line 461 of file FloatArray.cpp.
References SimpleArray< float >::data, and SimpleArray< float >::size.
|
protectedinherited |
Definition at line 16 of file SimpleArray.h.
|
protectedinherited |
Definition at line 17 of file SimpleArray.h.