mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/graph] Reworked function caching
Instead of being memoized all at once before display, functions values are now stored at evaluation time. Fixed some quirks with caching preparation. Change-Id: I5d212c271c8c41a6dc9074a15c720f0bccf8ac40
This commit is contained in:
committed by
Émilie Feral
parent
42fcf557b8
commit
1bee23cf4f
@@ -351,18 +351,6 @@ Poincare::Expression ContinuousFunction::sumBetweenBounds(double start, double e
|
||||
* the derivative table. */
|
||||
}
|
||||
|
||||
Poincare::Coordinate2D<float> ContinuousFunction::checkForCacheHitAndEvaluate(float t, Poincare::Context * context) const {
|
||||
Poincare::Coordinate2D<float> res(NAN, NAN);
|
||||
if (cacheIsFilled()) {
|
||||
res = cache()->valueForParameter(this, t);
|
||||
}
|
||||
if (std::isnan(res.x1()) || std::isnan(res.x2())) {
|
||||
res = privateEvaluateXYAtParameter(t, context);
|
||||
//res = Poincare::Coordinate2D<float>(privateEvaluateXYAtParameter(t, context).x1(), 0);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Ion::Storage::Record::ErrorStatus ContinuousFunction::setContent(const char * c, Poincare::Context * context) {
|
||||
clearCache();
|
||||
return ExpressionModelHandle::setContent(c, context);
|
||||
|
||||
Reference in New Issue
Block a user