mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Limited number of cached functions
The caches used for function values memoization are now stored in ContinuousFunctionStore : there are now only a fixed number, instead of one per function. This effectively enables caching only for the first few functions on screen, while reducing the memory usage. Change-Id: I2ade091717f73a14a756fe527c773db8e8627be7
This commit is contained in:
committed by
Émilie Feral
parent
95fef86ec0
commit
42fcf557b8
@@ -80,7 +80,10 @@ public:
|
||||
Poincare::Expression sumBetweenBounds(double start, double end, Poincare::Context * context) const override;
|
||||
|
||||
// Cache
|
||||
ContinuousFunctionCache * cache() const { return const_cast<ContinuousFunctionCache *>(&m_cache); }
|
||||
ContinuousFunctionCache * cache() const { return m_cache; }
|
||||
void setCache(ContinuousFunctionCache * v) { m_cache = v; }
|
||||
void clearCache() { m_cache = nullptr; }
|
||||
bool cacheIsFilled() const { return cache() && cache()->filled(); }
|
||||
Ion::Storage::Record::ErrorStatus setContent(const char * c, Poincare::Context * context) override;
|
||||
private:
|
||||
constexpr static float k_polarParamRangeSearchNumberOfPoints = 100.0f; // This is ad hoc, no special justification
|
||||
@@ -125,7 +128,7 @@ private:
|
||||
RecordDataBuffer * recordData() const;
|
||||
template<typename T> Poincare::Coordinate2D<T> templatedApproximateAtParameter(T t, Poincare::Context * context) const;
|
||||
Model m_model;
|
||||
ContinuousFunctionCache m_cache;
|
||||
ContinuousFunctionCache * m_cache;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user