52template <
typename FloatType>
99 jassert (isPositiveAndBelow (index, FloatType (
getNumPoints())));
101 auto i = truncatePositiveToUnsignedInt (index);
102 auto f = index - FloatType (i);
103 jassert (isPositiveAndBelow (f, FloatType (1)));
108 return jmap (f,
x0, x1);
124 FloatType
get (FloatType index)
const noexcept
127 index =
static_cast<FloatType
> (getGuardIndex());
152 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
LookupTable)
174template <
typename FloatType>
236 jassert (value >= minInputValue && value <= maxInputValue);
237 return lookupTable[scaler * value + offset];
256 auto index = scaler * jlimit (minInputValue, maxInputValue, value) + offset;
257 jassert (isPositiveAndBelow (index, FloatType (lookupTable.getNumPoints())));
259 return lookupTable[index];
273 void processUnchecked (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
275 for (
size_t i = 0; i < numSamples; ++i)
283 void process (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
285 for (
size_t i = 0; i < numSamples; ++i)
313 FloatType minInputValue,
314 FloatType maxInputValue,
319 static double calculateRelativeDifference (
double,
double)
noexcept;
324 FloatType minInputValue, maxInputValue;
325 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)