[poincare] Change name: sApproximationEncounterComplex -->

sApproximationEncounteredComplex
This commit is contained in:
Émilie Feral
2018-12-27 14:02:58 +01:00
committed by Léa Saviot
parent b8826b1cf4
commit 3fd737ab72
4 changed files with 8 additions and 8 deletions

View File

@@ -194,7 +194,7 @@ public:
Expression degreeToRadian();
/* Approximation Helper */
// These methods reset the sApproximationEncounterComplex flag. They should not be use to implement node approximation
// These methods reset the sApproximationEncounteredComplex flag. They should not be use to implement node approximation
template<typename U> static U epsilon();
template<typename U> Expression approximate(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const;
template<typename U> U approximateToScalar(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const;

View File

@@ -78,7 +78,7 @@ T DerivativeNode::approximateWithArgument(T x, Context & context, Preferences::A
assert(childAtIndex(1)->type() == Type::Symbol);
VariableContext variableContext = VariableContext(static_cast<SymbolNode *>(childAtIndex(1))->name(), &context);
variableContext.setApproximationForVariable<T>(x);
// Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounterComplex flag
// Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounteredComplex flag
return childAtIndex(0)->approximate(T(), variableContext, angleUnit).toScalar();
}

View File

@@ -14,7 +14,7 @@
namespace Poincare {
bool Expression::sSymbolReplacementsCountLock = false;
static bool sApproximationEncounterComplex = false;
static bool sApproximationEncounteredComplex = false;
/* Constructor & Destructor */
@@ -280,11 +280,11 @@ Expression Expression::makePositiveAnyNegativeNumeralFactor(Context & context, P
template<typename U>
Evaluation<U> Expression::approximateToEvaluation(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const {
sApproximationEncounterComplex = false;
sApproximationEncounteredComplex = false;
// Reset interrupting flag because some evaluation methods use it
sSimplificationHasBeenInterrupted = false;
Evaluation<U> e = node()->approximate(U(), context, angleUnit);
if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounterComplex) {
if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounteredComplex) {
e = Complex<U>::Undefined();
}
return e;
@@ -330,7 +330,7 @@ Expression Expression::defaultReplaceUnknown(const Symbol & symbol) {
/* Complex */
void Expression::SetEncounterComplex(bool encounterComplex) {
sApproximationEncounterComplex = encounterComplex;
sApproximationEncounteredComplex = encounterComplex;
}
Preferences::ComplexFormat Expression::UpdatedComplexFormatWithTextInput(Preferences::ComplexFormat complexFormat, const char * textInput) {
@@ -599,7 +599,7 @@ bool Expression::isMinusOne(const Expression e) {
}
Expression Expression::CreateComplexExpression(Expression ra, Expression tb, Preferences::ComplexFormat complexFormat, bool undefined, bool isZeroRa, bool isOneRa, bool isZeroTb, bool isOneTb, bool isNegativeRa, bool isNegativeTb) {
if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounterComplex) {
if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounteredComplex) {
return Unreal();
} else if (undefined) {
return Undefined();

View File

@@ -67,7 +67,7 @@ Evaluation<T> IntegralNode::templatedApproximate(Context & context, Preferences:
template<typename T>
T IntegralNode::functionValueAtAbscissa(T x, Context & context, Preferences::AngleUnit angleUnit) const {
// Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounterComplex flag
// Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounteredComplex flag
assert(childAtIndex(1)->type() == Type::Symbol);
VariableContext variableContext = VariableContext(static_cast<SymbolNode *>(childAtIndex(1))->name(), &context);
variableContext.setApproximationForVariable<T>(x);