mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[apps/*/function] Move implementation of evaluateAtAbscissa to CartesianFunction
This commit is contained in:
committed by
Léa Saviot
parent
5e365104ae
commit
c2b8781983
@@ -146,4 +146,18 @@ CartesianFunction::CartesianFunctionRecordDataBuffer * CartesianFunction::record
|
||||
return reinterpret_cast<CartesianFunctionRecordDataBuffer *>(const_cast<void *>(d.buffer));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T CartesianFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * context) const {
|
||||
if (isCircularlyDefined(context)) {
|
||||
return NAN;
|
||||
}
|
||||
constexpr int bufferSize = CodePoint::MaxCodePointCharLength + 1;
|
||||
char unknownX[bufferSize];
|
||||
Poincare::SerializationHelper::CodePoint(unknownX, bufferSize, UCodePointUnknownX);
|
||||
return PoincareHelpers::ApproximateWithValueForSymbol(expressionReduced(context), unknownX, x, context);
|
||||
}
|
||||
|
||||
template float CartesianFunction::templatedApproximateAtAbscissa<float>(float, Poincare::Context *) const;
|
||||
template double CartesianFunction::templatedApproximateAtAbscissa<double>(double, Poincare::Context *) const;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user