42 bool Opposite::needParenthesisWithParent(
const Expression * e)
const {
44 return e->isOfType(types, 7);
53 Expression * e = Expression::shallowReduce(context, angleUnit);
58 #if MATRIX_EXACT_REDUCING 60 return SimplificationEngine::map(
this, context, angleUnit);
66 return m->shallowReduce(context, angleUnit);
69 ExpressionLayout * Opposite::privateCreateLayout(
PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat)
const {
72 ExpressionLayout * children_layouts[2];
73 char string[2] = {
'-',
'\0'};
74 children_layouts[0] =
new StringLayout(
string, 1);
76 return new HorizontalLayout(children_layouts, 2);
79 int Opposite::writeTextInBuffer(
char * buffer,
int bufferSize,
int numberOfSignificantDigits)
const {
80 if (bufferSize == 0) {
83 buffer[bufferSize-1] = 0;
85 if (bufferSize == 1) {
return 0; }
86 buffer[numberOfChar++] =
'-';
87 numberOfChar +=
operand(0)->
writeTextInBuffer(buffer+numberOfChar, bufferSize-numberOfChar, numberOfSignificantDigits);
88 buffer[numberOfChar] = 0;
Expression * clone() const override
int polynomialDegree(char symbolName) const override
static Complex< T > Cartesian(T a, T b)
Expression * replaceWith(Expression *newOperand, bool deleteAfterReplace=true)
static Complex< T > compute(const Complex< T > c, AngleUnit angleUnit)
const Expression * m_operands[T]
friend class Multiplication
ExpressionLayout * createLayout(PrintFloat::Mode floatDisplayMode=PrintFloat::Mode::Default, ComplexFormat complexFormat=ComplexFormat::Default) const
Sign sign() const override
Type type() const override
void detachOperand(const Expression *e)
const Expression * operand(int i) const
virtual int polynomialDegree(char symbolName) const
virtual Type type() const =0
virtual int writeTextInBuffer(char *buffer, int bufferSize, int numberOfSignificantDigits=PrintFloat::k_numberOfStoredSignificantDigits) const =0