51template <
typename FloatType>
70 LookupTable (
const std::function<FloatType (
size_t)>& functionToApproximate,
size_t numPointsToUse);
82 void initialise (
const std::function<FloatType (
size_t)>& functionToApproximate,
size_t numPointsToUse);
101 auto f = index - FloatType (
i);
104 auto x0 =
data.getUnchecked (
static_cast<int> (
i));
105 auto x1 =
data.getUnchecked (
static_cast<int> (
i + 1));
107 return jmap (
f, x0, x1);
123 FloatType
get (FloatType index)
const noexcept
135 FloatType operator[] (FloatType index)
const noexcept {
return getUnchecked (index); }
173template <
typename FloatType>
199 FloatType minInputValueToUse,
200 FloatType maxInputValueToUse,
203 initialise (functionToApproximate, minInputValueToUse, maxInputValueToUse, numPoints);
217 void initialise (
const std::function<FloatType (FloatType)>& functionToApproximate,
218 FloatType minInputValueToUse,
219 FloatType maxInputValueToUse,
266 FloatType operator() (FloatType index)
const noexcept {
return processSample (index); }
272 void processUnchecked (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
274 for (
size_t i = 0;
i < numSamples; ++
i)
282 void process (
const FloatType* input, FloatType* output,
size_t numSamples)
const noexcept
284 for (
size_t i = 0;
i < numSamples; ++
i)
311 static double calculateMaxRelativeError (
const std::function<FloatType (FloatType)>& functionToApproximate,
312 FloatType minInputValue,
313 FloatType maxInputValue,
315 size_t numTestPoints = 0);
318 static double calculateRelativeDifference (
double,
double)
noexcept;
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
Definition juce_LookupTable.h:53
FloatType get(FloatType index) const noexcept
Definition juce_LookupTable.h:123
FloatType getUnchecked(FloatType index) const noexcept
Definition juce_LookupTable.h:95
size_t getGuardIndex() const noexcept
Definition juce_LookupTable.h:149
static size_t getRequiredBufferSize(size_t numPointsToUse) noexcept
Definition juce_LookupTable.h:148
void prepare() noexcept
Definition juce_LookupTable.cpp:67
bool isInitialised() const noexcept
Definition juce_LookupTable.h:141
size_t getNumPoints() const noexcept
Definition juce_LookupTable.h:138
void initialise(const std::function< FloatType(size_t)> &functionToApproximate, size_t numPointsToUse)
Definition juce_LookupTable.cpp:46
Array< FloatType > data
Definition juce_LookupTable.h:145
LookupTable()
Definition juce_LookupTable.cpp:32
register unsigned i
Definition inflate.c:1575
unsigned f
Definition inflate.c:1572
static PuglViewHint int value
Definition pugl.h:1708
Definition juce_AudioBlock.h:29
Definition carla_juce.cpp:31
constexpr Type jmap(Type value0To1, Type targetRangeMin, Type targetRangeMax)
Definition juce_MathsFunctions.h:120
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Definition juce_MathsFunctions.h:279
unsigned int truncatePositiveToUnsignedInt(FloatType value) noexcept
Definition juce_MathsFunctions.h:515
#define const
Definition zconf.h:137