49template <
typename FloatType>
96 jassert (isPositiveAndBelow (index, FloatType (
getNumPoints())));
98 auto i = truncatePositiveToUnsignedInt (index);
99 auto f = index - FloatType (i);
100 jassert (isPositiveAndBelow (f, FloatType (1)));
105 return jmap (f,
x0, x1);
121 FloatType
get (FloatType index)
const noexcept
124 index =
static_cast<FloatType
> (getGuardIndex());
149 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
LookupTable)
171template <
typename FloatType>
233 jassert (value >= minInputValue && value <= maxInputValue);
234 return lookupTable[scaler * value + offset];
253 auto index = scaler * jlimit (minInputValue, maxInputValue, value) + offset;
254 jassert (isPositiveAndBelow (index, FloatType (lookupTable.getNumPoints())));
256 return lookupTable[index];
270 void processUnchecked (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
272 for (
size_t i = 0; i < numSamples; ++i)
280 void process (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
282 for (
size_t i = 0; i < numSamples; ++i)
310 FloatType minInputValue,
311 FloatType maxInputValue,
316 static double calculateRelativeDifference (
double,
double)
noexcept;
321 FloatType minInputValue, maxInputValue;
322 FloatType scaler, offset;
ElementType getUnchecked(int index) const
int size() const noexcept
FloatType get(FloatType index) const noexcept
FloatType operator[](FloatType index) const noexcept
FloatType getUnchecked(FloatType index) const noexcept
bool isInitialised() const noexcept
size_t getNumPoints() const noexcept
void initialise(const std::function< FloatType(size_t)> &functionToApproximate, size_t numPointsToUse)