OpenWareLaboratory
|
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value. More...
Public Member Functions | |
void | copyFrom (SimpleArray< T > source) |
Copies the content of another array into this array. More... | |
void | copyTo (SimpleArray< T > destination) |
Copies the content of this array to another array. More... | |
bool | equals (const SimpleArray< T > &other) const |
Compares two arrays. More... | |
T * | getData () |
Get the data stored in the Array. More... | |
T | getElement (size_t index) |
Get a single value stored in the array. More... | |
size_t | getSize () const |
void | insert (SimpleArray< T > source, int destinationOffset, size_t len) |
Copies the content of an array into a subset of the array. More... | |
void | insert (SimpleArray< T > 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... | |
operator T* () | |
Casting operator to T*. More... | |
void | setElement (size_t index, T value) |
Set a single value in the array. More... | |
SimpleArray () | |
SimpleArray (T *data, size_t size) | |
Static Public Member Functions | |
static void | copy (T *dst, T *src, size_t len) |
Optimised array copy for datatype T. More... | |
Protected Attributes | |
T * | data |
size_t | size |
SimpleArray holds a pointer to an array and the array size, and is designed to be passed by value.
It does not define any virtual methods to prevent overheads in its subclasses.
Definition at line 14 of file SimpleArray.h.
|
inline |
Definition at line 19 of file SimpleArray.h.
|
inline |
Definition at line 20 of file SimpleArray.h.
|
inlinestatic |
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.
|
inline |
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.
References ASSERT, SimpleArray< T >::data, and SimpleArray< T >::size.
Referenced by FilterStage::copyCoefficients(), FirFilter::copyCoefficients(), AudioBuffer::copyFrom(), BiquadFilter::copyState(), FirFilter::copyState(), PolyBlepOscillator::generate(), StereoFeedbackProcessor::process(), PingPongFeedbackProcessor::process(), DryWetSignalProcessor< Processor >::process(), and FeedbackSignalProcessor< Processor >::process().
|
inline |
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.
References ASSERT, SimpleArray< T >::data, and SimpleArray< T >::size.
Referenced by AudioBuffer::copyTo().
|
inline |
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.
References SimpleArray< T >::data, and SimpleArray< T >::size.
|
inline |
Get the data stored in the Array.
Definition at line 27 of file SimpleArray.h.
References SimpleArray< T >::data.
Referenced by ComplexFloatArray::add(), KaiserWindow::buildTimeDerivativeWindow(), KaiserWindow::buildWindow(), ComplexFloatArray::complexByComplexMultiplication(), ComplexShortArray::complexByComplexMultiplication(), ComplexFloatArray::complexByRealMultiplication(), ComplexFloatArray::complexDotProduct(), FloatArray::convolve(), ShortArray::convolve(), CrossFadingCircularBuffer< T >::delay(), ComplexFourierTransform::fft(), FastFourierTransform::fft(), ShortFastFourierTransform::fft(), FirFilter::FirFilter(), IntArray::fromFloat(), InterpolatingSignalGenerator< im >::generate(), AntialiasedSquareWaveOscillator::generate(), VosimOscillator::generate(), ComplexFloatArray::getComplexConjugateValues(), ComplexFourierTransform::ifft(), FastFourierTransform::ifft(), ShortFastFourierTransform::ifft(), FloatArray::negate(), ShortArray::negate(), FirFilter::process(), EnvelopeFollower::process(), FloatArray::rectify(), ShortArray::rectify(), BiquadFilter::setCoefficients(), ComplexFloatArray::setMagnitude(), ComplexFloatArray::setPhase(), BiquadFilter::setState(), InterpolatingWavetableOscillator< im >::setWavetable(), ComplexFloatArray::subtract(), and IntArray::toFloat().
|
inline |
Get a single value stored in the array.
index |
Definition at line 43 of file SimpleArray.h.
References SimpleArray< T >::data.
|
inline |
Definition at line 31 of file SimpleArray.h.
References SimpleArray< T >::size.
Referenced by KaiserWindow::buildTimeDerivativeWindow(), KaiserWindow::buildWindow(), ComplexFloatArray::complexByRealMultiplication(), FourierPitchDetector::computeFrequency(), FloatArray::convolve(), ShortArray::convolve(), FilterStage::copyCoefficients(), BiquadFilter::copyCoefficients(), FirFilter::copyCoefficients(), BiquadFilter::copyState(), FirFilter::copyState(), GaussianNoiseGenerator::create(), FloatArray::decibelToGain(), CrossFadingCircularBuffer< T >::delay(), Resampler::downsample(), ComplexFourierTransform::fft(), FastFourierTransform::fft(), ShortFastFourierTransform::fft(), SampleOscillator< im >::findZeroCrossing(), FirFilter::FirFilter(), ComplexFloatArray::fromFloat(), IntArray::fromFloat(), ShortArray::fromFloat(), FloatArray::gainToDecibel(), GaussianNoiseGenerator::generate(), QuadratureSineOscillator::generate(), FeedbackQuadratureSineOscillator::generate(), ComplexFeedbackQuadratureSineOscillator::generate(), ComplexSignalGenerator::generate(), ComplexOscillator::generate(), InterpolatingSignalGenerator< im >::generate(), PolyBlepOscillator::generate(), AntialiasedRampOscillator::generate(), SampleOscillator< im >::generate(), SignalGenerator::generate(), SineOscillator::generate(), AntialiasedSquareWaveOscillator::generate(), VosimOscillator::generate(), Oscillator::generate(), SimpleMovingAverage::getAverage(), ComplexFloatArray::getComplexConjugateValues(), VoltsPerOctave::getFrequency(), ComplexFloatArray::getMagnitudeSquaredValues(), ComplexShortArray::getMagnitudeSquaredValues(), SimpleMovingAverage::getNextAverage(), SimpleMovingAverage::getNextSum(), ComplexFloatArray::getPhaseValues(), ComplexFloatArray::getPolar(), WavetableOscillator::getSample(), AntialiasedWavetableOscillator::getSample(), VoltsPerOctave::getSample(), SampleOscillator< im >::getSampleLength(), PolyBlepOscillator::getSamples(), ComplexFourierTransform::getSize(), FastFourierTransform::getSize(), SimpleMovingAverage::getSize(), ShortFastFourierTransform::getSize(), ComplexFourierTransform::ifft(), FastFourierTransform::ifft(), ShortFastFourierTransform::ifft(), MultiStateVariableFilter::process(), InterpolatedCompositeTransform< matrix_order >::process(), ComplexSignalProcessor::process(), FirFilter::process(), BiquadFilter::process(), DcBlockingFilter::process(), SmoothingFilter::process(), EnvelopeFollower::process(), ExponentialMovingAverage::process(), SimpleMovingAverage::process(), FourierPitchDetector::process(), ZeroCrossingPitchDetector::process(), DelayProcessor::process(), FractionalDelayProcessor< im >::process(), CrossFadingDelayProcessor::process(), Envelope::process(), UpSampler::process(), DownSampler::process(), SignalProcessor::process(), StateVariableFilter::process(), BiquadFilter::processAllPass(), BiquadFilter::processBandPass(), StateVariableFilter::processBandPass(), BiquadFilter::processHighPass(), StateVariableFilter::processHighPass(), StateVariableFilter::processLowBandHighPass(), BiquadFilter::processLowPass(), StateVariableFilter::processLowPass(), WavFile::read(), FloatArray::rectify(), ShortArray::rectify(), SimpleMovingAverage::set(), BiquadFilter::setCoefficients(), ComplexFloatArray::setMagnitude(), ComplexFloatArray::setPhase(), SampleOscillator< im >::setSample(), BiquadFilter::setState(), InterpolatingWavetableOscillator< im >::setWavetable(), FastFractionalDelayProcessor::smooth(), ComplexFloatArray::toFloat(), IntArray::toFloat(), ShortArray::toFloat(), and Resampler::upsample().
|
inline |
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.
Referenced by FourierPitchDetector::process().
|
inline |
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.
References ASSERT, SimpleArray< T >::data, and SimpleArray< T >::size.
|
inline |
Definition at line 35 of file SimpleArray.h.
References SimpleArray< T >::size.
|
inline |
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.
References ASSERT, SimpleArray< T >::data, and SimpleArray< T >::size.
|
inline |
Casting operator to T*.
Definition at line 157 of file SimpleArray.h.
|
inline |
Set a single value in the array.
Definition at line 50 of file SimpleArray.h.
References SimpleArray< T >::data.
|
protected |
Definition at line 16 of file SimpleArray.h.
Referenced by ComplexShortArray::add(), FloatArray::add(), IntArray::add(), ShortArray::add(), FloatArray::convolve(), ShortArray::convolve(), SimpleArray< T >::copyFrom(), SimpleArray< T >::copyTo(), FloatArray::correlateInitialized(), ShortArray::correlateInitialized(), ComplexFloatArray::destroy(), ComplexShortArray::destroy(), FloatArray::destroy(), IntArray::destroy(), ShortArray::destroy(), SimpleArray< T >::equals(), SimpleArray< T >::getData(), SimpleArray< T >::getElement(), SimpleArray< T >::insert(), SimpleArray< T >::move(), FloatArray::multiply(), ShortArray::multiply(), SimpleArray< ComplexFloat >::operator ComplexFloat *(), SimpleArray< T >::setElement(), ComplexFloatArray::subtract(), FloatArray::subtract(), and ShortArray::subtract().
|
protected |
Definition at line 17 of file SimpleArray.h.
Referenced by ComplexFloatArray::add(), FloatArray::add(), ShortArray::add(), ComplexFloatArray::complexByComplexMultiplication(), FloatArray::convolve(), ShortArray::convolve(), SimpleArray< T >::copyFrom(), SimpleArray< T >::copyTo(), FloatArray::correlateInitialized(), ShortArray::correlateInitialized(), SimpleArray< T >::equals(), SimpleArray< T >::getSize(), SimpleArray< T >::insert(), SimpleArray< T >::isEmpty(), SimpleArray< T >::move(), FloatArray::multiply(), ShortArray::multiply(), ComplexFloatArray::subtract(), FloatArray::subtract(), and ShortArray::subtract().