#include #include #include #include extern "C" { #include } #include namespace Poincare { ComplexArgumentNode * ComplexArgumentNode::FailedAllocationStaticNode() { static AllocationFailureExpressionNode failure; TreePool::sharedPool()->registerStaticNodeIfRequired(&failure); return &failure; } LayoutReference ComplexArgumentNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { return LayoutHelper::Prefix(ComplexArgument(this), floatDisplayMode, numberOfSignificantDigits, name()); } int ComplexArgumentNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, name()); } Expression ComplexArgumentNode::shallowReduce(Context & context, Preferences::AngleUnit angleUnit) { return ComplexArgument(this).shallowReduce(context, angleUnit); } template Complex ComplexArgumentNode::computeOnComplex(const std::complex c, Preferences::AngleUnit angleUnit) { return Complex(std::arg(c)); } Expression ComplexArgument::shallowReduce(Context & context, Preferences::AngleUnit angleUnit) { { Expression e = Expression::defaultShallowReduce(context, angleUnit); if (e.isUndefinedOrAllocationFailure()) { return e; } } #if MATRIX_EXACT_REDUCING Expression c = childAtIndex(0); if (c.type() == ExpressionNode::Type::Matrix) { return SimplificationHelper::Map(*this, context, angleUnit); } #endif return *this; } }