mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[shared] StorageExpressionModel: memoize the fact that the expression is
circular to avoid lagging when approximating the model multiple times.
This commit is contained in:
@@ -69,6 +69,9 @@ int StorageFunction::nameWithArgument(char * buffer, size_t bufferSize, char arg
|
||||
|
||||
template<typename T>
|
||||
T StorageFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * context) const {
|
||||
if (isCircularlyDefined(context)) {
|
||||
return NAN;
|
||||
}
|
||||
const char unknownX[2] = {Poincare::Symbol::UnknownX, 0};
|
||||
return expression(context).approximateWithValueForSymbol(unknownX, x, *context, Preferences::sharedPreferences()->angleUnit());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user