[poincare] Make derived Expression s_functionHelper constexpr

This commit is contained in:
Ruben Dashyan
2018-10-25 16:02:44 +02:00
committed by Émilie Feral
parent 61b1b8a09d
commit 9c5ea70c24
97 changed files with 271 additions and 318 deletions

View File

@@ -47,7 +47,7 @@ public:
AbsoluteValue(const AbsoluteValueNode * n) : Expression(n) {}
static AbsoluteValue Builder(Expression child) { return AbsoluteValue(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("abs", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -55,8 +55,6 @@ private:
replaceChildAtIndexInPlace(0, child);
}
Expression setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit);
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -13,7 +13,7 @@ public:
// SerializationHelperInterface
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, AbsoluteValue::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, AbsoluteValue::s_functionHelper.name());
}
// TreeNode

View File

@@ -43,7 +43,7 @@ public:
ArcCosine(const ArcCosineNode * n) : Expression(n) {}
static ArcCosine Builder(Expression child) { return ArcCosine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("acos", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -51,7 +51,6 @@ private:
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -42,14 +42,13 @@ public:
ArcSine(const ArcSineNode * n) : Expression(n) {}
static ArcSine Builder(Expression child) { return ArcSine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("asin", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit ArcSine(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<ArcSineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -42,14 +42,13 @@ public:
ArcTangent(const ArcTangentNode * n) : Expression(n) {}
static ArcTangent Builder(Expression child) { return ArcTangent(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("atan", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit ArcTangent(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<ArcTangentNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -40,7 +40,7 @@ public:
BinomialCoefficient(const BinomialCoefficientNode * n) : Expression(n) {}
static BinomialCoefficient Builder(Expression child0, Expression child1) { return BinomialCoefficient(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("binomial", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -49,7 +49,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
constexpr static int k_maxNValue = 300;
};

View File

@@ -41,14 +41,13 @@ public:
Ceiling(const CeilingNode * n) : Expression(n) {}
static Ceiling Builder(Expression child) { return Ceiling(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("ceil", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Ceiling(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<CeilingNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -13,7 +13,7 @@ public:
using BracketPairLayoutNode::BracketPairLayoutNode;
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Ceiling::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Ceiling::s_functionHelper.name());
}
// TreeNode

View File

@@ -41,14 +41,13 @@ public:
ComplexArgument(const ComplexArgumentNode * n) : Expression(n) {}
static ComplexArgument Builder(Expression child) { return ComplexArgument(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("arg", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit ComplexArgument(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<ComplexArgumentNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -20,7 +20,7 @@ public:
void moveCursorUp(LayoutCursor * cursor, bool * shouldRecomputeLayout, bool equivalentPositionVisited = false) override { assert(false); }
void moveCursorDown(LayoutCursor * cursor, bool * shouldRecomputeLayout, bool equivalentPositionVisited = false) override { assert(false); }
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sum::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sum::s_functionHelper.name());
}
LayoutNode * layoutToPointWhenInserting() override {

View File

@@ -47,7 +47,7 @@ public:
ConfidenceInterval(const ConfidenceIntervalNode * n) : Expression(n) {}
static ConfidenceInterval Builder(Expression child0, Expression child1) { return ConfidenceInterval(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("confidence", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -56,7 +56,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
constexpr static int k_maxNValue = 300;
};
@@ -65,13 +64,12 @@ public:
SimplePredictionInterval(const SimplePredictionIntervalNode * n) : ConfidenceInterval(n) {}
static SimplePredictionInterval Builder(Expression child0, Expression child1) { return SimplePredictionInterval(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("prediction", 2, &UntypedBuilder);
private:
SimplePredictionInterval(Expression child0, Expression child1) : ConfidenceInterval(TreePool::sharedPool()->createTreeNode<SimplePredictionIntervalNode>()) {
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -41,14 +41,13 @@ public:
Conjugate(const ConjugateNode * n) : Expression(n) {}
static Conjugate Builder(Expression child) { return Conjugate(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("conj", 1, &UntypedBuilder);;
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Conjugate(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<ConjugateNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -45,14 +45,13 @@ public:
Cosine(const CosineNode * n) : Expression(n) {}
static Cosine Builder(Expression child) { return Cosine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("cos", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Cosine(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<CosineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -48,7 +48,7 @@ public:
Derivative(const DerivativeNode * n) : Expression(n) {}
static Derivative Builder(Expression child0, Expression child1, Expression child2) { return Derivative(child0, child1, child2); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1), children.childAtIndex(2)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("diff", 3, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -57,7 +57,6 @@ private:
replaceChildAtIndexInPlace(1, child1);
replaceChildAtIndexInPlace(2, child2);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -37,14 +37,13 @@ public:
Determinant(const DeterminantNode * n) : Expression(n) {}
static Determinant Builder(Expression child) { return Determinant(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("det", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Determinant(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<DeterminantNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,7 +36,7 @@ public:
DivisionQuotient(const DivisionQuotientNode * n) : Expression(n) {}
static DivisionQuotient Builder(Expression child0, Expression child1) { return DivisionQuotient(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("quo", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -45,7 +45,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -37,7 +37,7 @@ public:
DivisionRemainder(const DivisionRemainderNode * n) : Expression(n) {}
static DivisionRemainder Builder(Expression child0, Expression child1) { return DivisionRemainder(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("rem", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -46,7 +46,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -39,7 +39,7 @@ public:
Factor(const FactorNode * n) : Expression(n) {}
static Factor Builder(Expression child) { return Factor(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("factor", 1, &UntypedBuilder);
Expression shallowBeautify(Context & context, Preferences::AngleUnit angleUnit);
Multiplication createMultiplicationOfIntegerPrimeDecomposition(Integer i, Context & context, Preferences::AngleUnit angleUnit) const;
@@ -47,7 +47,6 @@ private:
explicit Factor(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<FactorNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -41,14 +41,13 @@ public:
Floor(const FloorNode * n) : Expression(n) {}
static Floor Builder(Expression child) { return Floor(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("floor", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Floor(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<FloorNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -12,7 +12,7 @@ class FloorLayoutNode final : public BracketPairLayoutNode {
public:
using BracketPairLayoutNode::BracketPairLayoutNode;
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Floor::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Floor::s_functionHelper.name());
}
// TreeNode

View File

@@ -41,14 +41,13 @@ public:
FracPart(const FracPartNode * n) : Expression(n) {}
static FracPart Builder(Expression child) { return FracPart(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("frac", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit FracPart(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<FracPartNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,7 +36,7 @@ public:
GreatCommonDivisor(const GreatCommonDivisorNode * n) : Expression(n) {}
static GreatCommonDivisor Builder(Expression child0, Expression child1) { return GreatCommonDivisor(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("gcd", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -45,7 +45,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicArcCosine(const HyperbolicArcCosineNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicArcCosine Builder(Expression child) { return HyperbolicArcCosine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("acosh", 1, &UntypedBuilder);
private:
explicit HyperbolicArcCosine(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicArcCosineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicArcSine(const HyperbolicArcSineNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicArcSine Builder(Expression child) { return HyperbolicArcSine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("asinh", 1, &UntypedBuilder);
private:
explicit HyperbolicArcSine(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicArcSineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicArcTangent(const HyperbolicArcTangentNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicArcTangent Builder(Expression child) { return HyperbolicArcTangent(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("atanh", 1, &UntypedBuilder);
private:
explicit HyperbolicArcTangent(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicArcTangentNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicCosine(const HyperbolicCosineNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicCosine Builder(Expression child) { return HyperbolicCosine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("cosh", 1, &UntypedBuilder);
private:
explicit HyperbolicCosine(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicCosineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicSine(const HyperbolicSineNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicSine Builder(Expression child) { return HyperbolicSine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("sinh", 1, &UntypedBuilder);
private:
explicit HyperbolicSine(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicSineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -38,12 +38,11 @@ public:
HyperbolicTangent(const HyperbolicTangentNode * n) : HyperbolicTrigonometricFunction(n) {}
static HyperbolicTangent Builder(Expression child) { return HyperbolicTangent(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("tanh", 1, &UntypedBuilder);
private:
explicit HyperbolicTangent(Expression child) : HyperbolicTrigonometricFunction(TreePool::sharedPool()->createTreeNode<HyperbolicTangentNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -43,14 +43,13 @@ public:
ImaginaryPart(const ImaginaryPartNode * n) : Expression(n) {}
static ImaginaryPart Builder(Expression child) { return ImaginaryPart(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("im", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit ImaginaryPart(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<ImaginaryPartNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -51,7 +51,7 @@ public:
Integral(const IntegralNode * n) : Expression(n) {}
static Integral Builder(Expression child0, Expression child1, Expression child2, Expression child3) { return Integral(child0, child1, child2, child3); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1), children.childAtIndex(2), children.childAtIndex(3)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("int", 4, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -62,7 +62,6 @@ private:
replaceChildAtIndexInPlace(2, child2);
replaceChildAtIndexInPlace(3, child3);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -35,7 +35,7 @@ public:
LeastCommonMultiple(const LeastCommonMultipleNode * n) : Expression(n) {}
static LeastCommonMultiple Builder(Expression child0, Expression child1) { return LeastCommonMultiple(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("lcm", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -44,7 +44,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -46,7 +46,7 @@ public:
Logarithm(const LogarithmNode<2> * n) : Expression(n) {}
static Logarithm Builder(Expression child0, Expression child1) { return Logarithm(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("log", 2, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
Expression shallowBeautify(Context & context, Preferences::AngleUnit angleUnit);
@@ -60,7 +60,6 @@ private:
Integer simplifyLogarithmIntegerBaseInteger(Integer i, Integer & base, Addition & a, bool isDenominator);
Expression splitLogarithmInteger(Integer i, bool isDenominator, Context & context, Preferences::AngleUnit angleUnit);
bool parentIsAPowerOfSameBase() const;
static const Expression::FunctionHelper m_functionHelper;
};
class CommonLogarithm : public Expression {
@@ -68,14 +67,13 @@ public:
CommonLogarithm(const LogarithmNode<1> * n) : Expression(n) {}
static CommonLogarithm Builder(Expression child) { return CommonLogarithm(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("log", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit CommonLogarithm(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<LogarithmNode<1> >()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,14 +36,13 @@ public:
MatrixDimension(const MatrixDimensionNode * n) : Expression(n) {}
static MatrixDimension Builder(Expression child) { return MatrixDimension(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("dim", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit MatrixDimension(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<MatrixDimensionNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,14 +36,13 @@ public:
MatrixInverse(const MatrixInverseNode * n) : Expression(n) {}
static MatrixInverse Builder(Expression child) { return MatrixInverse(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("inverse", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit MatrixInverse(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<MatrixInverseNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,14 +36,13 @@ public:
MatrixTrace(const MatrixTraceNode * n) : Expression(n) {}
static MatrixTrace Builder(Expression child) { return MatrixTrace(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("trace", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit MatrixTrace(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<MatrixTraceNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -36,14 +36,13 @@ public:
MatrixTranspose(const MatrixTransposeNode * n) : Expression(n) {}
static MatrixTranspose Builder(Expression child) { return MatrixTranspose(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("transpose", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit MatrixTranspose(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<MatrixTransposeNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -46,14 +46,13 @@ public:
NaperianLogarithm(const NaperianLogarithmNode * n) : Expression(n) {}
static NaperianLogarithm Builder(Expression child) { return NaperianLogarithm(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("ln", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit NaperianLogarithm(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<NaperianLogarithmNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -37,7 +37,7 @@ public:
NthRoot(const NthRootNode * n) : Expression(n) {}
static NthRoot Builder(Expression child0, Expression child1) { return NthRoot(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("root", 2, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -45,7 +45,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -39,7 +39,7 @@ public:
PermuteCoefficient(const PermuteCoefficientNode * n) : Expression(n) {}
static PermuteCoefficient Builder(Expression child0, Expression child1) { return PermuteCoefficient(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("permute", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -48,7 +48,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
constexpr static int k_maxNValue = 100;
};

View File

@@ -39,7 +39,7 @@ public:
PredictionInterval(const PredictionIntervalNode * n) : Expression(n) {}
static PredictionInterval Builder(Expression child0, Expression child1) { return PredictionInterval(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("prediction95", 2, &UntypedBuilder);
// Expression
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
@@ -48,7 +48,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -35,7 +35,7 @@ public:
Product(const ProductNode * n) : Expression(n) {}
static Product Builder(Expression child0, Expression child1, Expression child2, Expression child3) { return Product(child0, child1, child2, child3); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1), children.childAtIndex(2), children.childAtIndex(3)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("product", 4, &UntypedBuilder);
private:
Product(Expression child0, Expression child1, Expression child2, Expression child3) : Expression(TreePool::sharedPool()->createTreeNode<ProductNode>()) {
replaceChildAtIndexInPlace(0, child0);
@@ -43,7 +43,6 @@ private:
replaceChildAtIndexInPlace(2, child2);
replaceChildAtIndexInPlace(3, child3);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -39,13 +39,12 @@ public:
Randint(const RandintNode * n) : Expression(n) {}
static Randint Builder(Expression child0, Expression child1) { return Randint(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("randint", 2, &UntypedBuilder);
private:
Randint(Expression child0, Expression child1) : Expression(TreePool::sharedPool()->createTreeNode<RandintNode>()) {
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -42,13 +42,12 @@ public:
Random(const RandomNode * n) : Expression(n) {}
static Random Builder() { return Random(); }
static Expression UntypedBuilder(Expression children) { return Builder(); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("random", 0, &UntypedBuilder);
template<typename T> static T random();
private:
Random() : Expression(TreePool::sharedPool()->createTreeNode<RandomNode>()) {}
Expression setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit);
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -43,14 +43,13 @@ public:
RealPart(const RealPartNode * n) : Expression(n) {}
static RealPart Builder(Expression child) { return RealPart(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("re", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit RealPart(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<RealPartNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -37,7 +37,7 @@ public:
Round(const RoundNode * n) : Expression(n) {}
static Round Builder(Expression child0, Expression child1) { return Round(child0, child1); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("round", 2, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -45,7 +45,6 @@ private:
replaceChildAtIndexInPlace(0, child0);
replaceChildAtIndexInPlace(1, child1);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -47,14 +47,13 @@ public:
Sine(const SineNode * n) : Expression(n) {}
static Sine Builder(Expression child) { return Sine(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("sin", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Sine(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<SineNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -43,7 +43,8 @@ public:
SquareRoot(const SquareRootNode * n) : Expression(n) {}
static SquareRoot Builder(Expression child) { return SquareRoot(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static_assert('\x91' == Ion::Charset::Root, "Charset error");
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("\x91", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
@@ -51,7 +52,6 @@ private:
replaceChildAtIndexInPlace(0, child);
}
static const char k_name[2];
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -35,7 +35,7 @@ public:
Sum(const SumNode * n) : Expression(n) {}
static Sum Builder(Expression child0, Expression child1, Expression child2, Expression child3) { return Sum(child0, child1, child2, child3); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0), children.childAtIndex(1), children.childAtIndex(2), children.childAtIndex(3)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("sum", 4, &UntypedBuilder);
private:
Sum(Expression child0, Expression child1, Expression child2, Expression child3) : Expression(TreePool::sharedPool()->createTreeNode<SumNode>()) {
replaceChildAtIndexInPlace(0, child0);
@@ -43,7 +43,6 @@ private:
replaceChildAtIndexInPlace(2, child2);
replaceChildAtIndexInPlace(3, child3);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -45,14 +45,13 @@ public:
Tangent(const TangentNode * n) : Expression(n) {}
static Tangent Builder(Expression child) { return Tangent(child); }
static Expression UntypedBuilder(Expression children) { return Builder(children.childAtIndex(0)); }
static const Expression::FunctionHelper * FunctionHelper() { return &m_functionHelper; }
static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("tan", 1, &UntypedBuilder);
Expression shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols = true);
private:
explicit Tangent(Expression child) : Expression(TreePool::sharedPool()->createTreeNode<TangentNode>()) {
replaceChildAtIndexInPlace(0, child);
}
static const Expression::FunctionHelper m_functionHelper;
};
}

View File

@@ -8,7 +8,9 @@
namespace Poincare {
int AbsoluteValueNode::numberOfChildren() const { return AbsoluteValue::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper AbsoluteValue::s_functionHelper;
int AbsoluteValueNode::numberOfChildren() const { return AbsoluteValue::s_functionHelper.numberOfChildren(); }
Expression AbsoluteValueNode::setSign(Sign s, Context & context, Preferences::AngleUnit angleUnit) {
return AbsoluteValue(this).setSign(s, context, angleUnit);
@@ -19,7 +21,7 @@ Layout AbsoluteValueNode::createLayout(Preferences::PrintFloatMode floatDisplayM
}
int AbsoluteValueNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, AbsoluteValue::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, AbsoluteValue::s_functionHelper.name());
}
Expression AbsoluteValueNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -56,6 +58,4 @@ Expression AbsoluteValue::shallowReduce(Context & context, Preferences::AngleUni
return *this;
}
constexpr Expression::FunctionHelper AbsoluteValue::m_functionHelper = Expression::FunctionHelper("abs", 1, &AbsoluteValue::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int ArcCosineNode::numberOfChildren() const { return ArcCosine::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ArcCosine::s_functionHelper;
int ArcCosineNode::numberOfChildren() const { return ArcCosine::s_functionHelper.numberOfChildren(); }
Layout ArcCosineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ArcCosine(this), floatDisplayMode, numberOfSignificantDigits, ArcCosine::FunctionHelper()->name());
return LayoutHelper::Prefix(ArcCosine(this), floatDisplayMode, numberOfSignificantDigits, ArcCosine::s_functionHelper.name());
}
int ArcCosineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcCosine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcCosine::s_functionHelper.name());
}
Expression ArcCosineNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -51,6 +53,4 @@ Expression ArcCosine::shallowReduce(Context & context, Preferences::AngleUnit an
return Trigonometry::shallowReduceInverseFunction(*this, context, angleUnit);
}
constexpr Expression::FunctionHelper ArcCosine::m_functionHelper = Expression::FunctionHelper("acos", 1, &ArcCosine::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int ArcSineNode::numberOfChildren() const { return ArcSine::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ArcSine::s_functionHelper;
int ArcSineNode::numberOfChildren() const { return ArcSine::s_functionHelper.numberOfChildren(); }
Layout ArcSineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ArcSine(this), floatDisplayMode, numberOfSignificantDigits, ArcSine::FunctionHelper()->name());
return LayoutHelper::Prefix(ArcSine(this), floatDisplayMode, numberOfSignificantDigits, ArcSine::s_functionHelper.name());
}
int ArcSineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcSine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcSine::s_functionHelper.name());
}
Expression ArcSineNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -51,6 +53,4 @@ Expression ArcSine::shallowReduce(Context & context, Preferences::AngleUnit angl
return Trigonometry::shallowReduceInverseFunction(*this, context, angleUnit);
}
constexpr Expression::FunctionHelper ArcSine::m_functionHelper = Expression::FunctionHelper("asin", 1, &ArcSine::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int ArcTangentNode::numberOfChildren() const { return ArcTangent::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ArcTangent::s_functionHelper;
int ArcTangentNode::numberOfChildren() const { return ArcTangent::s_functionHelper.numberOfChildren(); }
Layout ArcTangentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ArcTangent(this), floatDisplayMode, numberOfSignificantDigits, ArcTangent::FunctionHelper()->name());
return LayoutHelper::Prefix(ArcTangent(this), floatDisplayMode, numberOfSignificantDigits, ArcTangent::s_functionHelper.name());
}
int ArcTangentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcTangent::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ArcTangent::s_functionHelper.name());
}
template<typename T>
@@ -51,6 +53,4 @@ Expression ArcTangent::shallowReduce(Context & context, Preferences::AngleUnit a
return Trigonometry::shallowReduceInverseFunction(*this, context, angleUnit);
}
constexpr Expression::FunctionHelper ArcTangent::m_functionHelper = Expression::FunctionHelper("atan", 1, &ArcTangent::UntypedBuilder);
}

View File

@@ -10,7 +10,9 @@
namespace Poincare {
int BinomialCoefficientNode::numberOfChildren() const { return BinomialCoefficient::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper BinomialCoefficient::s_functionHelper;
int BinomialCoefficientNode::numberOfChildren() const { return BinomialCoefficient::s_functionHelper.numberOfChildren(); }
Expression BinomialCoefficientNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return BinomialCoefficient(this).shallowReduce(context, angleUnit, replaceSymbols);
@@ -23,7 +25,7 @@ Layout BinomialCoefficientNode::createLayout(Preferences::PrintFloatMode floatDi
}
int BinomialCoefficientNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, BinomialCoefficient::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, BinomialCoefficient::s_functionHelper.name());
}
template<typename T>
@@ -119,6 +121,4 @@ Expression BinomialCoefficient::shallowReduce(Context & context, Preferences::An
template double BinomialCoefficientNode::compute(double k, double n);
template float BinomialCoefficientNode::compute(float k, float n);
constexpr Expression::FunctionHelper BinomialCoefficient::m_functionHelper = Expression::FunctionHelper("binomial", 2, &BinomialCoefficient::UntypedBuilder);
}

View File

@@ -74,7 +74,7 @@ void BinomialCoefficientLayoutNode::moveCursorDown(LayoutCursor * cursor, bool *
}
int BinomialCoefficientLayoutNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, BinomialCoefficient::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, BinomialCoefficient::s_functionHelper.name());
}
KDSize BinomialCoefficientLayoutNode::computeSize() {

View File

@@ -11,14 +11,16 @@
namespace Poincare {
int CeilingNode::numberOfChildren() const { return Ceiling::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Ceiling::s_functionHelper;
int CeilingNode::numberOfChildren() const { return Ceiling::s_functionHelper.numberOfChildren(); }
Layout CeilingNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return CeilingLayout(childAtIndex(0)->createLayout(floatDisplayMode, numberOfSignificantDigits));
}
int CeilingNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Ceiling::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Ceiling::s_functionHelper.name());
}
template<typename T>
@@ -81,6 +83,4 @@ Expression Ceiling::shallowReduce(Context & context, Preferences::AngleUnit angl
return rationalResult;
}
constexpr Expression::FunctionHelper Ceiling::m_functionHelper = Expression::FunctionHelper("ceil", 1, &Ceiling::UntypedBuilder);
}

View File

@@ -9,14 +9,16 @@ extern "C" {
namespace Poincare {
int ComplexArgumentNode::numberOfChildren() const { return ComplexArgument::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ComplexArgument::s_functionHelper;
int ComplexArgumentNode::numberOfChildren() const { return ComplexArgument::s_functionHelper.numberOfChildren(); }
Layout ComplexArgumentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ComplexArgument(this), floatDisplayMode, numberOfSignificantDigits, ComplexArgument::FunctionHelper()->name());
return LayoutHelper::Prefix(ComplexArgument(this), floatDisplayMode, numberOfSignificantDigits, ComplexArgument::s_functionHelper.name());
}
int ComplexArgumentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ComplexArgument::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ComplexArgument::s_functionHelper.name());
}
Expression ComplexArgumentNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -44,6 +46,4 @@ Expression ComplexArgument::shallowReduce(Context & context, Preferences::AngleU
return *this;
}
constexpr Expression::FunctionHelper ComplexArgument::m_functionHelper = Expression::FunctionHelper("arg", 1, &ComplexArgument::UntypedBuilder);
}

View File

@@ -11,14 +11,18 @@
namespace Poincare {
int ConfidenceIntervalNode::numberOfChildren() const { return ConfidenceInterval::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ConfidenceInterval::s_functionHelper;
constexpr Expression::FunctionHelper SimplePredictionInterval::s_functionHelper;
int ConfidenceIntervalNode::numberOfChildren() const { return ConfidenceInterval::s_functionHelper.numberOfChildren(); }
Layout ConfidenceIntervalNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ConfidenceInterval(this), floatDisplayMode, numberOfSignificantDigits, ConfidenceInterval::FunctionHelper()->name());
return LayoutHelper::Prefix(ConfidenceInterval(this), floatDisplayMode, numberOfSignificantDigits, ConfidenceInterval::s_functionHelper.name());
}
int ConfidenceIntervalNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ConfidenceInterval::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ConfidenceInterval::s_functionHelper.name());
}
Expression ConfidenceIntervalNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -41,11 +45,11 @@ Evaluation<T> ConfidenceIntervalNode::templatedApproximate(Context& context, Pre
}
Layout SimplePredictionIntervalNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(SimplePredictionInterval(this), floatDisplayMode, numberOfSignificantDigits, SimplePredictionInterval::FunctionHelper()->name());
return LayoutHelper::Prefix(SimplePredictionInterval(this), floatDisplayMode, numberOfSignificantDigits, SimplePredictionInterval::s_functionHelper.name());
}
int SimplePredictionIntervalNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SimplePredictionInterval::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SimplePredictionInterval::s_functionHelper.name());
}
Expression ConfidenceInterval::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -94,8 +98,4 @@ Expression ConfidenceInterval::shallowReduce(Context & context, Preferences::Ang
return matrix;
}
constexpr Expression::FunctionHelper ConfidenceInterval::m_functionHelper = Expression::FunctionHelper("confidence", 2, &ConfidenceInterval::UntypedBuilder);
constexpr Expression::FunctionHelper SimplePredictionInterval::m_functionHelper = Expression::FunctionHelper("prediction", 2, &SimplePredictionInterval::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int ConjugateNode::numberOfChildren() const { return Conjugate::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Conjugate::s_functionHelper;
int ConjugateNode::numberOfChildren() const { return Conjugate::s_functionHelper.numberOfChildren(); }
Layout ConjugateNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return ConjugateLayout(childAtIndex(0)->createLayout(floatDisplayMode, numberOfSignificantDigits));
}
int ConjugateNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Conjugate::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Conjugate::s_functionHelper.name());
}
Expression ConjugateNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -46,6 +48,4 @@ Expression Conjugate::shallowReduce(Context & context, Preferences::AngleUnit an
return *this;
}
constexpr Expression::FunctionHelper Conjugate::m_functionHelper = Expression::FunctionHelper("conj", 1, &Conjugate::UntypedBuilder);
}

View File

@@ -52,7 +52,7 @@ void ConjugateLayoutNode::moveCursorRight(LayoutCursor * cursor, bool * shouldRe
}
int ConjugateLayoutNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Conjugate::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Conjugate::s_functionHelper.name());
}
KDSize ConjugateLayoutNode::computeSize() {

View File

@@ -7,7 +7,9 @@
namespace Poincare {
int CosineNode::numberOfChildren() const { return Cosine::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Cosine::s_functionHelper;
int CosineNode::numberOfChildren() const { return Cosine::s_functionHelper.numberOfChildren(); }
float CosineNode::characteristicXRange(Context & context, Preferences::AngleUnit angleUnit) const {
return Trigonometry::characteristicXRange(Cosine(this), context, angleUnit);
@@ -21,11 +23,11 @@ Complex<T> CosineNode::computeOnComplex(const std::complex<T> c, Preferences::An
}
Layout CosineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Cosine(this), floatDisplayMode, numberOfSignificantDigits, Cosine::FunctionHelper()->name());
return LayoutHelper::Prefix(Cosine(this), floatDisplayMode, numberOfSignificantDigits, Cosine::s_functionHelper.name());
}
int CosineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Cosine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Cosine::s_functionHelper.name());
}
Expression CosineNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -48,6 +50,4 @@ Expression Cosine::shallowReduce(Context & context, Preferences::AngleUnit angle
return Trigonometry::shallowReduceDirectFunction(*this, context, angleUnit);
}
constexpr Expression::FunctionHelper Cosine::m_functionHelper = Expression::FunctionHelper("cos", 1, &Cosine::UntypedBuilder);
}

View File

@@ -10,7 +10,9 @@
namespace Poincare {
int DerivativeNode::numberOfChildren() const { return Derivative::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Derivative::s_functionHelper;
int DerivativeNode::numberOfChildren() const { return Derivative::s_functionHelper.numberOfChildren(); }
int DerivativeNode::polynomialDegree(Context & context, const char * symbolName) const {
if (childAtIndex(0)->polynomialDegree(context, symbolName) == 0
@@ -25,11 +27,11 @@ int DerivativeNode::polynomialDegree(Context & context, const char * symbolName)
}
Layout DerivativeNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, Derivative::FunctionHelper()->name());
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, Derivative::s_functionHelper.name());
}
int DerivativeNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Derivative::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Derivative::s_functionHelper.name());
}
Expression DerivativeNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -146,6 +148,4 @@ Expression Derivative::shallowReduce(Context & context, Preferences::AngleUnit a
return *this;
}
constexpr Expression::FunctionHelper Derivative::m_functionHelper = Expression::FunctionHelper("diff", 3, &Derivative::UntypedBuilder);
}

View File

@@ -9,14 +9,16 @@ extern "C" {
namespace Poincare {
int DeterminantNode::numberOfChildren() const { return Determinant::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Determinant::s_functionHelper;
int DeterminantNode::numberOfChildren() const { return Determinant::s_functionHelper.numberOfChildren(); }
Layout DeterminantNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Determinant(this), floatDisplayMode, numberOfSignificantDigits, Determinant::FunctionHelper()->name());
return LayoutHelper::Prefix(Determinant(this), floatDisplayMode, numberOfSignificantDigits, Determinant::s_functionHelper.name());
}
int DeterminantNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Determinant::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Determinant::s_functionHelper.name());
}
// TODO: handle this exactly in shallowReduce for small dimensions.
@@ -54,6 +56,4 @@ Expression Determinant::shallowReduce(Context & context, Preferences::AngleUnit
return *this;
}
constexpr Expression::FunctionHelper Determinant::m_functionHelper = Expression::FunctionHelper("det", 1, &Determinant::UntypedBuilder);
}

View File

@@ -8,17 +8,19 @@
namespace Poincare {
int DivisionQuotientNode::numberOfChildren() const { return DivisionQuotient::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper DivisionQuotient::s_functionHelper;
int DivisionQuotientNode::numberOfChildren() const { return DivisionQuotient::s_functionHelper.numberOfChildren(); }
Expression DivisionQuotientNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return DivisionQuotient(this).shallowReduce(context, angleUnit, replaceSymbols);
}
Layout DivisionQuotientNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(DivisionQuotient(this), floatDisplayMode, numberOfSignificantDigits, DivisionQuotient::FunctionHelper()->name());
return LayoutHelper::Prefix(DivisionQuotient(this), floatDisplayMode, numberOfSignificantDigits, DivisionQuotient::s_functionHelper.name());
}
int DivisionQuotientNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, DivisionQuotient::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, DivisionQuotient::s_functionHelper.name());
}
template<typename T>
@@ -85,6 +87,4 @@ Expression DivisionQuotient::shallowReduce(Context & context, Preferences::Angle
return rationalResult;
}
constexpr Expression::FunctionHelper DivisionQuotient::m_functionHelper = Expression::FunctionHelper("quo", 2, &DivisionQuotient::UntypedBuilder);
}

View File

@@ -8,14 +8,16 @@
namespace Poincare {
int DivisionRemainderNode::numberOfChildren() const { return DivisionRemainder::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper DivisionRemainder::s_functionHelper;
int DivisionRemainderNode::numberOfChildren() const { return DivisionRemainder::s_functionHelper.numberOfChildren(); }
Layout DivisionRemainderNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(DivisionRemainder(this), floatDisplayMode, numberOfSignificantDigits, DivisionRemainder::FunctionHelper()->name());
return LayoutHelper::Prefix(DivisionRemainder(this), floatDisplayMode, numberOfSignificantDigits, DivisionRemainder::s_functionHelper.name());
}
int DivisionRemainderNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, DivisionRemainder::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, DivisionRemainder::s_functionHelper.name());
}
Expression DivisionRemainderNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -84,6 +86,4 @@ Expression DivisionRemainder::shallowReduce(Context & context, Preferences::Angl
return rationalResult;
}
constexpr Expression::FunctionHelper DivisionRemainder::m_functionHelper = Expression::FunctionHelper("rem", 2, &DivisionRemainder::UntypedBuilder);
}

View File

@@ -14,14 +14,16 @@ extern "C" {
namespace Poincare {
int FactorNode::numberOfChildren() const { return Factor::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Factor::s_functionHelper;
int FactorNode::numberOfChildren() const { return Factor::s_functionHelper.numberOfChildren(); }
Layout FactorNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Factor(this), floatDisplayMode, numberOfSignificantDigits, Factor::FunctionHelper()->name());
return LayoutHelper::Prefix(Factor(this), floatDisplayMode, numberOfSignificantDigits, Factor::s_functionHelper.name());
}
int FactorNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Factor::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Factor::s_functionHelper.name());
}
Expression FactorNode::shallowBeautify(Context & context, Preferences::AngleUnit angleUnit) {
@@ -88,6 +90,4 @@ Multiplication Factor::createMultiplicationOfIntegerPrimeDecomposition(Integer i
return m;
}
constexpr Expression::FunctionHelper Factor::m_functionHelper = Expression::FunctionHelper("factor", 1, &Factor::UntypedBuilder);
}

View File

@@ -11,14 +11,16 @@
namespace Poincare {
int FloorNode::numberOfChildren() const { return Floor::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Floor::s_functionHelper;
int FloorNode::numberOfChildren() const { return Floor::s_functionHelper.numberOfChildren(); }
Layout FloorNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return FloorLayout(childAtIndex(0)->createLayout(floatDisplayMode, numberOfSignificantDigits));
}
int FloorNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Floor::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Floor::s_functionHelper.name());
}
template<typename T>
@@ -72,6 +74,4 @@ Expression Floor::shallowReduce(Context & context, Preferences::AngleUnit angleU
return result;
}
constexpr Expression::FunctionHelper Floor::m_functionHelper = Expression::FunctionHelper("floor", 1, &Floor::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int FracPartNode::numberOfChildren() const { return FracPart::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper FracPart::s_functionHelper;
int FracPartNode::numberOfChildren() const { return FracPart::s_functionHelper.numberOfChildren(); }
Layout FracPartNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(FracPart(this), floatDisplayMode, numberOfSignificantDigits, FracPart::FunctionHelper()->name());
return LayoutHelper::Prefix(FracPart(this), floatDisplayMode, numberOfSignificantDigits, FracPart::s_functionHelper.name());
}
int FracPartNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, FracPart::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, FracPart::s_functionHelper.name());
}
Expression FracPartNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -54,6 +56,4 @@ Expression FracPart::shallowReduce(Context & context, Preferences::AngleUnit ang
return result;
}
constexpr Expression::FunctionHelper FracPart::m_functionHelper = Expression::FunctionHelper("frac", 1, &FracPart::UntypedBuilder);
}

View File

@@ -8,14 +8,16 @@
namespace Poincare {
int GreatCommonDivisorNode::numberOfChildren() const { return GreatCommonDivisor::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper GreatCommonDivisor::s_functionHelper;
int GreatCommonDivisorNode::numberOfChildren() const { return GreatCommonDivisor::s_functionHelper.numberOfChildren(); }
Layout GreatCommonDivisorNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(GreatCommonDivisor(this), floatDisplayMode, numberOfSignificantDigits, GreatCommonDivisor::FunctionHelper()->name());
return LayoutHelper::Prefix(GreatCommonDivisor(this), floatDisplayMode, numberOfSignificantDigits, GreatCommonDivisor::s_functionHelper.name());
}
int GreatCommonDivisorNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, GreatCommonDivisor::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, GreatCommonDivisor::s_functionHelper.name());
}
Expression GreatCommonDivisorNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -91,6 +93,4 @@ Expression GreatCommonDivisor::shallowReduce(Context & context, Preferences::Ang
return result;
}
constexpr Expression::FunctionHelper GreatCommonDivisor::m_functionHelper = Expression::FunctionHelper("gcd", 2, &GreatCommonDivisor::UntypedBuilder);
}

View File

@@ -6,12 +6,14 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicArcCosine::s_functionHelper;
Layout HyperbolicArcCosineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicArcCosine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcCosine::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicArcCosine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcCosine::s_functionHelper.name());
}
int HyperbolicArcCosineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcCosine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcCosine::s_functionHelper.name());
}
template<typename T>
@@ -27,6 +29,4 @@ Complex<T> HyperbolicArcCosineNode::computeOnComplex(const std::complex<T> c, Pr
template Complex<float> Poincare::HyperbolicArcCosineNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicArcCosineNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicArcCosine::m_functionHelper = Expression::FunctionHelper("acosh", 1, &HyperbolicArcCosine::UntypedBuilder);
}

View File

@@ -6,11 +6,13 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicArcSine::s_functionHelper;
Layout HyperbolicArcSineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicArcSine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcSine::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicArcSine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcSine::s_functionHelper.name());
}
int HyperbolicArcSineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcSine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcSine::s_functionHelper.name());
}
template<typename T>
@@ -30,6 +32,4 @@ Complex<T> HyperbolicArcSineNode::computeOnComplex(const std::complex<T> c, Pref
template Complex<float> Poincare::HyperbolicArcSineNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicArcSineNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicArcSine::m_functionHelper = Expression::FunctionHelper("asinh", 1, &HyperbolicArcSine::UntypedBuilder);
}

View File

@@ -6,12 +6,14 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicArcTangent::s_functionHelper;
Layout HyperbolicArcTangentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicArcTangent(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcTangent::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicArcTangent(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicArcTangent::s_functionHelper.name());
}
int HyperbolicArcTangentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcTangent::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicArcTangent::s_functionHelper.name());
}
template<typename T>
@@ -31,6 +33,4 @@ Complex<T> HyperbolicArcTangentNode::computeOnComplex(const std::complex<T> c, P
template Complex<float> Poincare::HyperbolicArcTangentNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicArcTangentNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicArcTangent::m_functionHelper = Expression::FunctionHelper("atanh", 1, &HyperbolicArcTangent::UntypedBuilder);
}

View File

@@ -4,11 +4,13 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicCosine::s_functionHelper;
Layout HyperbolicCosineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicCosine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicCosine::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicCosine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicCosine::s_functionHelper.name());
}
int HyperbolicCosineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicCosine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicCosine::s_functionHelper.name());
}
template<typename T>
@@ -19,6 +21,4 @@ Complex<T> HyperbolicCosineNode::computeOnComplex(const std::complex<T> c, Prefe
template Complex<float> Poincare::HyperbolicCosineNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicCosineNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicCosine::m_functionHelper = Expression::FunctionHelper("cosh", 1, &HyperbolicCosine::UntypedBuilder);
}

View File

@@ -4,11 +4,13 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicSine::s_functionHelper;
Layout HyperbolicSineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicSine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicSine::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicSine(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicSine::s_functionHelper.name());
}
int HyperbolicSineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicSine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicSine::s_functionHelper.name());
}
template<typename T>
@@ -19,6 +21,4 @@ Complex<T> HyperbolicSineNode::computeOnComplex(const std::complex<T> c, Prefere
template Complex<float> Poincare::HyperbolicSineNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicSineNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicSine::m_functionHelper = Expression::FunctionHelper("sinh", 1, &HyperbolicSine::UntypedBuilder);
}

View File

@@ -4,11 +4,13 @@
namespace Poincare {
constexpr Expression::FunctionHelper HyperbolicTangent::s_functionHelper;
Layout HyperbolicTangentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(HyperbolicTangent(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicTangent::FunctionHelper()->name());
return LayoutHelper::Prefix(HyperbolicTangent(this), floatDisplayMode, numberOfSignificantDigits, HyperbolicTangent::s_functionHelper.name());
}
int HyperbolicTangentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicTangent::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, HyperbolicTangent::s_functionHelper.name());
}
template<typename T>
@@ -19,6 +21,4 @@ Complex<T> HyperbolicTangentNode::computeOnComplex(const std::complex<T> c, Pref
template Complex<float> Poincare::HyperbolicTangentNode::computeOnComplex<float>(std::complex<float>, Preferences::AngleUnit);
template Complex<double> Poincare::HyperbolicTangentNode::computeOnComplex<double>(std::complex<double>, Preferences::AngleUnit);
constexpr Expression::FunctionHelper HyperbolicTangent::m_functionHelper = Expression::FunctionHelper("tanh", 1, &HyperbolicTangent::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int ImaginaryPartNode::numberOfChildren() const { return ImaginaryPart::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper ImaginaryPart::s_functionHelper;
int ImaginaryPartNode::numberOfChildren() const { return ImaginaryPart::s_functionHelper.numberOfChildren(); }
Layout ImaginaryPartNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(ImaginaryPart(this), floatDisplayMode, numberOfSignificantDigits, ImaginaryPart::FunctionHelper()->name());
return LayoutHelper::Prefix(ImaginaryPart(this), floatDisplayMode, numberOfSignificantDigits, ImaginaryPart::s_functionHelper.name());
}
int ImaginaryPartNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ImaginaryPart::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, ImaginaryPart::s_functionHelper.name());
}
Expression ImaginaryPartNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -42,6 +44,4 @@ Expression ImaginaryPart::shallowReduce(Context & context, Preferences::AngleUni
return *this;
}
constexpr Expression::FunctionHelper ImaginaryPart::m_functionHelper = Expression::FunctionHelper("im", 1, &ImaginaryPart::UntypedBuilder);
}

View File

@@ -10,7 +10,9 @@
namespace Poincare {
int IntegralNode::numberOfChildren() const { return Integral::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Integral::s_functionHelper;
int IntegralNode::numberOfChildren() const { return Integral::s_functionHelper.numberOfChildren(); }
int IntegralNode::polynomialDegree(Context & context, const char * symbolName) const {
if (childAtIndex(0)->polynomialDegree(context, symbolName) == 0
@@ -33,7 +35,7 @@ Layout IntegralNode::createLayout(Preferences::PrintFloatMode floatDisplayMode,
}
int IntegralNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Integral::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Integral::s_functionHelper.name());
}
Expression IntegralNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -207,6 +209,4 @@ Expression Integral::shallowReduce(Context & context, Preferences::AngleUnit ang
return *this;
}
constexpr Expression::FunctionHelper Integral::m_functionHelper = Expression::FunctionHelper("int", 4, &Integral::UntypedBuilder);
}

View File

@@ -9,14 +9,16 @@
namespace Poincare {
int LeastCommonMultipleNode::numberOfChildren() const { return LeastCommonMultiple::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper LeastCommonMultiple::s_functionHelper;
int LeastCommonMultipleNode::numberOfChildren() const { return LeastCommonMultiple::s_functionHelper.numberOfChildren(); }
Layout LeastCommonMultipleNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(LeastCommonMultiple(this), floatDisplayMode, numberOfSignificantDigits, LeastCommonMultiple::FunctionHelper()->name());
return LayoutHelper::Prefix(LeastCommonMultiple(this), floatDisplayMode, numberOfSignificantDigits, LeastCommonMultiple::s_functionHelper.name());
}
int LeastCommonMultipleNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, LeastCommonMultiple::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, LeastCommonMultiple::s_functionHelper.name());
}
Expression LeastCommonMultipleNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -98,6 +100,4 @@ Expression LeastCommonMultiple::shallowReduce(Context & context, Preferences::An
return result;
}
constexpr Expression::FunctionHelper LeastCommonMultiple::m_functionHelper = Expression::FunctionHelper("lcm", 2, &LeastCommonMultiple::UntypedBuilder);
}

View File

@@ -20,15 +20,19 @@
namespace Poincare {
template<>
int LogarithmNode<1>::numberOfChildren() const { return CommonLogarithm::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Logarithm::s_functionHelper;
constexpr Expression::FunctionHelper CommonLogarithm::s_functionHelper;
template<>
int LogarithmNode<2>::numberOfChildren() const { return Logarithm::FunctionHelper()->numberOfChildren(); }
int LogarithmNode<1>::numberOfChildren() const { return CommonLogarithm::s_functionHelper.numberOfChildren(); }
template<>
int LogarithmNode<2>::numberOfChildren() const { return Logarithm::s_functionHelper.numberOfChildren(); }
template<>
Layout LogarithmNode<1>::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, CommonLogarithm::FunctionHelper()->name());
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, CommonLogarithm::s_functionHelper.name());
}
template<>
@@ -40,7 +44,7 @@ Layout LogarithmNode<2>::createLayout(Preferences::PrintFloatMode floatDisplayMo
template<int T>
int LogarithmNode<T>::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, T == 1 ? CommonLogarithm::FunctionHelper()->name() : Logarithm::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, T == 1 ? CommonLogarithm::s_functionHelper.name() : Logarithm::s_functionHelper.name());
}
template<>
@@ -318,10 +322,6 @@ Expression Logarithm::shallowBeautify(Context & context, Preferences::AngleUnit
return *this;
}
constexpr Expression::FunctionHelper Logarithm::m_functionHelper = Expression::FunctionHelper("log", 2, &Logarithm::UntypedBuilder);
constexpr Expression::FunctionHelper CommonLogarithm::m_functionHelper = Expression::FunctionHelper("log", 1, &CommonLogarithm::UntypedBuilder);
template Evaluation<float> LogarithmNode<1>::templatedApproximate<float>(Poincare::Context&, Poincare::Preferences::AngleUnit) const;
template Evaluation<double> LogarithmNode<1>::templatedApproximate<double>(Poincare::Context&, Poincare::Preferences::AngleUnit) const;
template Evaluation<float> LogarithmNode<2>::templatedApproximate<float>(Poincare::Context&, Poincare::Preferences::AngleUnit) const;

View File

@@ -7,18 +7,20 @@
namespace Poincare {
int MatrixDimensionNode::numberOfChildren() const { return MatrixDimension::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper MatrixDimension::s_functionHelper;
int MatrixDimensionNode::numberOfChildren() const { return MatrixDimension::s_functionHelper.numberOfChildren(); }
Expression MatrixDimensionNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return MatrixDimension(this).shallowReduce(context, angleUnit, replaceSymbols);
}
Layout MatrixDimensionNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(MatrixDimension(this), floatDisplayMode, numberOfSignificantDigits, MatrixDimension::FunctionHelper()->name());
return LayoutHelper::Prefix(MatrixDimension(this), floatDisplayMode, numberOfSignificantDigits, MatrixDimension::s_functionHelper.name());
}
int MatrixDimensionNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixDimension::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixDimension::s_functionHelper.name());
}
template<typename T>
@@ -73,6 +75,4 @@ Expression MatrixDimension::shallowReduce(Context & context, Preferences::AngleU
#endif
}
constexpr Expression::FunctionHelper MatrixDimension::m_functionHelper = Expression::FunctionHelper("dim", 1, &MatrixDimension::UntypedBuilder);
}

View File

@@ -10,18 +10,20 @@
namespace Poincare {
int MatrixInverseNode::numberOfChildren() const { return MatrixInverse::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper MatrixInverse::s_functionHelper;
int MatrixInverseNode::numberOfChildren() const { return MatrixInverse::s_functionHelper.numberOfChildren(); }
Expression MatrixInverseNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return MatrixInverse(this).shallowReduce(context, angleUnit, replaceSymbols);
}
Layout MatrixInverseNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(MatrixInverse(this), floatDisplayMode, numberOfSignificantDigits, MatrixInverse::FunctionHelper()->name());
return LayoutHelper::Prefix(MatrixInverse(this), floatDisplayMode, numberOfSignificantDigits, MatrixInverse::s_functionHelper.name());
}
int MatrixInverseNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixInverse::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixInverse::s_functionHelper.name());
}
// TODO: handle this exactly in shallowReduce for small dimensions.
@@ -72,6 +74,4 @@ Expression MatrixInverse::shallowReduce(Context & context, Preferences::AngleUni
#endif
}
constexpr Expression::FunctionHelper MatrixInverse::m_functionHelper = Expression::FunctionHelper("inverse", 1, &MatrixInverse::UntypedBuilder);
}

View File

@@ -9,18 +9,20 @@
namespace Poincare {
int MatrixTraceNode::numberOfChildren() const { return MatrixTrace::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper MatrixTrace::s_functionHelper;
int MatrixTraceNode::numberOfChildren() const { return MatrixTrace::s_functionHelper.numberOfChildren(); }
Expression MatrixTraceNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return MatrixTrace(this).shallowReduce(context, angleUnit, replaceSymbols);
}
Layout MatrixTraceNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(MatrixTrace(this), floatDisplayMode, numberOfSignificantDigits, MatrixTrace::FunctionHelper()->name());
return LayoutHelper::Prefix(MatrixTrace(this), floatDisplayMode, numberOfSignificantDigits, MatrixTrace::s_functionHelper.name());
}
int MatrixTraceNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixTrace::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixTrace::s_functionHelper.name());
}
template<typename T>
@@ -66,6 +68,4 @@ Expression MatrixTrace::shallowReduce(Context & context, Preferences::AngleUnit
#endif
}
constexpr Expression::FunctionHelper MatrixTrace::m_functionHelper = Expression::FunctionHelper("trace", 1, &MatrixTrace::UntypedBuilder);
}

View File

@@ -8,18 +8,20 @@
namespace Poincare {
int MatrixTransposeNode::numberOfChildren() const { return MatrixTranspose::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper MatrixTranspose::s_functionHelper;
int MatrixTransposeNode::numberOfChildren() const { return MatrixTranspose::s_functionHelper.numberOfChildren(); }
Expression MatrixTransposeNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
return MatrixTranspose(this).shallowReduce(context, angleUnit, replaceSymbols);
}
Layout MatrixTransposeNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(MatrixTranspose(this), floatDisplayMode, numberOfSignificantDigits, MatrixTranspose::FunctionHelper()->name());
return LayoutHelper::Prefix(MatrixTranspose(this), floatDisplayMode, numberOfSignificantDigits, MatrixTranspose::s_functionHelper.name());
}
int MatrixTransposeNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixTranspose::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, MatrixTranspose::s_functionHelper.name());
}
template<typename T>
@@ -61,6 +63,4 @@ Expression MatrixTranspose::shallowReduce(Context & context, Preferences::AngleU
#endif
}
constexpr Expression::FunctionHelper MatrixTranspose::m_functionHelper = Expression::FunctionHelper("transpose", 1, &MatrixTranspose::UntypedBuilder);
}

View File

@@ -7,13 +7,15 @@
namespace Poincare {
int NaperianLogarithmNode::numberOfChildren() const { return NaperianLogarithm::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper NaperianLogarithm::s_functionHelper;
int NaperianLogarithmNode::numberOfChildren() const { return NaperianLogarithm::s_functionHelper.numberOfChildren(); }
Layout NaperianLogarithmNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, NaperianLogarithm::FunctionHelper()->name());
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, NaperianLogarithm::s_functionHelper.name());
}
int NaperianLogarithmNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NaperianLogarithm::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NaperianLogarithm::s_functionHelper.name());
}
Expression NaperianLogarithmNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -37,6 +39,4 @@ Expression NaperianLogarithm::shallowReduce(Context & context, Preferences::Angl
return l.shallowReduce(context, angleUnit);
}
constexpr Expression::FunctionHelper NaperianLogarithm::m_functionHelper = Expression::FunctionHelper("ln", 1, &NaperianLogarithm::UntypedBuilder);
}

View File

@@ -10,7 +10,9 @@
namespace Poincare {
int NthRootNode::numberOfChildren() const { return NthRoot::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper NthRoot::s_functionHelper;
int NthRootNode::numberOfChildren() const { return NthRoot::s_functionHelper.numberOfChildren(); }
Layout NthRootNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return NthRootLayout(
@@ -19,7 +21,7 @@ Layout NthRootNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, i
}
int NthRootNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NthRoot::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NthRoot::s_functionHelper.name());
}
Expression NthRootNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -60,6 +62,4 @@ Expression NthRoot::shallowReduce(Context & context, Preferences::AngleUnit angl
return p.shallowReduce(context, angleUnit);
}
constexpr Expression::FunctionHelper NthRoot::m_functionHelper = Expression::FunctionHelper("root", 2, &NthRoot::UntypedBuilder);
}

View File

@@ -154,11 +154,11 @@ int NthRootLayoutNode::serialize(char * buffer, int bufferSize, Preferences::Pri
&& (const_cast<NthRootLayoutNode *>(this))->indexLayout()
&& !(const_cast<NthRootLayoutNode *>(this))->indexLayout()->isEmpty())
{
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NthRoot::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, NthRoot::s_functionHelper.name());
}
// Case: squareRoot(x)
if (!m_hasIndex) {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SquareRoot::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SquareRoot::s_functionHelper.name());
}
// Case: root(x,empty)
// Write "'SquareRootSymbol'('radicandLayout')".

View File

@@ -11,14 +11,16 @@ extern "C" {
namespace Poincare {
int PermuteCoefficientNode::numberOfChildren() const { return PermuteCoefficient::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper PermuteCoefficient::s_functionHelper;
int PermuteCoefficientNode::numberOfChildren() const { return PermuteCoefficient::s_functionHelper.numberOfChildren(); }
Layout PermuteCoefficientNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(PermuteCoefficient(this), floatDisplayMode, numberOfSignificantDigits, PermuteCoefficient::FunctionHelper()->name());
return LayoutHelper::Prefix(PermuteCoefficient(this), floatDisplayMode, numberOfSignificantDigits, PermuteCoefficient::s_functionHelper.name());
}
int PermuteCoefficientNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, PermuteCoefficient::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, PermuteCoefficient::s_functionHelper.name());
}
Expression PermuteCoefficientNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -108,6 +110,4 @@ Expression PermuteCoefficient::shallowReduce(Context & context, Preferences::Ang
}
constexpr Expression::FunctionHelper PermuteCoefficient::m_functionHelper = Expression::FunctionHelper("permute", 2, &PermuteCoefficient::UntypedBuilder);
}

View File

@@ -14,14 +14,16 @@ extern "C" {
namespace Poincare {
int PredictionIntervalNode::numberOfChildren() const { return PredictionInterval::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper PredictionInterval::s_functionHelper;
int PredictionIntervalNode::numberOfChildren() const { return PredictionInterval::s_functionHelper.numberOfChildren(); }
Layout PredictionIntervalNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(PredictionInterval(this), floatDisplayMode, numberOfSignificantDigits, PredictionInterval::FunctionHelper()->name());
return LayoutHelper::Prefix(PredictionInterval(this), floatDisplayMode, numberOfSignificantDigits, PredictionInterval::s_functionHelper.name());
}
int PredictionIntervalNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, PredictionInterval::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, PredictionInterval::s_functionHelper.name());
}
@@ -104,6 +106,4 @@ Expression PredictionInterval::shallowReduce(Context & context, Preferences::Ang
return matrix;
}
constexpr Expression::FunctionHelper PredictionInterval::m_functionHelper = Expression::FunctionHelper("prediction95", 2, &PredictionInterval::UntypedBuilder);
}

View File

@@ -11,12 +11,14 @@ extern "C" {
namespace Poincare {
constexpr Expression::FunctionHelper Product::s_functionHelper;
Layout ProductNode::createSequenceLayout(Layout argumentLayout, Layout symbolLayout, Layout subscriptLayout, Layout superscriptLayout) const {
return ProductLayout(argumentLayout, symbolLayout, subscriptLayout, superscriptLayout);
}
int ProductNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Product::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Product::s_functionHelper.name());
}
template<typename T>
@@ -39,6 +41,4 @@ Evaluation<T> ProductNode::templatedApproximateWithNextTerm(Evaluation<T> a, Eva
return MultiplicationNode::computeOnMatrices<T>(m, n);
}
constexpr Expression::FunctionHelper Product::m_functionHelper = Expression::FunctionHelper("product", 4, &Product::UntypedBuilder);
}

View File

@@ -12,14 +12,16 @@ extern "C" {
namespace Poincare {
int RandintNode::numberOfChildren() const { return Randint::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Randint::s_functionHelper;
int RandintNode::numberOfChildren() const { return Randint::s_functionHelper.numberOfChildren(); }
Layout RandintNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Randint(this), floatDisplayMode, numberOfSignificantDigits, Randint::FunctionHelper()->name());
return LayoutHelper::Prefix(Randint(this), floatDisplayMode, numberOfSignificantDigits, Randint::s_functionHelper.name());
}
int RandintNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Randint::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Randint::s_functionHelper.name());
}
template <typename T> Evaluation<T> RandintNode::templateApproximate(Context & context, Preferences::AngleUnit angleUnit) const {
@@ -35,6 +37,4 @@ template <typename T> Evaluation<T> RandintNode::templateApproximate(Context & c
return Complex<T>(result);
}
constexpr Expression::FunctionHelper Randint::m_functionHelper = Expression::FunctionHelper("randint", 2, &Randint::UntypedBuilder);
}

View File

@@ -8,18 +8,20 @@
namespace Poincare {
int RandomNode::numberOfChildren() const { return Random::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Random::s_functionHelper;
int RandomNode::numberOfChildren() const { return Random::s_functionHelper.numberOfChildren(); }
Expression RandomNode::setSign(Sign s, Context & context, Preferences::AngleUnit angleUnit) {
return Random(this).setSign(s, context, angleUnit);
}
Layout RandomNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Random(this), floatDisplayMode, numberOfSignificantDigits, Random::FunctionHelper()->name());
return LayoutHelper::Prefix(Random(this), floatDisplayMode, numberOfSignificantDigits, Random::s_functionHelper.name());
}
int RandomNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Random::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Random::s_functionHelper.name());
}
template <typename T> Evaluation<T> RandomNode::templateApproximate() const {
@@ -50,6 +52,4 @@ template Evaluation<double> RandomNode::templateApproximate<double>() const;
template float Random::random();
template double Random::random();
constexpr Expression::FunctionHelper Random::m_functionHelper = Expression::FunctionHelper("random", 0, &Random::UntypedBuilder);
}

View File

@@ -7,14 +7,16 @@
namespace Poincare {
int RealPartNode::numberOfChildren() const { return RealPart::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper RealPart::s_functionHelper;
int RealPartNode::numberOfChildren() const { return RealPart::s_functionHelper.numberOfChildren(); }
Layout RealPartNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(RealPart(this), floatDisplayMode, numberOfSignificantDigits, RealPart::FunctionHelper()->name());
return LayoutHelper::Prefix(RealPart(this), floatDisplayMode, numberOfSignificantDigits, RealPart::s_functionHelper.name());
}
int RealPartNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, RealPart::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, RealPart::s_functionHelper.name());
}
Expression RealPartNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -41,6 +43,4 @@ Expression RealPart::shallowReduce(Context & context, Preferences::AngleUnit ang
return *this;
}
constexpr Expression::FunctionHelper RealPart::m_functionHelper = Expression::FunctionHelper("re", 1, &RealPart::UntypedBuilder);
}

View File

@@ -9,14 +9,16 @@
namespace Poincare {
int RoundNode::numberOfChildren() const { return Round::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Round::s_functionHelper;
int RoundNode::numberOfChildren() const { return Round::s_functionHelper.numberOfChildren(); }
Layout RoundNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Round(this), floatDisplayMode, numberOfSignificantDigits, Round::FunctionHelper()->name());
return LayoutHelper::Prefix(Round(this), floatDisplayMode, numberOfSignificantDigits, Round::s_functionHelper.name());
}
int RoundNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Round::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Round::s_functionHelper.name());
}
Expression RoundNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -80,6 +82,4 @@ Expression Round::shallowReduce(Context & context, Preferences::AngleUnit angleU
return *this;
}
constexpr Expression::FunctionHelper Round::m_functionHelper = Expression::FunctionHelper("round", 2, &Round::UntypedBuilder);
}

View File

@@ -7,7 +7,9 @@
namespace Poincare {
int SineNode::numberOfChildren() const { return Sine::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Sine::s_functionHelper;
int SineNode::numberOfChildren() const { return Sine::s_functionHelper.numberOfChildren(); }
float SineNode::characteristicXRange(Context & context, Preferences::AngleUnit angleUnit) const {
return Trigonometry::characteristicXRange(Sine(this), context, angleUnit);
@@ -21,11 +23,11 @@ Complex<T> SineNode::computeOnComplex(const std::complex<T> c, Preferences::Angl
}
Layout SineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Sine(this), floatDisplayMode, numberOfSignificantDigits, Sine::FunctionHelper()->name());
return LayoutHelper::Prefix(Sine(this), floatDisplayMode, numberOfSignificantDigits, Sine::s_functionHelper.name());
}
int SineNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sine::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sine::s_functionHelper.name());
}
Expression SineNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit, bool replaceSymbols) {
@@ -48,6 +50,4 @@ Expression Sine::shallowReduce(Context & context, Preferences::AngleUnit angleUn
return Trigonometry::shallowReduceDirectFunction(*this, context, angleUnit);
}
constexpr Expression::FunctionHelper Sine::m_functionHelper = Expression::FunctionHelper("sin", 1, &Sine::UntypedBuilder);
}

View File

@@ -10,14 +10,16 @@
namespace Poincare {
int SquareRootNode::numberOfChildren() const { return SquareRoot::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper SquareRoot::s_functionHelper;
int SquareRootNode::numberOfChildren() const { return SquareRoot::s_functionHelper.numberOfChildren(); }
Layout SquareRootNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return NthRootLayout(childAtIndex(0)->createLayout(floatDisplayMode, numberOfSignificantDigits));
}
int SquareRootNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SquareRoot::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, SquareRoot::s_functionHelper.name());
}
template<typename T>
@@ -53,6 +55,4 @@ Expression SquareRoot::shallowReduce(Context & context, Preferences::AngleUnit a
return p.shallowReduce(context, angleUnit);
}
constexpr char SquareRoot::k_name[2] = {Ion::Charset::Root, 0};
constexpr Expression::FunctionHelper SquareRoot::m_functionHelper = Expression::FunctionHelper(SquareRoot::k_name, 1, &SquareRoot::UntypedBuilder);
}

View File

@@ -11,12 +11,14 @@ extern "C" {
namespace Poincare {
constexpr Expression::FunctionHelper Sum::s_functionHelper;
Layout SumNode::createSequenceLayout(Layout argumentLayout, Layout symbolLayout, Layout subscriptLayout, Layout superscriptLayout) const {
return SumLayout(argumentLayout, symbolLayout, subscriptLayout, superscriptLayout);
}
int SumNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sum::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Sum::s_functionHelper.name());
}
template<typename T>
@@ -39,6 +41,4 @@ Evaluation<T> SumNode::templatedApproximateWithNextTerm(Evaluation<T> a, Evaluat
return AdditionNode::computeOnMatrices<T>(m, n);
}
constexpr Expression::FunctionHelper Sum::m_functionHelper = Expression::FunctionHelper("sum", 4, &Sum::UntypedBuilder);
}

View File

@@ -10,18 +10,20 @@
namespace Poincare {
int TangentNode::numberOfChildren() const { return Tangent::FunctionHelper()->numberOfChildren(); }
constexpr Expression::FunctionHelper Tangent::s_functionHelper;
int TangentNode::numberOfChildren() const { return Tangent::s_functionHelper.numberOfChildren(); }
float TangentNode::characteristicXRange(Context & context, Preferences::AngleUnit angleUnit) const {
return Trigonometry::characteristicXRange(Tangent(this), context, angleUnit);
}
Layout TangentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return LayoutHelper::Prefix(Tangent(this), floatDisplayMode, numberOfSignificantDigits, Tangent::FunctionHelper()->name());
return LayoutHelper::Prefix(Tangent(this), floatDisplayMode, numberOfSignificantDigits, Tangent::s_functionHelper.name());
}
int TangentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Tangent::FunctionHelper()->name());
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, Tangent::s_functionHelper.name());
}
template<typename T>
@@ -59,6 +61,4 @@ Expression Tangent::shallowReduce(Context & context, Preferences::AngleUnit angl
return newExpression;
}
constexpr Expression::FunctionHelper Tangent::m_functionHelper = Expression::FunctionHelper("tan", 1, &Tangent::UntypedBuilder);
}